mail forwarding and replies not working

First, great job on the new virtualmin website. Simply excellent.

I’m trying to get the 'Mail Forwarding and Replies" usermin module to do what it’s supposed to. I’ve got it installed and (allegedly) configured correctly but obviously, not quite.

When I make changes to the form, the module does update the .forward file in /home/domain.tld/homes/testuser and does create a file called "autoreply.txt".

Unfortunately, the system seems to ignore what’s in the .forward and autoreply.txt files altogether. As far as I can tell, there are no log entries made that might even give a clue as to what’s happening.

How can I troubleshoot this?

Hi,

I have the same problem and would like help also. Nice to know i’m not the only one.<br><br>Post edited by: gregc@netoverdrive.com.au, at: 2007/07/25 14:25

Do you have your user accounts in the format of "user@domain.tld"?

Hi,

I wanted to use the username@domain.tld format but I also tried the domain-username format and it didn’t work either.

maybe because i initially set it up to use the ‘@’ whatever’s broken remains broken.

I had wanted some feedback on this before I reinstall virtualmin (again) to find out.

What syntax are you using?

Greg

Hey Greg,

Don’t reinstall Virtualmin! This is minor, and probably a bug (which would also exist after a reinstall).

I’ll ask Jamie to drop in on this thread. I’m guessing we’ll need to have a look at the procmail configuration and logs to know what’s happening. It should work whether you have @ in the username or not (though there have been bugs in the past with forwarding and @ in usernames…but those have long since been fixed…so this one is something new).

Hi Greg,
Have you tried using the Filter Mail module in Usermin instead? It has taken the place of the Mail Forwarding module, which is actually disabled by default in recent Virtualmin releases.

The biggest difference between them is that Filter Mail configures the user’s .procmailrc file, while Mail Forwarding sets up .forward. However, some mail servers do not even check .forward at all, so anything setup there may be ignored.

I am using the ‘setup mail filter’ option

i’ve included the rule i configured.

postfix logs are
Jul 25 22:22:07 localhost postfix/qmgr[31479]: DC661BEE94: from=<gregc@netoverdrive.com.au>, size=386, nrcpt=1 (queue active)
Jul 25 22:22:07 localhost postfix/local[24363]: DC661BEE94: to=<fred-freshtel.com@localhost.localdomain>, orig_to=<fred@freshtel.com>, relay=local, delay=13, delays=13/0/0/0.07, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME)
Jul 25 22:22:07 localhost postfix/qmgr[31479]: DC661BEE94: removed

/etc/usermin/forward/autoreply.pl doesn’t exist…

I copied it over from /usr/share/usermin/forward but still not working.

Could you post the contents of the /etc/procmailrc and ~fred-freshtel.com/.procmailrc files to this bug report?

Also /etc/webmin/virtual-server/lookup-domain.pl doesn’t exist. If i also copy this from /usr/share

/var/log/procmail.log

Undefined subroutine &main::get_user_domain called at /etc/webmin/virtual-server/lookup-domain.pl line 98.
procmail: Program failure (2) of "/etc/webmin/virtual-server/lookup-domain.pl"
From gregc@netovedrive.com.au Thu Jul 26 08:23:51 2007
Folder: /home/freshtel/homes/fred/Maildir/new/1185402231.18035_0.man 514
Time:1185402231 From:gregc@netovedrive.com.au To: User:fred.freshtel Size:571 Dest:/home/freshtel/homes/fred/Maildir/new/1185402231.18035_0.managed.netoverdrive.com.au Mode:None

Ok, I see the problem now - at the end of /etc/procmailrc are the lines :

:0
$DEFAULT

These tell procmail to always deliver to users’ mailboxes, and never run their .procmailrc files. To change this in Virtualmin, click on the Module Config link on the left meny, go to the ‘Spam filtering options’ section and change ‘Allow mailbox users to configure procmail?’ back to ‘Yes’ (the default). Then click Save, and then the button to re-check the Virtualmin configuration.

Some admins may prefer that this be set to ‘No’, in order to prevent mailbox users from running commands via their .procmailrc files. Unfortunately, this will prevent user-configurable mail filtering from working.

In the next Usermin release, I will add a warning message in the Filter Mail module to detect this situation.

Fixed.

"Ok, I see the problem now - at the end of /etc/procmailrc are the lines :

:0
$DEFAULT

These tell procmail to always deliver to users’ mailboxes, and never run their .procmailrc files. To change this in Virtualmin, click on the Module Config link on the left meny, go to the ‘Spam filtering options’ section and change ‘Allow mailbox users to configure procmail?’ back to ‘Yes’ (the default). Then click Save, and then the button to re-check the Virtualmin configuration."

