Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to block some hosts that are brute forcing my SMTP server.

I'm currently using DenyHosts for SSHD and was wondering if I can add the SMTP service too.

It could be possible based on this

Currently in my auth.log I get:

Jan  3 17:58:40 servername saslauthd[10729]: pam_unix(smtp:auth): check pass; user unknown
Jan  3 17:58:40 servername saslauthd[10729]: pam_unix(smtp:auth): authentication failure; logname= uid=0 euid=0 tty= ruser= rhost= 
Jan  3 17:58:42 servername saslauthd[10729]: do_auth         : auth failure: [user=zzz] [service=smtp] [realm=] [mech=pam] [reason=PAM auth error]

But, from the logs I'm not getting the attacker's host. (I'm using Postfix)

Maybe there is a more "standardized" way of doing this with DenyHosts or is there an alternative?

share|improve this question
Switch to dovecot for SASL instead, and trawl the dovecot logs with denyhosts. saslauthd is a pain in the b-hind. – adaptr Jan 4 '13 at 14:14

You can also use Fail2ban instead Denyhosts. Here's a good explanation of how to do it for SMTP:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.