March 14, 2003
qmail. vpopmail. procmail. How comes they just don't want to work together?
procmail: Program failure (100) of "/var/qmail/vpopmail/bin/vdelivermail"
From [email protected] Fri Mar 14 02:12:30 2003
Subject: test
Folder: **Bounced** 782
Anyone seen this problem before?
Comments
I just finished working on exactly this problem. It took me more than 12 hours to solve it. Non of what Google came up with worked for me.
This is my procmailrc file
###### Procmairc start ##########
#
# Uncomment these if you want to debug
#VERBOSE=ON
#LOGFILE=/tmp/procmail.log
# Find the users home directory and store in variable
VIRTUALHOME=`/var/vpopmail/bin/vuserinfo -d $EXT@$HOST`
# Location of safecat
SAFECAT=/usr/local/bin/safecat
# Location of the users Maildir
MAILDIR=$VIRTUALHOME/Maildir
# Give each user a spamfolder where spam-tagged mail will be delivered.
SPAMDIR=$VIRTUALHOME/Maildir/.Spam
# Check if the user have a spamfolder, if not, create one.
# We never use this variable, but the command will be executed, dirty dirty.
CHECKSPAMFOLDER=`if [ ! -d $SPAMDIR ]; then /var/courier-imap/bin/maildirmake $SPAMDIR && chown -R vpopmail:vchkpw $SPAMDIR && echo "INBOX.Spam >> $MAILDIR/courieimapsubscribed"; fi`
# Finally we can let SpamAssassin check our mail.
:0fw
| /usr/bin/spamassassin
# If the message is tagged as spam, put it in spamfolder
:0w
* ^X-Spam-Status: Yes
| $SAFECAT $MAILDIR/tmp $SPAMDIR/new
# If the message is considered clean, deliver as normal.
:0w
| $SAFECAT $MAILDIR/tmp $MAILDIR/new
###### Procmairc end ##########
NOTE: The CHECKSPAMFOLDER is only for squirrelmail.
In .qmail-default iI have this:
| preline /usr/bin/procmail -p -m /path/to/procmailrc
Good luck
commented by: J�ran Kvalvaag at November 2, 2003 12:30 AM
Great Help! This file was exactly what I have spent ages looking for!
Have you had problems with the qmail message que getting quite long? Just wondering ....
commented by: Adrian Robertson at November 18, 2003 10:10 AM
Hi, we have been using the script you suggested and it works well. Although how do you catch email accounts that do not exist? Any help would be great!
commented by: Adrian at November 20, 2003 11:19 AM
On my server, where vpopmail uses MySQL and so on, the solution presented on the first comment fails on alias users, for example if the user has an account 'firstnameX', the vuserinfo fails to find user as '[email protected]', which is kinda groody.
(The solution would've been quite what i've been searching for otherwise.)
Another thing I haven't quite figured out yet are the .qmail-user -files, procmail gets run only if it's in domain's .qmail-default , and .qmail-username -files never seem to get processed.
If anyone would've thoughts on these issues, I'd be pleasantly surprised to get back an email covering them.
cheers.
commented by: bunny at February 2, 2004 10:35 AM
as Adrian commented on catching email accounts that doesnt exist, I tried putting
:0w
|/var/vpopmail/bin/vdelivermail '' bounce-no-mailbox
but it didn't work, mail kept getting requeued.
my temporary solution was to put
:0
*
/var/vpopmail/domains/dom/postmaster/Maildir/noaccount/
at the end of procmailrc.
commented by: xedx at February 13, 2004 05:10 AM
To solve the "non-existent" user problem, I just create a symbolically linked .qmail-username file for each user to a file called .qmail-template. The .qmail-template file contains what the author listed above. My .qmail-default file then looks like
"| /var/vpopmail/bin/vdelivermail '' delete" to delete the messages
or you can use
"| /var/vpopmail/bin/vdelivermail '' bounce-no-mailbox" to bounce the message
With the .qmail-default set to one of these I do not have to worry about any non-existent user. Yes it adds one more step after creating a virtual user, but it solves the issue and everything behave like I would want it to.
commented by: bonger at April 5, 2004 02:44 PM
Great stuff. Here is another solution to the problem, which uses maildrop instead of procmail for the mail delivery:
http://wotsit.thingy.com/haj/mailfilter-spamassassin-vpopmail.shtml
Works well in some quick tests, and has no problem with non-existant mailboxes.
Lawrence
lawrence (at) aslak (dot) net
commented by: Lawrence Manning at July 6, 2004 08:34 PM