I've configured a few procmail filters and they don't seem to work. I've made the rule that mail from a certain sender should be moved to a mailfolder, that didn't work. Then I've tried to change the rule to throw away the mail when recieved, but that doesn't work either.
Is there any way to debug procmail?

Re:Procmail filters don't seem to work
There's a procmail logfile in /var/log/procmail.log.
If there are any errors/warnings, they'll show up in there. -Eric
Re:Procmail filters don't seem to work
Oh, and I didn't use the setup.sh...
Re:Procmail filters don't seem to work
I suspect not using the install.sh is the issue -- something in the mix isn't configured quite right. It's hard to tell exactly what, there's a lot of moving parts in this realm :-)
Do you see any errors in the mail log? If something is awry with Postfix or procmail, it may show up in the mail log. -Eric
Re:Procmail filters don't seem to work
Fluor:/home/thies # tail -f /var/log/mail.err May 19 11:37:07 Fluor local[429]: fatal: execvp /etc/webmin/virtual-server/autoreply.pl: No such file or directory May 19 11:51:54 Fluor local[678]: fatal: execvp /etc/webmin/virtual-server/autoreply.pl: No such file or directory May 19 11:51:57 Fluor local[682]: fatal: execvp /etc/webmin/virtual-server/autoreply.pl: No such file or directory May 19 12:01:25 Fluor local[1139]: fatal: execvp /etc/webmin/virtual-server/autoreply.pl: No such file or directory
Errors, yes, but not related I think.
Fluor:/home/thies # tail -f /var/log/mail.warn May 27 19:14:48 Fluor postfix/smtpd[30848]: warning: 190.188.106.5: address not listed for hostname 5-106-188-190.cab.prima.net.ar May 27 19:17:10 Fluor postfix/smtpd[30848]: warning: 189.25.88.175: address not listed for hostname 18925088175.user.veloxzone.com.br May 27 19:18:31 Fluor postfix/smtpd[30848]: warning: 88.146.158.226: address not listed for hostname cl226.zl1.tcservis.cz May 27 19:18:33 Fluor postfix/smtpd[30848]: warning: 88.146.158.226: address not listed for hostname cl226.zl1.tcservis.cz
Also not related.
It almost looks like procmail doesn't run.. or is it only invoked? (I'm kinda a procmail noob).
Re:Procmail filters don't seem to work
Since you have "LOGFILE=/var/log/procmail.log" set in the procmailrc, that's making me think procmail isn't running.
What permissions do you have set on /usr/bin/procmail? My system has:
[code:1] ls -l /usr/bin/procmail -rwsr-sr-x 1 root mail 72316 2007-03-27 14:35 /usr/bin/procmail [/code:1]
However, normally Virtualmin uses this as the mailbox_home:
[code:1]mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME[/code:1]
But that requires the procmail-wrapper package from the Virtualmin repository. Normally, that's setup by the installer -- but you can manually add the repository to your system, or even manually download the package from:
http://software.virtualmin.com/gpl/
Re:Procmail filters don't seem to work
But is procmail wrapper really needed? The perms:
Fluor:/home/thies # ls -l /usr/bin/procmail -rwsr-sr-x 1 root root 74208 2007-08-02 18:50 /usr/bin/procmail
Further; I can't see a suitable source for SLES10, which I am running...
Re:Procmail filters don't seem to work
If procmail alone isn't working...then yeah, it's needed. ;-)
You can grab procmail-wrapper.c or the SRPM and build it yourself.
http://software.virtualmin.com/gpl/centos/5/SRPMS/procmail-wrapper-1.0-1...
rpmbuild --rebuild procmail-wrapper-1.0-1.vm.src.rpm
And then install the resulting package.
Re:Procmail filters don't seem to work
Hm. It's empty. Is that normal?
Re:Procmail filters don't seem to work
If procmail is working, then no, that's very abnormal :-)
It should be filled with all sorts of email delivery goodness (it should show information about every email delivery in there, successful or not).
Did you by chance install Virtualmin using the install.sh script?
If not, Postfix may not be configured to deliver using procmail. What is the "mailbox_command" set to in your /etc/postfix/main.cf file?
And what are the contents of your /etc/procmailrc file? -Eric
Re:Procmail filters don't seem to work
The contents of /etc/procmailrc:
LOGFILE=/var/log/procmail.log TRAP=/etc/webmin/virtual-server/procmail-logger.pl :0wi VIRTUALMIN=|/etc/webmin/virtual-server/lookup-domain.pl $LOGNAME :0 * ?/usr/bin/test "$VIRTUALMIN" != "" { INCLUDERC=/etc/webmin/virtual-server/procmail/$VIRTUALMIN } ORGMAIL=$HOME/Maildir/ DEFAULT=$HOME/Maildir/ DROPPRIVS=yes :0 * ^X-Spam-Status: Yes Junk/
the mailbox_command directive in main.cf is mailbox_command = /usr/bin/procmail
which is correct, as I can see...
Re:Procmail filters don't seem to work
Okay, I've build and installed the wrapper succesfully; and changed the mailbox_command to
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
and restarted postfix. However, no response in /var/log/procmail.log; any way to verify it's correct functioning?
Re:Procmail filters don't seem to work
Does delivery to procmail-wrapper show up in maillog?
Re:Procmail filters don't seem to work
No... it doesn't. I've tried sending a testmail:
May 28 11:38:57 Fluor postfix/qmgr[22204]: 319EF2E682EF: from=<thijs@XXX.nl>, size=23034, nrcpt=1 (queue active) May 28 11:38:57 Fluor postfix/smtpd[22373]: disconnect from localhost[127.0.0.1] May 28 11:38:57 Fluor postfix/local[23225]: 319EF2E682EF: to=<ebrius_thijs@Fluor.XXX.nl>, orig_to=<thijs@XXX.nl>, relay=local, delay=0, status=sent (delivered to maildir) May 28 11:38:57 Fluor postfix/qmgr[22204]: 319EF2E682EF: removed
Re:Procmail filters don't seem to work
That seems like mailbox_command isn't set. Are you sure it isn't commented out or something?
Re:Procmail filters don't seem to work
It looks like you're right, but I've tried several options in main.cf and they won't load for some reason...
When I check the config in webmin:
main.cf
parameters defined as per defaults command_directory /usr/sbin config_directory /etc/postfix debug_peer_level 2 defer_transports
disable_dns_lookups no disable_mime_output_conversion no inet_interfaces all mail_owner postfix mail_spool_directory /var/mail mailbox_command
mailbox_transport
so no mailbox_command directive.
edit: my god, I'm stupid... it was put in the main.cf twice, and the last had precedence.
Re:Procmail filters don't seem to work
hi Joe, hi Eric, I need some help concerning procmail too. I used your install-script for setting up the system. Following problem: -If an e-mail user logs into his usermin account and sets a forwarding rule (forward to address xxx and deliver to mailbox), the forwarding doesn't work. delivering to the mailbox works. -If the server-owner creates the same rule for the e-mail user in his virtualmin account, forwarding works fine.
There seems to be a problem with procmail because the logfile /var/log/procmail.log is empty, the result from: [code:1]Jun 6 01:36:40 v10 procmail[14579]: Error while writing to "/var/log/procmail.log" Jun 6 09:52:25 v10 procmail[1561]: Error while writing to "/var/log/procmail.log" Jun 6 10:05:18 v10 procmail[2315]: Error while writing to "/var/log/procmail.log" Jun 6 10:26:46 v10 procmail[3971]: Error while writing to "/var/log/procmail.log"[/code:1]
ls -al | grep procmail.log [code:1]-rw-r--r-- 1 root adm 0 2009-06-06 06:25 procmail.log . . [/code:1]
/etc/procmailrc [code:1]DROPPRIVS=yes LOGFILE=/var/log/procmail.log TRAP=/etc/webmin/virtual-server/procmail-logger.pl :0wi VIRTUALMIN=|/etc/webmin/virtual-server/lookup-domain.pl $LOGNAME :0 * ?/usr/bin/test "$VIRTUALMIN" != "" { INCLUDERC=/etc/webmin/virtual-server/procmail/$VIRTUALMIN } ORGMAIL=$HOME/Maildir/ DEFAULT=$HOME/Maildir/
:0 $DEFAULT [/code:1]
/etc/postfix/main.cf [code:1] . mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME . [/code:1]
Thank you for help! Kai
Re:Procmail filters don't seem to work
hi Joe, hi Eric, I need some help concerning procmail too. I used your install-script for setting up the system. Following problem: -If an e-mail user logs into his usermin account and sets a forwarding rule (forward to address xxx and deliver to mailbox), the forwarding doesn't work. delivering to the mailbox works. -If the server-owner creates the same rule for the e-mail user in his virtualmin account, forwarding works fine.
There seems to be a problem with procmail because the logfile /var/log/procmail.log is empty, the result from: [code:1]Jun 6 01:36:40 v10 procmail[14579]: Error while writing to "/var/log/procmail.log" Jun 6 09:52:25 v10 procmail[1561]: Error while writing to "/var/log/procmail.log" Jun 6 10:05:18 v10 procmail[2315]: Error while writing to "/var/log/procmail.log" Jun 6 10:26:46 v10 procmail[3971]: Error while writing to "/var/log/procmail.log"[/code:1]
ls -al | grep procmail.log [code:1]-rw-r--r-- 1 root adm 0 2009-06-06 06:25 procmail.log . . [/code:1]
/etc/procmailrc [code:1]DROPPRIVS=yes LOGFILE=/var/log/procmail.log TRAP=/etc/webmin/virtual-server/procmail-logger.pl :0wi VIRTUALMIN=|/etc/webmin/virtual-server/lookup-domain.pl $LOGNAME :0 * ?/usr/bin/test "$VIRTUALMIN" != "" { INCLUDERC=/etc/webmin/virtual-server/procmail/$VIRTUALMIN } ORGMAIL=$HOME/Maildir/ DEFAULT=$HOME/Maildir/
:0 $DEFAULT [/code:1]
/etc/postfix/main.cf [code:1] . mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME . [/code:1]
Thank you for help! Kai
procmail not filtering messages to folders per .procmailrc
Hey,
I just setup a few filters in order to place messages coming from certain people into mailbox folders.
However, despite setting up the filters, the messages are all being sent to the INBOX.
I've checked the "procmail.log" file, and there are no errors.
-- Peter