Sendmail - DSN: Service unavailable
I have a OpenBSD 3.7 i386 server setup to use Sendmail for outgoing only. Sendmail is in default configuration with only modifications to the mail aliases (/etc/mail/aliases).
I recently started noticing that I was not receiving any emails from the server. Right away I went and looked at my /var/log/maillog to see what was going on and also checked /var/spool/mqueue and /var/spool/mqueue. I noticed two things in the maillog it referred to “DSN: Service unavailable” and “dsn=5.0.0, stat=Service unavailable” and noticed a huge amount of emails sitting in my /var/spool/clientmqueue directory.
As usual I went to Google to see if I could find an answer but was having difficulty. So I went to IRC EFNet #OpenBSD channel. With some help by NicM and amonk I was able to resolve the problem. Thanks guys. The problem lies in how you have your /etc/hosts, /etc/hosts.allow and /etc/hosts.deny. Here’s what I did.
I removed any reference to localhost.domain.com in my hosts file and then also replaced ALL:LOCAL with ALL: 127.0.0.1 in my hosts.allow. The combination of the two caused the emails to not pass through. As soon as these changes were done email started passing through. If for some reason based on your configuration of those three files (hosts/hosts.allow/hosts.deny) this does not resolve you can add sendmail: localhost in your hosts.allow file. If this doesn’t resolve the problem use the below recommend resources I found useful.
Resource: Enhanced Mail System Status Codes (rfc 1893) - Look up status code meaning (i.e. 5.0.0).
Resource: MTP Service Extension for Returning Enhanced Error Codes (rfc 2034)
Resource: Web Server Talk > Email Servers > Sendmail support > DSN: Service Unavailable


July 3rd, 2008 at 5:08 am
[…] telnet: Unable to connect to remote host: Connection refused A quick search on google Binary Expressions ? Sendmail - DSN: Service unavailable gives me the error is probably located in the hosts or hosts.allow file in the etc folder. But it […]
July 25th, 2008 at 10:34 am
[…] telnet: Unable to connect to remote host: Connection refused A quick search on google Binary Expressions ? Sendmail - DSN: Service unavailable gives me the error is probably located in the hosts or hosts.allow file in the etc folder. But it […]