Old 11th August 2011, 12:23
rbartz rbartz is offline
Join Date: Apr 2006
Posts: 80
Thanks: 9
Thanked 6 Times in 5 Posts
Default Scan Outgoing Mail

What would be the best way to scan outgoing mail to check if it is spam and block it?

Centos 5.5 Perfect Server, postfix, spamassassin, clamav, ispConfig 2.

The incoming mail is well scanned, and using greylisting, spamassassin, clamav and so on has reduced incoming spam quite well. The problem is that a few times one or another of our email clients have sent spam, and a few times weak PHP programming has allowed spammers to compromise our server by writing PHP files to 777 directories and POSTING to them. In those cases, I think sendmail is handling the mail sending.

What I would like to do is scan the outgoing mail with spamassassin and route emails with high scores to a directory where we can monitor them. I want to stop the emails from being sent.

What would work best? Any ideas?

Reply With Quote
Sponsored Links
Old 11th August 2011, 13:26
till till is offline
Super Moderator
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 37,022
Thanks: 840
Thanked 5,655 Times in 4,464 Posts

Thats possible with ispconfig 3 as ispconfig 3 uses amavisd. In ispconfig 2, spamassassin is invoked by procmail and procmail scripts get only executed when a email arrives in a mailbox, they can not be invoked on outgoing emails.
Till Brehm
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Old 11th August 2011, 14:18
rbartz rbartz is offline
Join Date: Apr 2006
Posts: 80
Thanks: 9
Thanked 6 Times in 5 Posts

Thanks Till... MailScanner might be an option. I think it could be set up to scan ONLY outgoing mail and use the ispconfig spamassassin and clamAV... or perhaps we could turn OFF all the spam and av checking in ispconfig and do both with MailScanner.

[EDIT] --- MailScanner is not really an option as we want to retain all the anti-spam and anti-virus features of ispconfig as they are on the incoming side. [/EDIT]

Anyone else got ideas?


Last edited by rbartz; 12th August 2011 at 12:02.
Reply With Quote
Old 12th August 2011, 12:51
rbartz rbartz is offline
Join Date: Apr 2006
Posts: 80
Thanks: 9
Thanked 6 Times in 5 Posts
Default Using amavisd...?

Just looking over amavisd thinking maybe it might work as follows without messing up the standard ispConfig2 installation......? It seems it would at least work for the mail sent by forms and programs on the web server.

Install amavisd as usual to work with ports 10024 and 10025, but configure amavisd to use the installatons of spamassassin and optionally clamAV in ispConfig.

Do not use the ordinary way of routing all mail through amavisd but just use header checks in postfix to redirect mails with ^/ apache@localhost/ in the headers to port 10024.

Check the redirected mail with amavisd and delete virus mails, quarantine spam with score over 5 (or?), and deliver the good mail back through 10025.

There would probably be some redundant checks of mail from outside with apache in the header, but that is probably not a big issue?

Any ideas, experts?
Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix Timeout after DATA from some emails treeman Server Operation 13 25th September 2013 13:51
Cannot send or receive mail after setup 50CentOS HOWTO-Related Questions 3 11th June 2010 16:10
procmail can't write Hellbound General 27 8th June 2009 22:51
just the last step...and it works. Postfix...need help config. ubuntusr Installation/Configuration 1 5th January 2009 10:50
Core 4: Error Messages on Fresh Install re CTX/SSL jjw Installation/Configuration 30 6th September 2006 13:16

All times are GMT +2. The time now is 04:41.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.