[OT] fetchmail, procmail and mutt (oh my!)
Giorgos Keramidas
keramida at ceid.upatras.gr
Wed Jun 30 20:47:54 PDT 2004
On 2004-06-30 21:46, "Andrew L. Gould" <algould at datawok.com> wrote:
> Problem:
> If I put 'mda /usr/local/bin/procmail' in the .fetchmailrc lines,
> procmail puts the emails in the correct mbox files; but mutt complains
> that the files are not valid email files and refuses to read them.
> [...]
> Here's the top of .procmailrc and the freebsd recipe:
>
> MAILDIR=/home/algould/pmail
> LOGFILE=$MAILDIR/procmail.log
> VERBOSE=1
> DEFAULT=/home/algould/pmail/inbox
>
> :0 :
> * .*freebsd
> /home/algould/pmail/freebsd
You're using a relatively strange way to specify the mailbox file name.
Setting $MAILDIR in .procmailrc means that you can simply use:
:0 H
* ^sender: owner-freebsd-doc at freebsd.org
freebsd-doc
Note the lack of path name in the mailbox file. IMHO, it's simpler this
way. You can even match all teh FreeBSD lists and save the messages in
`properly' named mailboxes like this:
:0 H
* ^Sender: owner[^@]*@freebsd.org
{
:0 H
* ^Sender: owner-cvs-\/[^@]*
freebsd-cvs-$MATCH
:0 H
* ^Sender: owner-freebsd-\/[^@]*
freebsd-$MATCH
}
Anyway, putting this aside for a while, you can see what procmail does
to your messages with:
VERBOSE=yes
LOGABSTRACT=yes
LOGFILE=$HOME/procmail.log
Touch ~/procmail.log and start a tail -f on it. Then fire up fetchmail
and watch the tail output. This should at least give you a hint about
the actions of procmail.
Once a few messages get delivered to a mailbox, say `freebsd-questions',
stop fetchmail and look with a text editor at the mailbox file. If it's
not corrupt, you should see something like this:
giorgos at gothmog:~$ head mail/freebsd-questions | cat -vte
From owner-freebsd-questions at freebsd.org Thu Jul 1 05:49:31 2004$
Received: from igloo.linux.gr (gothmog [127.0.0.1])$
^Iby gothmog.gr (8.12.11/8.12.11) with ESMTP id i612nNiG018351$
^Ifor <giorgos at localhost>; Thu, 1 Jul 2004 05:49:31 +0300 (EEST)$
^I(envelope-from owner-freebsd-questions at freebsd.org)$
Received: from mx2.freebsd.org (mx2.freebsd.org [216.136.204.119])$
^Iby igloo.linux.gr (8.12.10/8.12.10/Debian-2) with ESMTP id i612m2Oa002558$
^Ifor <keramida at linux.gr>; Thu, 1 Jul 2004 05:48:06 +0300$
Received: from hub.freebsd.org (hub.freebsd.org [216.136.204.18])$
^Iby mx2.freebsd.org (Postfix) with ESMTP$
giorgos at gothmog:~$
Look carefully at the first line. It shouldn't contain any special
characters (like the ^I characters shown further down) and the format
should be similar to the one above (starting with "From", followed
immediately by the sender address and then by a timestamp/date).
Otherwise, mailers will assume that this mailbox is either:
a) broken
b) not a mailbox file
Then you'll have to investigate why your procmail thinks that it should
use a mailbox format other than UNIX mbox.
- Giorgos
More information about the freebsd-questions
mailing list