Forward email not working

I now get errors sending mail to the server again,

This is the mail system at host madshaun1984.dyndns.org.

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

ps3@madshaun1984.dyndns.org (expanded from webmaster@ps3fanatics.co.uk):
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

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 :slight_smile:

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 :slight_smile:

-Eric

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)

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: test@testemail.com Thu Apr 22 16:45:04 2010
Subject: test
Folder: /home/ps3/Maildir/new/1271951122.1575_0.madshaun1984.dyndns. 2685
Time:1271951122 From:test@testemail.com To:webmaster@ps3fanatics.co.uk User:ps3 Size:2741 Dest:/home/ps3/Maildir/new/1271951122.1575_0.madshaun1984.dyndns.org Mode:None
From ps3@madshaun1984.dyndns.org Thu Apr 22 16:45:15 2010
Subject: Cron ps3@madshaun1984 /usr/bin/php /home/ps3/public_html/cronrss.ph
Folder: /home/ps3/Maildir/.spam/new/1271951125.1650_0.madshaun1984.d 2644
Time:1271951125 From:root@madshaun1984.dyndns.org To:ps3@madshaun1984.dyndns.org User:ps3 Size:2703 Dest:/home/ps3/Maildir/.spam/new/1271951125.1650_0.madshaun1984.dyndns.org 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 http://www.clamav.net/support/faq ***
LibClamAV Warning: ***********************************************************
procmail: Suspicious rcfile “/home/ps3/.procmailrc”
procmail: Couldn’t read “/home/ps3/.procmailrc”
From test@testemail.com Thu Apr 22 16:53:23 2010
Subject: testing server setup
Folder: /home/ps3/Maildir/new/1271951612.2096_0.madshaun1984.dyndns. 2713
Time:1271951613 From:test@testemail.com To:webmaster@ps3fanatics.co.uk User:ps3 Size:2762 Dest:/home/ps3/Maildir/new/1271951612.2096_0.madshaun1984.dyndns.org Mode:None

the mail_command is

shaun@madshaun1984:~$ grep mailbox_command /etc/postfix/main.cf
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)

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)

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
! test@testemail.com

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/procmail-logger.pl
:0wi
VIRTUALMIN=|/etc/webmin/virtual-server/lookup-domain.pl $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)

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

-Eric

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 webmaster@testdomain.com 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.

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.

-Eric

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 :smiley:

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,

MadS:D

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…