LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Thread Tools Search this Thread
Old 04-27-2009, 10:58 AM   #1
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 641
Thanked: 8
spam/spoofing issues with my mail server.


[Log in to get rid of this advertisement]
I am running a mail server on CentOS(2.6.18-92.el5PAE) and have been fighting the spam/email spoofing for a while now and it's driving me crazy.

Here is the mail set up:

rpm -qa | grep courier
courier-mlm-0.58.0-1.2
courier-maildrop-0.58.0-1.2
courier-0.58.0-1.2
courier-ldap-0.58.0-1.2
courier-authlib-0.60.2-1.fc2
courier-imapd-0.58.0-1.2
courier-webmail-0.58.0-1.2
courier-pop3d-0.58.0-1.2

rpm -qa | grep spam
spamassassin-3.2.5-1.el5.rf


rpm -qa | grep clam
clamav-0.95.1-2.el5.rf
clamav-db-0.95.1-2.el5.rf
clamd-0.95.1-2.el5.rf
clamav-devel-0.95.1-2.el5.rf



I have tried to feed spam into the baysian filters with the sa-learn command and it doesnt seem to be helping. Another issue I have seen is emails being sent to and from the same address of different individuals in our company: So a spam email would be To: user@hostname.com From: user@hostname.com. Also another weird thing is an email would be sent to user@hostname.com but end up in another users inbox. I've checked aliases/distribution groups and I cant see any real reason why they are getting spam sent to someone else.

I do have an SPF record on our external DNS and I've tested it on various SPF testing websites and they seem to pass. Ive searched around the net and have tried various configurations but nothing seems to stop the spam or the spoofing.

SPF records in DNS:
IN TXT "v=spf1 a mx ~all" ; This is an SPF record (see http://spf.pobox.com/)

mail IN A *external IP of the mail server
IN TXT "v=spf1 a mx ~all" ; SPF record


*mailserver hostname IN TXT "v=spf1 a mx ~all" ; SPF record



Not sure what configurations for courier/spamassassin to post so if anyone can tell me what I would need to post to help troubleshoot please tell me and I can post it. Thanks!
ncsuapex is offline     Reply With Quote
Old 04-27-2009, 11:52 AM   #2
farslayer
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: Debian Lenny / Squeeze / Sid
Posts: 7,215
Blog Entries: 5
Thanked: 246
I finally gave up trying to keep SA updated and just bought a Barracuda. It was reasonably priced, annualy support is inexpensive (compared to my time maintaining the old system it actually costs less). Also takes quite a bit of load off the mail server CPU..


Not sure if Courier has anything similar to postfix UCE controlls. These were a big help blocking emails from bad mail servers, Does Courier do anything like postfix relay and access controls ?
http://www.postfix.org/postconf.5.ht...r_restrictions
These restrictions did a lot to block some of the spam typesd you mentioned.

email says it from xdomain.com, reverese lookup says that is not true. mail is dropped before further processing time is wasted on it.

Dropping the emails prior to it even hitting SA, helped reduce the CPU load, since I wasn't processing messages through SA that the system determined earlier were not worth the effort. I was rather amazed at the ammount of SPAM these controls alone eliminated.

Sorry I don't know much about Courier as an MTA I've only used it for POP and IMAP services.

Last edited by farslayer; 04-27-2009 at 02:34 PM..
farslayer is offline     Reply With Quote
Old 04-27-2009, 12:16 PM   #3
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 641
Thanked: 8

Original Poster
I *think* courier uses bofh in the same way postfix uses sender restrictions. This is what I have in my /etc/courier/bofh file:

opt BOFHBADMIME=accept
opt BOFHSUPPRESSBACKSCATTER=none


opt BOFHSPFHELO=pass,unknown,error,none,neutral,softfail
opt BOFHSPFMAILFROM=pass,unknown,error,none,neutral,softfail
opt BOFHSPFFROM=pass,unknown,error,none,neutral,mailfromok,softfail
opt BOFHSPFTRUSTME=1


and actually I had removed the last 4 lines for some reason and just readded them back. I'll see if that makes a difference.
ncsuapex is offline     Reply With Quote
Old 05-06-2009, 10:08 AM   #4
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 641
Thanked: 8

Original Poster
I ended up editing my /etc/courier/maildroprc to the following:

Quote:
import RECIPIENT

if ($RECIPIENT =~ /^harvester@/)
{
cc "| /usr/bin/sa-learn -D --single --spam"
exit
}

# Spam Filter
xfilter "/usr/bin/spamc -u $RECIPIENT"

if (/^X-Spam-Status: Yes/:h)
{
UMASK = 007

to "/usr/local/share/Maildir/.Spam/."
}

and changed my /etc/mail/spamassassin/local.rc to this:

Quote:
rewrite_header Subject ****SPAM(_SCORE_)****
required_hits 5
report_safe 0
use_bayes 1
ok_locales en

and that seems to be catching a lot of spam.
ncsuapex is offline     Reply With Quote

Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Exim Spam - spoofing From: same as To: ergotron Linux - Software 1 03-05-2009 02:14 PM
Ubuntu server with postfix. My mail goes to Spam in Gmail and Yahoo Mail. Ideeas? bob808 Linux - Server 4 02-07-2009 05:11 PM
spam control in mail server crown_bd Linux - Server 1 04-22-2007 10:15 AM
Other mail server to filter spam eescaler Linux - Networking 1 01-10-2006 11:34 AM
Mail Server / Spam Filter KevinGuy Linux - General 7 10-16-2004 08:18 AM


All times are GMT -5. The time now is 04:05 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Advertisement
Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Click Here to receive a complimentary subscription courtesy of LQ.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration