Czech version


SMTP authentication for Qmail

While SMTP authentication?

Almost all SMTP servers do not permit SMTP relay - it is defense again spam. If somebody alternate between more IP providers (typically  "free Internet" dialup access users) and needs SMTP server for sending mail, he can:

Administrator troubles with SMTP auth 

It seems that SMTP authentication is the best solution for users and for administrators too (users stop require to permit relay). I use SMTP authentication for Qmail from www.nimh.org (http://www.nimh.org/dl/qmail-smtpd.c). It works fine (thanks to author), but I discovered some problems:

  1. Netscape mail client try authentication whenever it find that SMTP server support SMTP AUTH (from EHLO dialog) and asks user for password. Client use the same login as for POP. There is not possible to set anything. 
    MS clients MS Outlook and Outlook Express are different - it is possible to set everything (use authentication or not, use the same login and password as for POP or another...).
    Problems with Netscape mail clients users after SMTP authentication was implemented:
  2. Netscape SMTP servers supports SMTP authentication. It seems to me that similar as Netscape client Netscape server try authentication whenever it find that second SMTP server supports SMTP AUTH. Because server does not know any password and use blank login (or anything else, e.g. "root"), our server ends SMTP connection. Probably not only Netscape servers know SMTP authentication today.
    Problems with Netscape servers (a another SMTP servers which supports SMTP authentication on sending):

Solving

I use SMTP authentication for Qmail from www.nimh.org (http://www.nimh.org/dl/qmail-smtpd.c) with minor changes:

  1. Server hide its SMTP AUTH support (in EHLO command) when relay is permitted for remote computer (it solve problems with Netscape clients from LAN - the clients do not try to authenticate and do not ask user for password). 
  2. When SMTP AUTH fail, server do not terminate connection - only waits 2 seconds and do not permit relay for messages (it solve problems with Netscape servers).
  3. Server write to syslog about authentication.

Modified qmail-smtpd.c

qmail-smtpd.c for Qmail 1.03

Installation

Known problems

Useful links:


Comments welcome 2004-06-08  Vladimír Horák