this worked… thanks for your help.

I just have a general question on what is and isn’t installed. ie procmailrc refers to a script called /etc/webmin/virtual-server/lookup-domain.pl which doesn’t exist.

if i copy this from /usr/share i get an error.
Undefined subroutine &main::get_user_domain called at /etc/webmin/virtual-server/lookup-domain.pl line 98.
procmail: Program failure (2) of "/etc/webmin/virtual-server/lookup-domain.pl"

anything to worry about?

OK i’ve done that and I’m not getting errors. thanks

In virtualmin ‘Module config’ i have ‘per server spamassassin mail filtering’ enabled.
In the test virtual server ‘enabled features’ the ‘spam filtering enabled’ is checked.

Does this mean it should have been setup right but not or is there another configuration step i missed?

Please let me know if I should move this post back to virtualmin newbie forum.

Yes, it should have been created when you enabled spam filtering for the first time. Did you perhaps move domains to a different system, or delete files in /etc/webmin/virtual-server ?

Hi Chris,

The autoresponder in Usermin does have a feature to limit the rate of replies to the same sender - it is the ‘Minimum interval between replies’ field. Also, you can use variables in the response message, like $FROM, $TO, $SUBJECT and $BODY.

I’m not sure why Sendmail wouldn’t do .forward processing for users with user@domain format names though … but these have always been a little tricky to support, as Sendmail confuses them with email addresses.

If you want Sendmail to allow any shell, the solution is to add the line :

/SENDMAIL/ANY/SHELL/

to the /etc/shells file.

Jamie,

Thanks for your quick response.

The autoresponder in Usermin does have a feature to limit the rate of replies to the same sender - it is the 'Minimum interval between replies' field. Also, you can use variables in the response message, like $FROM, $TO, $SUBJECT and $BODY.

I wasn’t aware of this. Do you know if the usermin autoresponder has any smarts that prevent it from autoreplying to mailing lists, etc.?

I'm not sure why Sendmail wouldn't do .forward processing for users with user@domain format names though .. but these have always been a little tricky to support, as Sendmail confuses them with email addresses.

Right. That seems to be precisely what’s happening. It’s like sendmail hits the “@” in the address and immediately stops processing .forward files. I had hoped there was a directive I could add to the sendmail.cf file to change this behaviour, and while there might be, I haven’t been able to track this down; this is perhaps more difficult to find because google and similar don’t allow searching for the “@” character.

If you want Sendmail to allow any shell, the solution is to add the line :

/SENDMAIL/ANY/SHELL/

to the /etc/shells file.

Jamie, you continue to be a font of knowledge. I haven’t found that bit of information anywhere either. Thanks. Now if we can just get Sendmail to process the .forward files when the account has a ‘@’ in it, we’d make some people happy. :slight_smile:

Cheers,
Chris

I wasn't aware of this. Do you know if the usermin autoresponder has any smarts that prevent it from autoreplying to mailing lists, etc.?

It can detect replies to bounces, but not to lists … unless you know of some email header that can identify a message from a list reliably? Perhaps List-Id: ?

Right. That seems to be precisely what's happening. It's like sendmail hits the "@" in the address and immediately stops processing .forward files. I had hoped there was a directive I could add to the sendmail.cf file to change this behaviour, and while there might be, I haven't been able to track this down; this is perhaps more difficult to find because google and similar don't allow searching for the "@" character.

Yeah, it’s issues like this that lead to me recommending againsts the use of @ in mailbox usernames…

Yeah, it's issues like this that lead to me recommending againsts the use of @ in mailbox usernames..

We’ve even got a FAQ about it, though it’s mostly specific to Postfix. The problem is a general one, but Postfix chooses to confront it head-on while Sendmail ignores it until you run into weird stuff like this. :wink:

I have similar problems with e-mail not working.
This is part of my procmail log with the problem:

From root@vm200.webfauna.nl Mon Jul 30 21:49:18 2007
Subject: test
Folder: /dev/null 471
/bin/sh: /etc/webmin/virtual-server/procmail-logger.pl: Permission denied
/bin/sh: /etc/webmin/virtual-server/clam-wrapper.pl: Permission denied
procmail: Error while writing to "/etc/webmin/virtual-server/clam-wrapper.pl"
procmail: Program failure (126) of "/etc/webmin/virtual-server/clam-wrapper.pl"

But wat is the fix?

It sounds like the permissions on those files or perhaps directories are incorrect on your system, which is odd as Virtualmin sets them correctly when installing or upgrading.

The fix is to run :

chmod 755 /etc/webmin/virtual-server/*.pl
chmod 755 /etc/webmin/virtual-server
chmod 755 /etc/webmin