Spam Filtering and Procmail Problem

Running the free version of Virtualmin 3.66.gpl, installed it around 3.5 I think, using the install.sh file.

Want to turn Spam filtering on, but when I try get this error message:

Failed to save enabled features : The Procmail program needed for spam filtering does not appear to be installed on your system, or has not yet been set up properly in Webmin's Procmail Mail Filter module. If your system does not use spam filtering, it should be disabled in Virtualmin's module configuration page.

After reading various forum threads tried running

yum install procmail-wrapper

That reported that package was already installed.

Also looked for a config file under /etc/procmailrc but didn’t find one.

Have another server running Virtualmin 3.62 not installed via the install.sh method (won’t update automatically, real pain!) that does have Spam filtering working.

I didn’t setup either of these servers, but trying to learn enough to run everything myself.

Any ideas what to do next?

Thanks

David<br><br>Post edited by: DavidLaw, at: 2009/03/30 07:15

Note that procmail-wrapper isn’t actually procmail. It is merely a wrapper for procmail. :wink:

Might want to make sure you actually have procmail installed, as well.

Going to be very descriptive so you can tell me if I made a mistake as I’m still learning and you never know might help someone else with similar problems.

To confirm ran yum install procmail and it’s already installed.

Created the file /etc/procmailrc and tried to enable spam filtering and it got closer to working, on another page got this error:

Warning - any rules defined below will not be used : Procmail is not enabled in your Postfix configuration. The configuration file /etc/postfix/main.cf must have the mailbox_command option set to /usr/bin/procmail.

I made the above change to the config file. New message:

Failed to save enabled features : The procmail command /usr/bin/procmail is owned by group mail, when it should be owned by root. Email may not be properly delivered or checked for spam.

Using chgrp -v root /usr/bin/procmail changed owner to root and get this when enabling spam filtering-

Failed to save enabled features : The procmail command /usr/bin/procmail has 100755 permissions, when it should be setuid and setgid to root. Email may not be properly delivered or checked for spam.

Don’t know how to do that so stopped there.

In Virtualmin I now have a list of Procmail Mail Filter rules that are similar to what I see in my other Virtualmin server, so the file you suggested I create is being read and working, comparing to my other server it lacked this filter, so added it just in case:

Append to file $DEFAULT Always execute action

So looks like something else isn’t setup/working correctly.

Any ideas?

Thanks for the help so far, good to be moving in the right direction.

David Law

It sounds like you’re pretty close – try running this:

chmod 6755 /usr/bin/procmail

And I think that’ll do the trick.
-Eric

After running the command spam filtering would activate :slight_smile:

Not tested that it works for a domain yet, but everything looks good so don’t anticipate problems.

Thanks for the help, appreciated.

David Law

i have a spam problem but may not directly about procmail. i wan to say the problem.

Mail users on my server sent themselves and to Internet spam mails. I searched the postfix main.cf but i can not find where is the problem. SMTP not open Relay.

i attach the my postfix main.cf configuration.

How cani search where the problem begin?

Please say your advice how can i solve the problem. [file name=maincf.txt size=28043]http://www.virtualmin.com/components/com_fireboard/uploaded/files/maincf.txt[/file]

Sometimes when that happens, the problem is related to an older version of a web application.

An unpatched version of an old web application can be used to send spam emails as your describing. For example, I know a version of RoundCube (amongst many other apps) recently allowed that to happen if you didn’t upgrade.

So I’d verify that all the web applications are up to date on your server.
-Eric

Howdy,

Normally, an install using the install.sh would set all that up for you, so that’s kind of odd.

But, a missing procmailrc would certainly cause that error.

Try adding the following to /etc/procmailrc:

[code:1]
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=$HOME/Maildir/
    DEFAULT=$HOME/Maildir/
    DROPPRIVS=yes
    [/code:1]

Does it then allow you to enable Spam filtering?
-Eric

Howdy,

Normally, an install using the install.sh would set all that up for you, so that’s kind of odd.

But, a missing procmailrc would certainly cause that error.

Try adding the following to /etc/procmailrc:

[code:1]
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=$HOME/Maildir/
    DEFAULT=$HOME/Maildir/
    DROPPRIVS=yes
    [/code:1]

Does it then allow you to enable Spam filtering?
-Eric

I finally got around to testing email on the server that I had SPAM filtering problems with and though everything (to me) looks fine, email isn’t working correctly. So what I did above got SPAM filtering to activate, but email doesn’t work, I don’t think doing the above broke email, it was probably not setup correctly in the first place.

Current problems:

If I setup a new domain and enable email everything looks good, but when I send an email to the new email address it doesn’t arrive despite being able to connect to the mail server and collect email.

