Welcome, Guest
Please Login or Register.
Lost Password?
mail forwarding and replies not working (1 viewing)
Post Reply

TOPIC: mail forwarding and replies not working

#6326
gregc@netoverdrive.com.au (User)
Posts: 21
graphgraph
Re:mail forwarding and replies not working 2007/07/26 00:35  
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
  The administrator has disabled public write access.
#6328
JamieCameron (Admin)
Posts: 362
graphgraph
Re:mail forwarding and replies not working 2007/07/26 01:24  
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.
  The administrator has disabled public write access.
#6329
gregc@netoverdrive.com.au (User)
Posts: 21
graphgraph
Re:mail forwarding and replies not working 2007/07/26 01:47  
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?
  The administrator has disabled public write access.
#6330
JamieCameron (Admin)
Posts: 362
graphgraph
Re:mail forwarding and replies not working 2007/07/26 02:21  
That script is important, and actually should be created when you enabled spam for a domain in Virtualmin. It is a wrapper around the one in /usr/share , so you can't just copy it across..

You should instead replace it with :

#!/usr/bin/perl
open(CONF, "/etc/webmin/miniserv.conf");
while(<CONF>) {
$root = $1 if (/^root=(.*)/);
}
close(CONF);
$ENV{'WEBMIN_CONFIG'} = "/etc/webmin";
$ENV{'WEBMIN_VAR'} = "/var/webmin";
chdir("$root/virtual-server");
exec("$root/virtual-server/lookup-domain.pl", @ARGV);

and then run :

chmod +x /etc/webmin/virtual-server/lookup-domain.pl
  The administrator has disabled public write access.
#6331
gregc@netoverdrive.com.au (User)
Posts: 21
graphgraph
Re:mail forwarding and replies not working 2007/07/26 03:46  
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.
  The administrator has disabled public write access.
#6333
JamieCameron (Admin)
Posts: 362
graphgraph
Re:mail forwarding and replies not working 2007/07/26 05:15  
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 ?
  The administrator has disabled public write access.
#6357
ChrisYuzik (User)
Posts: 22
graphgraph
Re:mail forwarding and replies not working 2007/07/27 16:20  
Jamie,

Thank you for your help. I've now got automatic replies working using the "Filter Mail" module in Usermin. This does the job, however it's missing a lot of the features of the standard vacation program that can be called by sendmail. Of particular note is that vacation will not keep autoreplying to the same sender, apparently has some intelligence about not replying to mailing lists, and has a number of variables that can be included in messages. Given the choice, I'd rather use the vacation module if possible.

According to an associate of mine, the .forward file would likely work on the server if I had not chosen the "username@domain.tld" format for my user accounts. Preliminary tests indicate he's right--I've got a test domain setup for mucking around with, and I changed the format of the mailboxes to username.domain, edited the .forward file so it looks like this:

christest.domain.tld
"|/usr/bin/vacation christest.domain.tld"

And then sent an email to that account. I got a bounce back that contained the following:

----- The following addresses had permanent fatal errors -----
"|/usr/bin/vacation christest.domain.tld"
(expanded from: <christest@domain.tld>)

----- Transcript of session follows -----
550 5.7.1 /home/domain.tld/homes/christest/.forward: line 2: "|/usr/bin/vacation christest.domain.tld"... User christest.domain.tld@mail.ourserveraddress.com doesn't have a valid shell for mailing to programs

The shell for the user is '/dev/null', the default, which is obviously not valid. For testing purposes, I have changed the test user's shell to /bin/false and got the following entry in /var/log/maillog:

Jul 27 07:07:23 devel sendmail[852]: l6RE7Jgp000852: from=<itdept@ourserveraddress.com>, size=349, class=0, nrcpts=1, msgid=<46A9FC07.4040906@ourserveraddress.com>, proto=ESMTP, daemon=MSA, relay=S010623748432.vs.shawcable.net [70.71.32.10]
Jul 27 07:07:24 devel sendmail[871]: l6RE7Jgp000852: to=christest.domain.tld, delay=00:00:01, xdelay=00:00:00, mailer=local, pri=120349, dsn=2.0.0, stat=Sent
Jul 27 07:07:24 devel sendmail[871]: l6RE7Jgp000852: to="|/usr/bin/vacation christest.domain.tld", ctladdr=<christest@domain.tld> (2041/501), delay=00:00:01, xdelay=00:00:00, mailer=prog, pri=120349, dsn=2.0.0, stat=Sent

Almost working, but no autoreply was actually sent. We're close, very close, but something just isn't quite right. Not sure what.

Another issue comes up if I give the users a valid shell: they can now FTP to their home dirs, which is something I'd rather they not be able to do.

Do you know of any workaround to this problem with .forward files not being read by sendmail if the user's account is in the format "username@domain.tld"?

Thanks,
Chris
  The administrator has disabled public write access.
#6358
JamieCameron (Admin)
Posts: 362
graphgraph
Re:mail forwarding and replies not working 2007/07/27 18:05  
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.
  The administrator has disabled public write access.
#6359
ChrisYuzik (User)
Posts: 22
graphgraph
Re:mail forwarding and replies not working 2007/07/27 18:18  
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. :-)

Cheers,
Chris
  The administrator has disabled public write access.
#6360
JamieCameron (Admin)
Posts: 362
graphgraph
Re:mail forwarding and replies not working 2007/07/27 18:28  
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..
  The administrator has disabled public write access.
Post Reply
get the latest posts directly to your desktop

Talk and Get Help

Support
Forums
Bugs and Issues

Get Virtualmin

OS Support
Buy Online
Download
Copyright 2005-2007 Virtualmin, Inc. All rights reserved.