From owner-freebsd-questions Sat Aug 24 22:37:23 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E897B37B400 for ; Sat, 24 Aug 2002 22:37:20 -0700 (PDT) Received: from c3po.artlogix.com (sense-mcglk-240.oz.net [216.39.168.240]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7779843E4A for ; Sat, 24 Aug 2002 22:37:20 -0700 (PDT) (envelope-from mcglk@artlogix.com) Received: from ralf.artlogix.com.artlogix.com (ralf.artlogix.com [192.168.0.4]) by c3po.artlogix.com (Postfix) with ESMTP id 69A741A97D; Sat, 24 Aug 2002 22:38:51 -0700 (PDT) To: Lord Raiden Cc: FreeBSD Questions Subject: Re: New fetchmail problem References: <4.2.0.58.20020825013113.00963a90@192.168.0.25> From: Ken McGlothlen Date: 24 Aug 2002 22:37:38 -0700 In-Reply-To: <4.2.0.58.20020825013113.00963a90@192.168.0.25> Message-ID: <86ptw75wil.fsf@ralf.artlogix.com> Lines: 52 User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Cuyahoga Valley) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Lord Raiden 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( ) { 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