Forward email not working

31 posts / 0 new
Last post
#1 Thu, 07/02/2009 - 07:00

Forward email not working

When I set forwarding email in usermin, no email is forwarded and in procmail.log I get:

Insecure dependency in exec while running with -T switch at /etc/webmin/virtual-server/ line 17. procmail: Program failure (255) of "/etc/webmin/virtual-server/"

Can me someone help with this error?

Thu, 07/02/2009 - 09:39

Hmm, what operating system / version are you running Virtualmin on?

And how did you go about installing it -- did you by chance use the

Lastly, what does this command show:

grep mailbox_command /etc/postfix/



Fri, 07/03/2009 - 05:54 (Reply to #2)

It is running on Debian Lenny ... I used to install virtualmin.

output from grep is: mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME

Fri, 07/03/2009 - 10:07 (Reply to #3)

What are the permissions on /usr/bin/procmail-wrapper ? They should be 6755, and it should be owned by root. You can check with the commands :

lentor.home:~ > ls -l /usr/bin/procmail-wrapper
-rwsr-xr-x 1 root root 2916 2006-11-28 01:08 /usr/bin/procmail-wrapper


Fri, 07/03/2009 - 10:39 (Reply to #4)

Yes. I have these permissions: -rwsr-sr-x 1 root root 4536 2006-12-14 05:00 /usr/bin/procmail-wrapper

But if I chmoded it to right permissions, there was no change: -rwsr-sr-x 1 root root 4536 2006-12-14 05:00 /usr/bin/procmail-wrapper

Fri, 07/03/2009 - 11:50 (Reply to #5)

What are the contents of the /etc/webmin/virtual-server/ file on your system?


Mon, 07/06/2009 - 02:11 (Reply to #6)

there is:

$ENV{'PATH'} = '/bin:/usr/bin';
$< = $>;
$( = $);
open(CONF, "/etc/webmin/miniserv.conf");
while(<CONF>) {
        $root = $1 if (/^root=(.*)/);
$ENV{'WEBMIN_CONFIG'} = "/etc/webmin";
$ENV{'WEBMIN_VAR'} = "/var/webmin";
exec("$root/virtual-server/", @ARGV) || die "Failed to run $root/virtual-server/ : $!";
Thu, 11/26/2009 - 05:17

Are there any news about this topic? I have the same problem. OS is lenny too. Delivery of the messages to the inboxes works, but the forwarding feature doesn't.

Thu, 11/26/2009 - 11:16 (Reply to #8)

remove the following from /etc/procmailrc :


now it works again.

Thu, 11/26/2009 - 13:33 (Reply to #9)

You can also do the same thing in Virtualmin at Email Settings -> Spam and Virus Filtering -> Allow mailbox users to create mail filters? (set it to Yes).


Fri, 11/27/2009 - 03:24 (Reply to #10)

Ok, that works too;-)
Thank you for the help!

Thu, 04/22/2010 - 09:13

Hi I nstalled using the and everything went fine, I had a few issues with mail from the off though,

I have all the rest of the bugs worked out, and can now send and recieve mail no problems, but forwarding just doesnt want to know.

heres what I see when an email hits my server (it ends up in my inbox fine but isnt forwarded)

From /var/log/procmail.log

Time:1271944813 User:ps3 Size:772 Dest:/home/ps3/Maildir/new/ Mode:None Insecure dependency in exec while running with -T switch at /etc/webmin/virtual-server/ line 18. procmail: Program failure (255) of "/etc/webmin/virtual-server/" procmail: Skipped "* ?/usr/bin/test "$VIRTUALMIN" != """ procmail: Couldn't read "/etc/webmin/virtual-server/procmail/" procmail: Suspicious rcfile "/home/ps3/.procmailrc" procmail: Couldn't read "/home/ps3/.procmailrc" From Thu Apr 22 15:07:15 2010 Subject: test Folder: /home/ps3/Maildir/new/1271945235.28982_0.madshaun1984.dyndns 2438 Time:1271945235 User:ps3 Size:2494 Dest:/home/ps3/Maildir/new/ Mode:None

Any help woul dbe appreciated :)

Thu, 04/22/2010 - 09:13


Procmail is saying there's something funny about the .procmail rc file located in "/home/ps3/.procmailrc".

If you take a look at that file, do you see anything odd about it?

What user/group owns it? Is that the same user/group who owns the directory it resides in?


Thu, 04/22/2010 - 09:28

.procmailrc just contains



its owned by the user for that domain, and is in the right place, I have also checked the Allow mailbox users to create mail filters? to yes, and rechecked the virtualmin config, still getting the same problem though.

Edit its permissions are 6644 for user/group ps3/ps3 is that correct?

Thu, 04/22/2010 - 09:31

Those are pretty strange permissions... I'd make it at most 0644.


Thu, 04/22/2010 - 09:33

yeah thats what it was before, I set it to 6644 to see if that would make a difference, no change though :(

Thu, 04/22/2010 - 10:14

update , here is the contents on my /etc/procmailrc

LOGFILE=/var/log/procmail.log TRAP=/etc/webmin/virtual-server/ :0wi VIRTUALMIN=|/etc/webmin/virtual-server/ $LOGNAME * ?/usr/bin/test "$VIRTUALMIN" != "" :0 { INCLUDERC=/etc/webmin/virtual-server/procmail/$VIRTUALMIN } DEFAULT=$HOME/Maildir/ ORGMAIL=$HOME/Maildir/ DROPPRIVS=yes

removing the :0 doesnt help, other than there being something wrong in this file I cant pin it down to anything else. but I cant see what it could be in here (sorry bit of a linux n00b here)

edit:-- just incase it helps grep mailbox_command /etc/postfix/ returns

mailbox_command = /usr/bin/procmail -Y -a $DOMAIN

^ I had a big problem with procmail-wrapper and no matter how I tried to fix it email to/from my server wouldnt work, I do have mail being received (but not forwarded) and sent from the server woking fine now though.

Just forwarding thats giving me grief else virtualmin would be the perfect setup for what I need :D

♥ virtualmin btw :D

Thu, 04/22/2010 - 10:21

What distribution and version are you using?

That's not the correct mailbox command, I'm curious as to what may have gone awry there...


Thu, 04/22/2010 - 10:29

shaun@madshaun1984:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 8.04.4 LTS Release: 8.04 Codename: hardy

thanks for your help by the way, its completely got me stumped >.<

Thu, 04/22/2010 - 10:32

Try setting the mailbox_command to this:

mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME

And then restart Postfix.


Thu, 04/22/2010 - 10:35

I now get errors sending mail to the server again,

This is the mail system at host

I'm sorry to have to inform you that your message could not be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can delete your own text from the attached returned message.

               The mail system (expanded from Command died with status 127: "mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME". Command output: sh: mailbox_command: not found

^ These errors did my head in previously lol

Thu, 04/22/2010 - 10:37

It sounds like something went awry with the installer... normally, I'd suggest that it sounds like you're not using a supported distro, but you showed that you were using 8.04... which should work just fine :-)

What happens if you manually install the procmail-wrapper program:

apt-get install procmail-wrapper

That should get that installed for you, and email should start working at that point :-)


Thu, 04/22/2010 - 10:49

I've had procmail-wrapper installed since the beginning, its just it doesnt seem to want to work, I just resent another test email though, with the changes made for the mail_command to use procmail-wrapper, and the log didnt show an error, but at the same time the forwarded mail ahsnt appeared in my inbox (procmail.log didnt actually show anything was forwarded though)

Thu, 04/22/2010 - 11:13

Update, ok I really dont know whats going on now, procmail-wrpaper is now working for sending and receiving mail from and to the server, forwarding is still not happening,

I now have this in my procmail.log

From: Thu Apr 22 16:45:04 2010 Subject: test Folder: /home/ps3/Maildir/new/1271951122.1575_0.madshaun1984.dyndns. 2685 Time:1271951122 User:ps3 Size:2741 Dest:/home/ps3/Maildir/new/ Mode:None From Thu Apr 22 16:45:15 2010 Subject: Cron <ps3@madshaun1984> /usr/bin/php /home/ps3/public_html/ Folder: /home/ps3/Maildir/.spam/new/1271951125.1650_0.madshaun1984.d 2644 Time:1271951125 User:ps3 Size:2703 Dest:/home/ps3/Maildir/.spam/new/ Mode:Spam procmail: Skipped "* ?/usr/bin/test "$VIRTUALMIN" != """ LibClamAV Warning: *********************************************************** LibClamAV Warning: *** This version of the ClamAV engine is outdated. *** LibClamAV Warning: *** DON'T PANIC! Read *** LibClamAV Warning: *********************************************************** procmail: Suspicious rcfile "/home/ps3/.procmailrc" procmail: Couldn't read "/home/ps3/.procmailrc" From Thu Apr 22 16:53:23 2010 Subject: testing server setup Folder: /home/ps3/Maildir/new/1271951612.2096_0.madshaun1984.dyndns. 2713 Time:1271951613 User:ps3 Size:2762 Dest:/home/ps3/Maildir/new/ Mode:None

the mail_command is

shaun@madshaun1984:~$ grep mailbox_command /etc/postfix/ mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME

procmail-wrapper permissions are

shaun@madshaun1984:~$ ls -l /usr/bin/procmail-wrapper -rwsr-sr-x 1 root root 2916 2006-11-28 09:08 /usr/bin/procmail-wrapper

/home/ps3/.procmailrc permissions are

shaun@madshaun1984:~$ ls -l /home/ps3/.procmailrc -rw-r--r-- 1 ps3 ps3 33 2010-04-22 16:03 /home/ps3/.procmailrc

any idea's?

(Thanks again)

Thu, 04/22/2010 - 11:51

procmail: Skipped "* ?/usr/bin/test "$VIRTUALMIN" != """ procmail: Suspicious rcfile "/home/ps3/.procmailrc" procmail: Couldn't read "/home/ps3/.procmailrc"

^ that seems to be the cause of the mail not being forwarded, and Idea what I need to change/edit to fix it?

I say its that, as its appearing in the /var/log/procmail.log for every email that is supposed to be forwarded, but not for emails that are for other accounts that arent set to be forwarded. (if that makes sense)

Thu, 04/22/2010 - 12:33

another update

/var/log/mail.err is full of lines saying

Apr 22 18:01:41 madshaun1984 procmail[5472]: Suspicious rcfile "/home/ps3/.procmailrc"

/home/ps3/.procmailrc says

:0c !

permissions for .procmailrc are

shaun@madshaun1984:~$ ls -l /home/ps3/.procmailrc -rw-r--r-- 1 ps3 ps3 31 2010-04-22 18:00 /home/ps3/.procmailrc

/etc/procmail says

LOGFILE=/var/log/procmail.log TRAP=/etc/webmin/virtual-server/ :0wi VIRTUALMIN=|/etc/webmin/virtual-server/ $LOGNAME * ?/usr/bin/test "$VIRTUALMIN" != "" :0 { INCLUDERC=/etc/webmin/virtual-server/procmail/$VIRTUALMIN } DEFAULT=$HOME/Maildir/ ORGMAIL=$HOME/Maildir/ DROPPRIVS=yes

I cant see anything wrong with the setup at all now, yet forwarding still isnt working, (the email addy in the lines above was changed just to protect my inbox from spam, but in the file it is an actual email addy)

Thu, 04/22/2010 - 13:05

What are the permissions on /usr/bin/procmail and /usr/bin/procmail-wrapper?


Thu, 04/22/2010 - 13:10

Sorry, this will be my last update to this problem, I have email forwarding working on other domains,

all I did for those domains was set the email forward up, and then sent a mail to it was delivered to my server and to the forward address succesfully.

I then tried to send another test email to the original domain on my server, but it still fails with the .procmailrc cant be read,

Any idea how I can manually reset the domains email so that I can add the forwarder again. without losing any info stored in that domains files?

Eit:- I mean give it a completely clean .procmailrc as deleting the old (corrupted one) and resetting up the email forward doesnt solve the issue.

Thu, 04/22/2010 - 13:11

You could always try deleting the .procmailrc file it says it doesn't like -- perhaps when you recreate the forwarding, it'll correct the problem it has with it.


Thu, 04/22/2010 - 14:20

Yep tried that, unfortunatly it seems to be holding some info on the file, so when a new file is created it gets corrupted again.

Oh and thanks for your help with this again, at least I now (thanks to your help) have procmail-wrapper set up and working :D

Edit:- another 1:30 spent on this, I have deleted all files that are created when adding a forwarding address, and then rechecked virtualmin config, stopped and started postfix, and then reset up the forwarding email address, yet I still get the error, luckily it wasnt to big a problem for that domain, and forwarding is working perfectly from the domain I needed it to, so alls god in the end.

It would seem that there is a bug in there somewhere that wont allow you to delete the .procmailrc file without the server holding data and then corrupting the new settings when re adding a forwarding address.

Thanks for all the help though,


Fri, 11/19/2010 - 05:21

As careful reading of the"Suspicious rcfile" error message note in the DIAGNOSTICS section of the man-page, the directory which contains the .procmailrc file cannot be either group or other writable. Presumably this is to prevent someone other than the user from changing the .procmailrc file and redirecting the mail.

It was the "not group writable" problem that tripped me up as I think at some point in time procmail may have worked with $HOME being group writable.

Of course it would be nicer if the procmail error made it clear which procmailrc permissions constraint was being violated rather than leaving it up to the user to figure it out...

Topic locked