procmail
[Top] [All Lists]

Re: automatically filter mailinglists

2009-05-15 12:31:14
At 23:51 2009-05-13 +0200, buro bjorn wrote:
I got the script to work (see <http://pastie.org/477378>http://pastie.org/477378). It processes the emails and creates subfolders. However I still get an error message: Error while writing "/home/bjorn/Mail/.INBOX.mailinglists.symfony-users/_HTE.q3zCKB.hq"

I must ask, why are you using the lockfile flag on recipes which are performing maildir delivery? You are in effect trying to lock the directory. Lockfiles are appropriate for mbox delivery, not maildir or mailfolder.

 which I presume has to do with the subfolder not existing yet.

Maildir folders are automatically created by procmail as needed (see 'man procmailrc'). Directory creation is more of an issue for mbox delivery. If you needed to accomplish directory creation, one could do so BEFORE attempting delivery by adding something like this before line 39 from your most recent web link:

        :0 Wic
        * ? test ! -d $$INBOXPATH.$LISTNAME
        | mkdir $INBOXPATH.$LISTNAME

Flags translate as:
        W - wait for this recipe to complete before continuing, and don't
                blow a gasket if there's an error.
        i - ignore write errors (the message isn't actually being read by
                mkdir, so you can expect procmail to sense the message
                wasn't processed)
        c - operate on a COPY of the message (which means the original
                message is still waiting for processing by the following
                rules).

This would negate the need for your code on lines 42-52 (which are a bit moot since you're using maildir format). Additionally, the 'e' flag you have on line 44 is a bit superfluous - the immediatley preceeding recipe has no conditions, so the only reason you'd reach line 44 is if it failed. It's not a problem that you specify the 'e' flag, but it's worth noting that you don't use 'e' on the "still failed" recipe at the bottom...

I trust you're checking this in a sandbox configuration, and not on your live email stream?

procmail: Locking "/home/bjorn/Mail/.INBOX.mailinglists.symfony-users/.lock"
procmail: Error while writing to "/home/bjorn/Mail/.INBOX.mailinglists.symfony-users/_HTE%K4zCKB.hq" procmail: Lock failure on "/home/bjorn/Mail/.INBOX.mailinglists.symfony-users/.lock" procmail: Assigning "LASTFOLDER=/home/bjorn/Mail/.INBOX.mailinglists.symfony-users/new/1242250786.17607_0.hq"

The implication at this line is that it successfully wrote THIS file - specifically because it's in a SUBDIR of the folder, rather than directly within it.

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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