[A quick summary of what I've been sent (mainly by Daniel Biddle) on
how to use procmail with vpopmail on a domain wide basis ie with
procmail filtering everything coming to the domain before vdelivermail
gets hold of it. Skip to bottom if you want to know how.]
>From various procmail manuals/source etc:
* procmail wipes out its environment (except for TZ) on startup,
unless you specify -p. This will interfere with vdelivermail, which
needs EXT and HOST so that it knows who to deliver to; so, add -p to
the procmail command.
* There's a recipe flag 'w' to tell procmail to wait for the filter or
program to finish; presumably without this it doesn't. Using this is
probably a good idea: http://www.procmail.org/jari/ shows a warning
from a procmail lint about w being omitted.
>From a search on google I found that the way to get vpopmail working
with procmail entailed getting procmail to deliver to stdout using the
line
DEFAULT="|"
in your procmailrc file, and:
|preline procmail -p | /path/to/vdelivermail '' bounce-no-mailbox
(all on one line) in your .qmail-default. However this causes
wierdness with non-delivering recipes as vdelivermail goes on to
deliver empty files. A fix for this was suggested to be to put the
vdelivermail bit in the DEFAULT assignment like:
DEFAULT="|/path/to/vdelivermail '' bounce-no-mailbox"
to get default delivery to vdelivermail. However this appears to be
ignored by procmail. None of the man pages or FAQs say you can do this
so it may be that procmail doesnt support this.
There's another way that looks better: in .qmail-default, we can put
|preline procmail
and let /etc/procmailrc or the user's .procmailrc end with
TRAP="/home/vpopmail/bin/vdelivermail '' bounce-no-mailbox"
so that procmail finishes by handing the message straight to
vdelivermail. I've never managed to get this working though.
**Solution**
Blindingly obviously (but completely missed by me :), it appears the
simplest way is to add a catchall recipe to the end of your procmailrc
file that calls vdelivermail explicitly with the 'w' flag. You
shouldnt have to use locking as the Maildir algorithm doesnt require
locks. So something like:
:0w
|/path/to/vdelivermail '' bounce-no-mailbox
at the end of your procmailrc and in your .qmail-default just add
|preline procmail -p -m /path/to/procmailrc
Remember the '-p'. You can use the same call to vdelivermail in other
recipes that deliver to users within the virtualhost.
Hope this helps someone else, and thanks again to everyone who
responded,
Marcus
--
Marcus Williams - http://www.onq2.com
Quintic Ltd, 39 Newnham Rd, Cambridge, CB3 9EY