Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Jul 2004 06:15:46 +0300
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        "Andrew L. Gould" <algould@datawok.com>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: [OT] fetchmail, procmail and mutt (oh my!)
Message-ID:  <20040701031546.GC18146@gothmog.gr>
In-Reply-To: <200406302146.31818.algould@datawok.com>
References:  <200406302146.31818.algould@datawok.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2004-06-30 21:46, "Andrew L. Gould" <algould@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@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@gothmog:~$ head mail/freebsd-questions | cat -vte
    From owner-freebsd-questions@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@localhost>; Thu, 1 Jul 2004 05:49:31 +0300 (EEST)$
    ^I(envelope-from owner-freebsd-questions@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@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@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040701031546.GC18146>