lookup-domain.pl not running

I noticed that my local procmail scripts weren't running, and tracked the problem down to this:

The first lookup-domain.pl in turn tries to run a second copy of lookup-domain.pl which should be at /usr/libexec/webmin/virtual-server/lookup-domain.pl, but it seems not to be picking up the root= line in the /etc/webmin/miniserv.conf.

Here's the pertinent error in procmail.log:

Failed to run /virtual-server/lookup-domain.pl : No such file or directory at /etc/webmin/virtual-server/lookup-domain.pl line 17. procmail: Program failure (2) of "/etc/webmin/virtual-server/lookup-domain.pl"

-rw------- 1 root bin 1899 Sep 7 22:59 miniserv.conf

The miniserv.conf file includes:

root=/usr/libexec/webmin

Thanks!

Status: 
Active

Comments

I should add that running the actual lookup-domain.pl as root works fine. We're just not getting there.

Looks like procmail might not be running as root. What are the permissions on /usr/bin/procmail-wrapper , as shown by ls -l ?

-rwsr-sr-x 1 root root 10200 May 10 2007 procmail-wrapper

Ok, that looks fine .. and is it referenced in /etc/postfix/main.cf , in the mailbox_command line?

Also, does this error happen for all email to a user? I have seen a procmail bug in which the first mail to a user doesn't run procmail as root, but later messages do.

I'm running sendmail.

AFAICT, the domain's procmail script is not executed at all, first time or otherwise. To get the spam filtering working at all, I had to play around until I found something that implements a site-wide procmail script which calls spamassassin.

I'm still learning what virtualmin/webmin does on the back-end so I can help myself more. In the meantime, thanks for your excellent and responsive help. I just purchased an upgrade as to the number of domains and plan to bring up an additional server in the near term as I transition my clients to virtualmin servers.

Ok, if procmail isn't being called by Sendmail as Virtualmin expects, that would cause problems.

In my test system with Sendmail and Virtualmin, I have the following in sendmail.mc :

define(\`PROCMAIL_MAILER_PATH', \`/usr/bin/procmail')dnl

and

FEATURE(\`local_procmail',\`',\`procmail -t -Y -a $h -d $u')

This runs /usr/bin/procmail as root for local delivery ..

Both of those lines are in my sendmail.mc, along with,

MAILER(procmail)dnl

at the bottom. Apparenty /etc/procmailrc is being executed. As I mentioned previosuly, I played around and found another place (can't tell you where!) where there was a global option to control moving spam into a spam folder on the server. In the process of messing with this, evidently the recipe to test for the X-Spam-Status: Yes got put in twice:

DROPPRIVS=yes :0fw | /usr/bin/spamc :0 * ^X-Spam-Status: Yes $HOME/mail/spam 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=/var/spool/mail/$LOGNAME DEFAULT=/var/spool/mail/$LOGNAME DROPPRIVS=yes :0 $DEFAULT :0 * ^X-Spam-Status: Yes $HOME/mail/spam

I've removed the following from the top of /etc/procmailrc:

DROPPRIVS=yes :0fw | /usr/bin/spamc :0 * ^X-Spam-Status: Yes $HOME/mail/spam

and I no longer see the error in /var/log/procmail.log... however, I'm not sure the domain's procmail is being run, since I'm not seeing any clamav headers in messages.

Here is the relevant domain procmail file:

/etc/webmin/virtual-server/procmail/12057247944943

DROPPRIVS=yes :0cw | /etc/webmin/virtual-server/clam-wrapper.pl /usr/bin/clamdscan VIRUSMODE=1 :0e /dev/null VIRUSMODE=0 :0fw | /usr/bin/spamc SPAMMODE=1 :0 * ^X-Spam-Status: Yes $HOME/Maildir/.spam/ SPAMMODE=0

I'm pretty adept at setting all of these things by hand, and I'm still trying to wrap my head around all of the permutations of setting this up via virtualmin. Thanks for your continued assistance.

So the proper /etc/procmailrc should look like :

LOGFILE=/var/log/procmail.log
TRAP=/etc/webmin/virtual-server/procmail-logger.pl
VERBOSE=yes
LOG=\`id -a\`
:0wi
VIRTUALMIN=|/etc/webmin/virtual-server/lookup-domain.pl $LOGNAME
:0
* ?/usr/bin/test "$VIRTUALMIN" != ""
{
INCLUDERC=/etc/webmin/virtual-server/procmail/$VIRTUALMIN
}
ORGMAIL=/var/spool/mail/$LOGNAME
DEFAULT=/var/spool/mail/$LOGNAME
DROPPRIVS=yes

There's no need for any calls to spamassassin here, as they go into the per-domain files under /etc/webmin/virtual-server/procmail

I have the same problem, but I use postfix.

-rw------- 1 root bin 1660 oct 16 12:06 /etc/webmin/miniserv.conf

-rwsr-sr-x 1 root root 10200 may 10 2007 /usr/bin/procmail-wrapper

I've fixed with:

chmod +r /etc/webmin/miniserv.conf

But I don't know if it's the best solution.

Dear rgripoll:

Would you please post the long list format of miniserv.conf? Since you state that chmod +r command to modify permission of miniserv.conf, I did not understand what's the difference of permission after modified?

Did you mean chmod g+r or something else?