LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-10-2013, 01:20 PM   #1
tonkyman
LQ Newbie
 
Registered: Jan 2010
Posts: 6

Rep: Reputation: 0
Spam problems on Ubuntu running Postfix


I am running a Ubuntu mail server with Postfix, Courier, and Squirrel Mail. I have Postfix setup with Postgrey, Spamassassin, and a couple of RBLs.

My problem is spam. I get 100 spam messages an hour to just my account alone. Postgrey and Spamassassin drop thousands an hour but I still get hammered with junk that makes it through the filtering.

Is there a way to reject all but white-listed mail for a single user? I would like to have the system drop all mail to my account unless the sending domain (or account) is white-listed in a access control list.

The spam I'm getting comes from random domains 3 at a time. There will be three from blahblah@gmail.com and then three from xxx@standardfuel.com and then three from yada@yahoo.com. when I look down the list I have several of the same emails from different senders.

I tried blocking the senders but since I only get three emails and then it starts using another account the blocking became a task unto itself.

When I google for an answer I find that most of the answers are rather old. I'm hoping you guys can help me out.

Suggestions?

Thanks,
Tony T
 
Old 06-11-2013, 11:07 AM   #2
thedaver
Member
 
Registered: Jan 2010
Posts: 65

Rep: Reputation: 21
Filtering on sender email address is unreliable. Are you seeing a pool of IP addresses as sources? Are you seeing consistent string patterns in the spam itself?
 
Old 06-11-2013, 12:52 PM   #3
tonkyman
LQ Newbie
 
Registered: Jan 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by thedaver View Post
Filtering on sender email address is unreliable. Are you seeing a pool of IP addresses as sources? Are you seeing consistent string patterns in the spam itself?
You're correct... filtering on sender is unreliable. The email "From" address with be something like "Dr Oz Diet" but it's actually from some random address that changes every third email.

I'm not seeing any consistent ip addresses. Everything is very random.

I send all my mail through a set of checks before they get processed. I check and reject for invalid_hostname, non_fqdn, unknown_sender_domain, unauth_pipelining, unauth_destination and stuff like that. The I process it through Postgrey, Spamassassin and Amavis. Then it hits my RBL list:
reject_rbl_client multi.uribl.com,
reject_rbl_client dsn.rfc-ignorant.org,
reject_rbl_client sbl-xbl.spamhaus.org,
reject_rbl_client cbl.abuseat.org,
reject_rbl_client combined.rbl.msrbl.net,

After it's passed all those checks I accept the mail.

If I could find a way I feel like it's better to just reject all mail that is not specifically white-listed per user. Not all of my users have this problem.

I wish I could find a way to handle it like I do the RBL checks. When the mail hits the server it looks to see who the mail is destined for then looks in a white-list ACL and if the sending domain is not listed drop it in a black hole or append the sending domain to a text file that can be checked periodically. Effectively all mail to a specific user would be rejected except known good addresses in the ACL.

Thanks,
Tony

Last edited by tonkyman; 06-11-2013 at 12:55 PM.
 
Old 06-11-2013, 01:19 PM   #4
thedaver
Member
 
Registered: Jan 2010
Posts: 65

Rep: Reputation: 21
Add????

reject_rbl_client b.barracudacentral.org,
reject_rbl_client zen.spamhaus.org



You can also try to tarpit (google: postfix tarpit) the SMTP connections to slow down the flow, many spam engines seem to give up when they are tarpitted..

You can also look into fail2ban to use some connection throttling (if there was more consistency to IP)
 
Old 06-12-2013, 10:27 AM   #5
tonkyman
LQ Newbie
 
Registered: Jan 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by thedaver View Post
Add????

reject_rbl_client b.barracudacentral.org,
reject_rbl_client zen.spamhaus.org



You can also try to tarpit (google: postfix tarpit) the SMTP connections to slow down the flow, many spam engines seem to give up when they are tarpitted..

You can also look into fail2ban to use some connection throttling (if there was more consistency to IP)
I already use Fail2Ban. The tarpit looks a lot like what Postgrey is doing. I'll add the 2 RBLs you suggested and see if that helps. I'd still like to find a way to white-list by user.
 
Old 06-14-2013, 09:54 AM   #6
tonkyman
LQ Newbie
 
Registered: Jan 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Thedaver,
Those two RBLs have helped considerably. The volume of spam has been reduced to about a third of what it was.... thanks!

I'm still looking for a solution that will allow me to ban all except what I have white-listed.

Thanks,
Tony
 
Old 06-24-2013, 07:13 AM   #7
tonkyman
LQ Newbie
 
Registered: Jan 2010
Posts: 6

Original Poster
Rep: Reputation: 0
I'm still looking for a solution. Ideas anyone???

Tony
 
Old 06-25-2013, 06:20 PM   #8
enrollTN
LQ Newbie
 
Registered: Jun 2013
Posts: 3

Rep: Reputation: Disabled
to white list I used a sender_access file i created under my postfix folder.

create sender_access

use this format:
myfriend@example.com OK

ensure under smtpd_recipient_restrictions you have an entry for check_sender_access hash:/location/of/sender_access (mine is /etc/postfix/sender_access

then run sudo postmap sender_access and it will create a sender_access.db file. Anyone I have in this file is delivered immediately, no greylisting (which i just turned off)

Hope that might help you some.
 
Old 06-26-2013, 10:43 AM   #9
tonkyman
LQ Newbie
 
Registered: Jan 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by enrollTN View Post
to white list I used a sender_access file i created under my postfix folder.

create sender_access

use this format:
myfriend@example.com OK

ensure under smtpd_recipient_restrictions you have an entry for check_sender_access hash:/location/of/sender_access (mine is /etc/postfix/sender_access

then run sudo postmap sender_access and it will create a sender_access.db file. Anyone I have in this file is delivered immediately, no greylisting (which i just turned off)

Hope that might help you some.
Thanks... I use the same method to white and blacklist on my server. I wrote a little script called "addblacklist" and "addwhitelist" that automatically adds the correct entry in the sender_access file then it runs postmap on the file. One command addblacklist person@baddoamin.com does it all.... it's pretty neat.

Thanks for your reply,
Tony
 
  


Reply



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
Move SA Marked Spam to Junk/Spam Folder Using Procmail, Postfix, and Virtual Users alden_pease Linux - Server 0 01-05-2012 12:29 AM
postfix spam. someone is using my server to send spam and it's not open relay bob808 Linux - Server 6 03-23-2010 09:44 AM
Ubuntu server postfix install with amavis and spam assassin, how can I access the ema steven19782007 Linux - Server 0 09-22-2009 08:49 AM
Postfix, dovecot, spamassassin SPAM to a spam folder breitscott Linux - Server 30 02-17-2007 02:47 PM
postfix spam filtering problems pyu7 Linux - Software 0 09-17-2004 09:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:10 AM.

Main Menu
Advertisement
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.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration