Aaron Gadberry

Help – v. helped, help·ing, helps

Was this site helpful?
My Amazon.com Wishlist

How To: Blacklist an Email Address

7th February 2006 - By Aaron Gadberry

If you run a server with Spamassassin and you have one annoying person you need to block (blacklist) from your entire server, this article is for you. It’s a fairly simple process, but you will probably need root access to the server to complete the configuration changes.

You will need to edit the Spamassassin configuration file, typically found in the /etc/mail/spamassassin/ directory.

If you have joe installed you can edit it like so joe /etc/mail/spamassassin/local.cf.

You will need to add a line like blacklist_from [email protected] somewhere in the file. See below for an example file with the line added.

You will then need to restart Spamassassin using /etc/rc.d/init.d/spamassassin restart in order to have the changes take effect.

My file looks like this after I added it.

# These values can be overridden by editing ~/.spamassassin/user_prefs.cf # (see spamassassin(1) for details) # These should be safe assumptions and allow for simple visual sifting # without risking lost emails. required_score 7 rewrite_header Subject ****SPAM(_SCORE_)**** report_safe 1 use_bayes 1 use_bayes_rules 1 bayes_auto_learn 0 bayes_auto_learn_threshold_nonspam 0.1 bayes_auto_learn_threshold_nonspam 14.0 #use_razor2 0 #razor_timeout 10 #use_dcc 0 #dcc_path /usr/bin/dccproc #dcc_timeout 10 #dcc_body_max 999999 #dcc_fuz1_max 999999 #dcc_fuz2_max 999999 #dcc_options -R use_pyzor 0 #pyzor_path /usr/bin/pyzor #pyzor_timeout 10 #pyzor_max 5 blacklist_from [email protected] # SQL settings storage #user_scores_dsn DBI:mysql:atomiclean:localhost #user_scores_sql_username USER #user_scores_sql_password PASSWORD #user_scores_sql_table userpref #user_scores_sql_field_username username #user_scores_sql_field_preference preference #user_scores_sql_field_value value # # AWL #auto_whitelist_factory Mail::SpamAssassin::SQLBasedAddrList #user_awl_dsn DBI:mysql:atomiclean:localhost #user_awl_sql_username USER #user_awl_sql_password PASSWORD #user_awl_sql_table awl # Bayes #bayes_store_module Mail::SpamAssassin::BayesStore::SQL #bayes_sql_dsn DBI:mysql:atomiclean:localhost #bayes_sql_username USER #bayes_sql_password PASSWORD #bayes_sql_override_username someusername #This directive, if used, will override the username used for storing #data in the database. This could be used to group users together to #share bayesian filter data.

One Response to “How To: Blacklist an Email Address”

  1. Brabus Says:

    Thanks mate. Handy.

    B

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>