My virtual host is set up with sendmail and uw-imap. The good is out-of-the-box support for virtual mailboxes. The bad is the painful sendmail setup.

Unfortunately, Sendmail is not something supposed to be replaced by virtual host owner, and to be honest installing Postfix is not my favorite occupation.

 

So, the goal is to enable SMTP auth with virtual credentials using sendmail.

 

Rationale: check credentials with IMAP.

 

To achieve this simple goal, the following weird scenario should be implemented:

 

 

SMTP(sendmail) -> Clear Text (saslauthd) -> IMAP (uwimap)

 

Following are the required settings:

 

1. Enable LOGIN PLAIN authentication mechanism in sendmail.mc

Don't forget to recompile senndmail.cf after changing .mc

 

2. Install saslauthd if not present

 

3. Setup parameters for saslauthd MECH=rimap FLAGS="-O localhost -r"

I changed /etc/sysconfig/saslauthd. In this case rimap stands for IMAP authentication mechanism, option "-r" tells saslauthd to "Combine the realm with the login (with an '@' sign in between)." (quote from saslauthd MAN page).

 

4. If something goes wrong, you may localize the problem by following tests:

4.1. testsaslauthd -uuser -ppass

4.2. telnet localhost 143

and issue the following command:

L001 LOGIN "user" "pass"

 

Hope everything worked for you, if not - leave a comment for this article.