[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Exim rejecting _everything_ with spamassassin



j-debian_lists@rabid-hamster.com wrote:

  X-Spam_score_int: 6

The spam score is high enough to have the mail rejected.

Here's my exim4.conf file. I put "#Spamassassin" comments near every block I
added for spamassassin.

#Spamassassin
#acl_smtp_data = acl_check_data
#acl_not_smtp = acl_check_data
#Spamassassin

You must not comment these out.

It looks somewhat like you mixed an Exim3 config with an Exim4 config. I'd suggest to start with a new Exim4 config from /usr/share/doc/exim4-base/examples/example.conf.gz. Copy it to /etc/exim4/exim4.conf and change it to your needs. The configuration is pretty easy and straightforward then.

Also, install the info doc package for exim4, it's very useful for looking things up and finding out what has changed.


Once you got a suitable, config, set

> COMMONOPTIONS='-C /etc/exim4/exim4.conf'

in /etc/default/exim4 to make sure exim will use your config.

You need spamd running. Edit /etc/default/spamassassin (don't forget to enable!) and change to

> OPTIONS="--create-prefs --max-children 5 --helper-home-dir -u spamd"

You need to add the user spamd (or whatever name you like for it) with adduser before, to have spamd running as that user.

In /etc/exim4/exim4.conf, set the following:


> spamd_address = 127.0.0.1 783
> [...]
acl_check_data:

  # Add headers to a message if it is judged to be spam. Before enabling this,
  # you must install SpamAssassin. You may also need to set the spamd_address
  # option above.
  #
  warn    spam      = spamd
          message   = X-Spam_score: $spam_score\n\
                      X-Spam_score_int: $spam_score_int\n\
                      X-Spam_bar: $spam_bar\n\
                      X-Spam_report: $spam_report

  # Accept the message.

  accept


That's all what's needed for SPAM checking, but maybe you also want to scan for viruses ... In any case, once the server is running, monitor memory consumption closely. I've seen spamd eating up several gigs of RAM when sending a few large testmails :( You may want to reduce the number of --max-children from 5 to 3 (in /etc/default/spamassassin) and put a size limit on the mails to be checked for SPAM (in /etc/exim4/exim4.conf), like 10kb or 100kb:


acl_check_data:

  # Deny if the message contains a virus. Before enabling this check, you
  # must install a virus scanner and set the av_scanner option above.
  #
  discard malware   = *
          demime    = *
          log_message   = virus%$tod_log%<$return_path>%<$recipients>%($malware_name)

  # Add headers to a message if it is judged to be spam. Before enabling this,
  # you must install SpamAssassin. You may also need to set the spamd_address
  # option above.
  #
  warn    condition = ${if < {$message_size}{100k} }
          spam      = spamd
          message   = X-Spam_score: $spam_score\n\
                      X-Spam_score_int: $spam_score_int\n\
                      X-Spam_bar: $spam_bar\n\
                      X-Spam_report: $spam_report

  # Accept the message.

  accept

This will help a lot to reduce memory consumption --- imho a neccessity for a server that should be reliable. To protect the server from being overwhelmed by mail, you may also want to set the following (in /etc/exim4/exim4.conf, at the beginning of the file):

split_spool_directory = true
check_spool_space = 1024M
smtp_check_spool_space = true

message_size_limit = 100M
bounce_return_size_limit = 8k

deliver_queue_load_max = 2.00
queue_only_load = 1.50
remote_max_parallel = 8

Adjust these values to the performance of your server and the amount of mail it has to handle. (These are for a 900 MHz Celeron with 384MB of RAM, several gigs of swap and a 3ware ATA RAID 1 that does virus scanning besides checking for SPAM.)

The above mentioned example config is prepared for that; I strongly recommend you start from there!

The auto configuration of exim4 is imho totally useless and utterly confusing ...

But I do love Exim :)


GH



Reply to: