procmail
[Top] [All Lists]

Re: curios filenames generated by procmail

2002-01-31 12:37:08
Andre Konopka <andre(_dot_)konopka(_at_)presse-data(_dot_)de> writes:
I am using procmail 3.1.15 together with postfix and courier-imap.
Postfix uses procmail to deliver mail to the user (main.cf :
mailbox_command = /opt/procmail/bin/procmail)


I just tried to filter some of my mails on the server. Here are my very
simple recipe:

:0 H
* ^From:.*andre.konopka.*
.a/new

This moves the Mail to the directory /home/Maildir/.a/new
No problem, but how about the filename. It looks like 

msg.IDQ
msg.MDQ

Without filtering the filenames looks like the following ones:

_zrE.RjlV8.hostname
_zF.xK2V8.hostname

Why are the generated names are so different?

Because you told procmail to deliver to a directory named ".a/new" instead
of a maildir folder named ".a".  To quote the procmailrc(5) manpage:

       Anything else will be taken as a mailbox  name  (either  a
       filename  or a directory, absolute or relative to the cur-
       rent directory (see MAILDIR)).  If it is a  (possibly  yet
       nonexistent) filename, the mail will be appended to it.

       If  it  is  a  directory,  the mail will be delivered to a
       newly created, guaranteed to be unique file named $MSGPRE-
       FIX* in the specified directory. ...
              ...  If the mailbox name ends  in  "/",  then  this
       directory  is presumed to be a maildir folder; i.e., proc-
       mail will deliver the message to a file in a  subdirectory
       named  "tmp"  and  rename  it  to be inside a subdirectory
       named "new".
...

So, the correct recipe would be:

        :0
        * ^From:.*andre.konopka
        .a/

(The 'H' flag is the default.  A trailing ".*" on a condition doesn't
change whether procmail matches, so unless you're using \/ and $MATCH,
it only slows procmail down.)


Philip Guenther
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>