Under Edit mail/FTP Users, clicking on an email server settings it says email was recieved recently, but it’s not available anywhere I’ve looked under Virtualmin.

If I log into Usermin for the domain I can send email and it shows up in a new sent mailbox (don’t normally use Usermin for anything). Though the email sent via Usemin didn’t arrive.

Checking mx record lookup sites says the mail server is working correctly.

I’ve got two servers running Virtualmin (GPL version 3.703) and I’m planning on moving everything from the other server to this one I’m having email problems with. When I’ve transferred virtual servers via the backup system email has messed up completely!

When I was transfering the domains I was finding quite a lot of emails backed up (webmaster@… that I wasn’t collecting). None of these emails have come through correctly to the new server. The file for each email server under

/var/spool/mail/

I think are meant to be empty, (they are on the other server) but the backed up email has being stored in those files, but not accessible through the Virtualmin user email interface. In a few cases the file transferreed was renamed like

bogus.domain.xyxyx

Trying to access these directly through the mail browser couldn’t read them as mail, (either nothing shown at all, or listed the email incorrectly, one mail server had 1/4 million SPAM emails and they came through as about 50 very large messed up emails on the new server) but downloading them I can read the emails within the files in a text editor.

When I send test emails to the transferred Virtual servers they are arriving at the old server!

For example the domain elvincountry.com used to be on the old server, now on the new one IP ending 133, the server has another IP ending 134 (old server is ending 232, with 3 other IPs 233, 252, 253).

Sent a test email to webmaster@… and it arrived at the old server even though the old server has the mailbox disabled via Virtualmin! Email is also disabled at the new server so no email should arrive at all really.

For adultlingerieuk.com I currently have the Virtual servers active on both servers, (was turned off on the old server for a few days until testing today) with the NS records pointing to the new server. Both Virtual server versions has email turned on.

Email to webmaster@…

Arrives at the old server!

Interestingly the info from http://www.mxtoolbox.com/diagnostic.aspx?HOST=mail.adultlingerieuk.com is regarding the new server Ess000539, just doesn’t make sense.

I haven’t a clue what to try to get things working correctly. On the new server there’s no email accounts that are important, so can loose any email settings, is it possible to unistall the mail part of Virtulmin and reinstall it?

thanks

David Law

Still not figured out what’s wrong with email

When I’m transfering backups from one server to another I get this error afterwards:

Restore failed : Failed to open /home/softwarebin/mail//home/softwarebin/Maildir for writing : No such file or directory

I had mail disabled on the above server, but

/home/softwarebin/mail/ exists on the new server, mail enabled or not.
/home/softwarebin/Maildir didn’t exist, but on servers with mail enabled this directory exists.

From the maillog file:

Sep 20 04:12:40 Ess000539 postfix/cleanup[13172]: fatal: open database /etc/postfix/bcc.db: No such file or directory
Sep 20 04:12:41 Ess000539 postfix/master[2976]: warning: process /usr/libexec/postfix/cleanup pid 13172 exit status 1
Sep 20 04:12:41 Ess000539 postfix/master[2976]: warning: /usr/libexec/postfix/cleanup: bad command startup – throttling

Sep 20 04:33:53 Ess000539 sm-msp-queue[13573]: n8I2ohgc030844: to=general-election-2010@oneofmydomains.com, ctladdr=apache (48/48), delay=2+08:43:10, xdelay=00:00:00, mailer=relay, pri=5074363, relay=[127.0.0.1], dsn=4.0.0, stat=Deferred: Connection timed out with [127.0.0.1]

I have WordPress running on a domain and though I have email enabled I used another email address from a domain on another server, when WordPress gets a comment it should send an email out (I think the aboveis that type of email) so all it has to do is send it to general-election-2010@oneofmydomains.com (a working email address). These emails are not getting sent from this server and assume the error above is related to the problem.

I’m not great with servers, but looks to me like Postfix (or another email relevant program) isn’t installed correctly which is why I couldn’t activate SPAM filtering in the first place. Although I was eventually able to turn SPAM filtering on after following advice above I’ve never got email on this server working.

What I’ve done is leave the domains with important email addresses (only 4 of them) on the older server and moving all the other domains to the new. I plan to turn the old server off end of this month so need to get email working on the new server ASAP.

On the new server I’ve setup a few test email servers for example mail.general-election-2010.co.uk which I can connect to, but I can’t send email via it (the email disapears) and can’t recieve (email never arrives). So when I try to collect email it always says no email available, but does connect.

I’d like to try reinstalling Postfix/Dovecot, what would be the best way to try this?

David Law

Transferred a server just now and got this error on the new server:

