[CentOS] Sendmail

Sun Nov 6 20:50:40 UTC 2005
Aleksandar Milivojevic <alex at milivojevic.org>

Sam Drinkard wrote:

> Advice taken.. I did some extensive searching of the archived 
> discussions, and did not find any one thing that related to setup of 
> dovecot, nor could I find any kind of document describing setup of 
> sendmail/cyrus-imapd.  Even google did not return what I'd consider fair 
> game unless I were installing from sources, which I'm not.  That said, 
> is there a document that describes setup of dovecot?  All I really need 
> is pop, as there is only one or two mail accounts on the machine.

Actually, you'll need to take couple of steps, however they are trivial. 
  While you can telnet to port 110, your user will not be able to login, 
and email will be delivered to the wrong place (where Cyrus can't access 
it).

First thing, enable and start saslauthd.  Cyrus uses it for authentication:

# chkconfig saslauthd reset
# chkconfig saslauthd on
# /etc/init.d/saslauthd start

Then, instruct Sendmail to use Cyrus for delivery to local mailboxes 
(instead of default procmail).  First find and comment (place "dnl " 
string in front of them) these lines in sendmail.mc:

FEATURE(local_procmail)
MAILER(procmail)

Replace them with these lines:

define(`confLOCAL_MAILER', `cyrusv2')
define(`CYRUSV2_MAILER_ARGS', `FILE /var/lib/imap/socket/lmtp')
MAILER(cyrusv2)

Rebuild sendmail.cf from sendmail.mc, and restart sendmail.

You would place "define" lines somewhere around start of sendmail.mc 
(where other "define" lines are).  Place "MAILER" line at the end of the 
file (where other "MAILER" lines are).

If you want user's mailbox to be automatically created when user logs in 
for the first time, add this line to /etc/imapd.conf:

autocreatequota: -1

If you don't set this option, you would need to manually create user's 
mailbox before they could login.  Note that for email to be delivered to 
mailbox, it must exist (in Cyrus world, mailbox and account are two 
different things).  So, even with that option, user would either need to 
login to account or you would need to create mailbox before email can be 
delivered to it.

Creating mailboxes manually is easy.  Set password for cyrus account. 
Excute "cyradm -u cyrus localhost", and then use "cm" command to create 
mailbox.  For example, to create mailbox for user root, you would do 
(the "user." part is important!):

# cyradm -u cyrus localhost
 > cm user.root
 > exit

While in cyradm, you can type "help" to see other usefull commands.

If your users are using Outlook or Outlook Express to read email, your 
life will be a bit easier if you add this line to /etc/imapd.conf:

altnamespace: 1

If your users are not using buggy IMAP clients such as Outlook or 
Outlook Express, don't set that option.

You might want to browse through man page for imapd.conf ("man 
imapd.conf") to see other usefull option.  You probably will not want to 
change anything else.  One thing to warn you, "createonpost" option will 
probably look tempting, but you really do not want to use it.  It has 
some ill side effects.

BTW, since you'll have fully working IMAP server, my advice is to let 
users use it.  Switching to new PC, or accessing email from webmail, or 
from multiple PCs is so much easier if users are using IMAP.  Even if 
they need access only from single PC, there are still advantages of 
using IMAP, and having email stored on IMAP server.