LinuxQuestions.org
Help answer threads with 0 replies.
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-21-2011, 08:07 AM   #1
ddaas
Member
 
Registered: Oct 2004
Location: Romania
Distribution: Ubuntu server, FreeBsd
Posts: 474

Rep: Reputation: 30
Postfix & anti-spam optimization


Hello,
My postfix server has been working great for the last 1-2 years. Lately the number of spams encreased (from 1-2 every day to aprox 8-10 every day per domain for some domains ).

I post here the output of postconf -n. Maybe someone gives me some advices about what cat I change or how can I optimize. I must recognise that I don't fully understand details of how postfix and all the restrictions works together, but I will document every advice.


Thanks

Code:
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
mailbox_size_limit = 0
mydestination = cma.xx, cma.cma.xx, localhost.cma.xx, localhost
myhostname = mail.xx.xx
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost = 
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_helo_required = yes
smtpd_helo_restrictions = reject_invalid_hostname permit
smtpd_recipient_restrictions = reject_non_fqdn_sender reject_non_fqdn_recipient permit_mynetworks permit_sasl_authenticated reject_unauth_destination reject_sender_login_mismatch reject_invalid_hostname reject_unknown_sender_domain  reject_unknown_recipient_domain reject_unverified_recipient reject_unlisted_recipient reject_invalid_helo_hostname check_sender_access hash:/etc/postfix/access_sender check_helo_access pcre:/etc/postfix/helo_checks reject_unknown_sender_domain reject_rbl_client zen.spamhaus.org, reject_rhsbl_sender    dsn.rfc-ignorant.org permit
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_sender_restrictions = reject_unknown_sender_domain, reject_non_fqdn_sender, permit
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_alias_maps = hash:/etc/postfix/valias.txt
virtual_gid_maps = static:1000
virtual_mailbox_base = /var/spool/vmail
virtual_mailbox_domains = /etc/postfix/vhost.txt
virtual_mailbox_maps = hash:/etc/postfix/vmaps.txt
virtual_uid_maps = static:1000
 
Old 06-21-2011, 11:56 AM   #2
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,693
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
What other anti-spam utilities are you using? It is not obvious from main.cf just what you are doing. You should have amavis and clamav to run all the arriving mail through to help filter spam.
 
Old 06-22-2011, 04:14 AM   #3
ddaas
Member
 
Registered: Oct 2004
Location: Romania
Distribution: Ubuntu server, FreeBsd
Posts: 474

Original Poster
Rep: Reputation: 30
As I know amavis and clamav are anti-virus software and not anti-spam.

In fact I am interested what could I optimize here:

Code:
smtpd_recipient_restrictions = reject_non_fqdn_sender reject_non_fqdn_recipient permit_mynetworks permit_sasl_authenticated reject_unauth_destination reject_sender_login_mismatch reject_invalid_hostname reject_unknown_sender_domain  reject_unknown_recipient_domain reject_unverified_recipient reject_unlisted_recipient reject_invalid_helo_hostname check_sender_access hash:/etc/postfix/access_sender check_helo_access pcre:/etc/postfix/helo_checks reject_unknown_sender_domain reject_rbl_client zen.spamhaus.org, reject_rhsbl_sender    dsn.rfc-ignorant.org permit
 
Old 06-22-2011, 05:05 AM   #4
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
Here are a couple of threads where I have discussed this. In particular, this thread, discusses using anti-spam measures in layers which is one of the key things that you will need to do. This thread has some tips that are quite recent as I have been having a problem with a real increase in spam too.

As I mention in the threads, you will need to apply your spam filtering in layers. Start with greylisting, which will require the sender to use a compliant mail client. Then use HELO restrictions to keep some junk from even being queued up. Follow this with some DNS checks, such as the RBL list. Note, this is a YMMV issue, but I had to place the spamhaus check towards the top in my list or else messages would be accepted before the check. I think it may have been a conflict with the Amavis checks. Next, use a content filter such as DSpam or Spamassassin. These are resource intense so if you can reject it before it gets there your better off. Amavis works with Spamassassin by co-ordinating the filtering of your mail of which virus checking is a part, but it isn't just for viruses. I found I was having a real problem with certain senders and regions which I blocked. If you find that you have a problem with repeat offenders, look up the domain by the AS number and block their entire IP range. Also watch your reject codes. A 400 level code, typical of a DNS problem, is a temporary code and may just cause the stuff to keep coming back. Lastly, consider reporting the stuff that does get through to Spamcop and cause grief for their ISPs.

Once you install the content filter, e.g. Spamassassin, it will take some time to train it as far as what is spam and what is not, as well as tweaking the rules.

In any case, implement one thing at a time and see what effect it has. If you do too much at once, you won't know how effective a particular measure was.

Last edited by Noway2; 06-22-2011 at 07:54 AM. Reason: spelling correction
 
Old 06-22-2011, 05:26 AM   #5
ddaas
Member
 
Registered: Oct 2004
Location: Romania
Distribution: Ubuntu server, FreeBsd
Posts: 474

Original Poster
Rep: Reputation: 30
Thanks. I will read those threads you have recommended.
 
  


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
LXer: Postfix Backup Mail Server Anti-Spam / Anti-Virus Configuration LXer Syndicated Linux News 0 05-05-2009 02:00 PM
LXer: Mandriva Postfix Anti-Spam, Anti-Virus Relay Server for Exchange Server 2000/2003 LXer Syndicated Linux News 0 06-29-2006 10:21 AM
Anti Virus/ Anti Spam for Linux? Sp@rticus Linux - Software 3 11-18-2005 02:17 AM
Postfix Anti-Spam Intro rgerhards Linux - General 0 12-17-2003 04:52 AM
Creating an ultimate anti-virus and anti-spam email gateway markcc Linux - Networking 2 10-08-2003 03:10 AM

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

All times are GMT -5. The time now is 07:11 PM.

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