Date: 24 Aug 2002 22:37:38 -0700 From: Ken McGlothlen <mcglk@artlogix.com> To: Lord Raiden <raiden23@netzero.net> Cc: FreeBSD Questions <freebsd-questions@FreeBSD.ORG> Subject: Re: New fetchmail problem Message-ID: <86ptw75wil.fsf@ralf.artlogix.com> In-Reply-To: <4.2.0.58.20020825013113.00963a90@192.168.0.25> References: <4.2.0.58.20020825013113.00963a90@192.168.0.25>
next in thread | previous in thread | raw e-mail | index | archive | help
Lord Raiden <raiden23@netzero.net> writes:
| Can anyone tell me how to get fetchmail to just grab my mail, dump it into my
| mailbox and just perty much ignore everything else? I don't need it to
| resolve names as it's grabbing stuff, I don't need it verifying names, etc.
| I just want it to download my mail and that's it. No whining, no gripping,
| nada. Any suggestions? Or should I switch to a different fetchmail program?
Well, what I did was this:
$ fetchmail --norewrite --invisible --mda procmail
That works great.
*
Actually, I'm lying. I use this script, called "getmail":
#!/usr/local/bin/perl -w
use strict;
my $fetchmail = "/usr/local/bin/fetchmail";
my $procmail = "/usr/local/bin/procmail";
my $fetchopts = "--norewrite --invisible --mda $procmail";
sub nabem {
my( $fromwhere ) = shift;
my( $bytecount, $messagecount ) = (0,0);
open( F, "$fetchmail $fetchopts $fromwhere |" );
while( <F> ) {
if( /^reading\s+message\s+[^:]+:\s*
(\d+)\s+of\s+(\d+)\s+
\((\d+)\s+header\s+octets\).*?
\((\d+)\s+body\s+octets\).*flushed.*$/x ) {
printf( "* Read %4d of %4d (%7d header + %7d body = %7d bytes)\n",
$1, $2, $3, $4, $3 + $4 );
$bytecount += $3 + $4;
++$messagecount;
} else {
print "$_";
}
}
close( F );
printf( "Total transferred: %d messages, %s KiB.\n", $messagecount,
sprintf( "%.1f", $bytecount / 1024.0 ) );
}
&nabem( "yourhostname" );
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86ptw75wil.fsf>