Restore failed : Failed to regenerate table /etc/postfix/bcc: postmap: fatal: open /etc/postfix/bcc: No such file or directory

First time I’ve noticed that error, the domain used to have email associated with it.

David Law

Try running these two commands:

touch /etc/postfix/bcc postmap /etc/postfix/bcc

That should resolve the error you’re seeing.

-Eric

Thanks Eric,

I’d already copied two bcc related files from my other Virutalmin server, though did also run the commands above. No idea if it helped since only saw that error once.

Still not got email working on the new server.

When I validate servers on the new server getting weird errors on some of the domains with email installed:

Mail for domain : Home directory /home/morearnings/homes/sales for user sales.morearnings is owned by newage

It should be owned by sales.morearnings since newage is another domain (virtual server) that doesn’t even have email turned on.

Another one:

Mail for domain : Home directory /home/googleadsense/homes/orders for user orders.googleadsense is owned by starforums

The starforums and googleadsense virtualserver were installed earlier today from backups from the old server. The email address orders@ should not be owned by starforums (that server doesn’t have email).

Looks like something has messed up, any ideas where to look to fix this?

After typing the above I solved part of the issue. I can now recieve email from the new server, but can’t send email.

On virtualservers that had email accounts setup on the old server the owner of everything under

/home/googleadsense/homes/orders (all files and sub-directories) had the wrong owner.

After deleting the mailbox (orders.googleadsense) in the example above and creating it again the correct owner (orders.googleadsense) was listed.

Email still didn’t work, so I disabled SPAM and Virus filtering and now email arrives on the server and can be collected.

Haven’t been able to send email yet and guess I have a SPAM/Virus filter config problem as well (which was the first post in this thread).

Any ideas of what to look at next??

David Law

Alright, so can you describe what the current problem you’re seeing is, and show any related errors and warnings from the mail logs – either /var/log/maillog or /var/log/mail.log?

And are you having trouble sending from Usermin, a desktop client, or both?

-Eric

Seems I was wrong about the spam/virus filtering. I turned it off under the main settings, but this didn’t turn it off for domains that already had it activated. Turned spam filtering on again and email is coming through still.

So SPAM/virus filtering is working.

Not sure why it started working. When I transfer a domain accross from my other server, if I’ve setup a specific email adress for that domain I have to delete it and create it again otherwise it doesn’t work at all. This is the case even when the right ownership of the folders related to email are correct.

Also still getting this error when I restore a backup.

Restore failed : Failed to open /home/softwarebin/mail//home/softwarebin/Maildir for writing : No such file or directory

Biggest problem I have now is sending email.

When I try to send email I get the following error in Forte’ Agent:

Server ####### rejected your username and password (5.7.0 Error: authentication failed: generic failure).

The username and password are correct (same as for collecting email and that works).

This occurs with multiple virtualservers on this dedicated server.

Couldn’t find anything related to the emails I tried to send in the maillog.

I can send email via Usermin but not email clients like Forte’ Agent.

David Law

Do you see signs in your mail log that when your desktop email client attempts to send a message, that it’s hitting your server at all?

Take a peek in the mail log, but ignore anything with “dovecot” in it.

Do other messages there suggest that your client is connecting? You should be able to see the IP in there, even if it’s failing to send a message…

When I attempt to send an email I’m getting this from the log files:

Sep 23 23:33:52 Ess000539 postfix/smtpd[2378]: connect from 5acf2670.bb.sky.com[90.207.38.112]
Sep 23 23:33:53 Ess000539 postfix/smtpd[2378]: warning: SASL authentication failure: cannot connect to saslauthd server: No such file or directory
Sep 23 23:33:53 Ess000539 postfix/smtpd[2378]: warning: 5acf2670.bb.sky.com[90.207.38.112]: SASL LOGIN authentication failed: generic failure
Sep 23 23:33:54 Ess000539 postfix/smtpd[2378]: lost connection after AUTH from 5acf2670.bb.sky.com[90.207.38.112]
Sep 23 23:33:54 Ess000539 postfix/smtpd[2378]: disconnect from 5acf2670.bb.sky.com[90.207.38.112]

Thanks

David Law

What distro/version are you on again?

And what is the output of the command “ps auxw | grep saslauthd”.

Thanks!

-Eric

Server is running Centos 5.3, Virtualmin 3.73.gpl, installed using a install.sh file.

Everything is reported as up to date under Virtualmin update.

Is info here http://www.classic-literature.co.uk/test.php any use.

[root@Ess000539 ~]# ps auxw | grep saslauthd
root 8115 0.0 0.0 4776 688 pts/0 S+ 00:58 0:00 grep saslauthd

David Law