sendmail with dovecot with nologin account

David Robillard david.robillard at
Wed Apr 18 20:18:22 UTC 2007

> I am using dovecot imap and I am having a problem directing mail to
> go to users in Maildir format when they do not have a login shell.
> It seems that the .procmailrc file is ignored and the mail is put
> in mbox format into /var/mail
> For mail-only users with-out a shell, what is the best way to direct
> mail to them in Maildir format within ~/Maildir - maybe directly from
> .forward?

Hello David,

We run dovecot + sendmail + procmail and also store mails in Maildirs.
All of our 3500+ users don't have any access to the mailserver and it
works like a charm.

The trick is to keep things as simple as possible. No home directory
for users nor any valid shell plus a global procmailrc file which is
used for all of the users.

For example, start by instructing sendmail to use procmail in the


Then make sure dovecot knows where the mail is stored:

default_mail_env = maildir:/var/mail/%u

Our example mail user has this entry in master.passwd(5) :

example.user:<encrypted password string>:13431:231::0:0:Example

And the Global procmail configuration is very simple:

cat /usr/local/etc/procmailrc

# procmailrc
# $Id: procmailrc,v 1.1 2006/10/20 13:08:25 drobilla Exp $
# System wide procmail(1) configuration file.
# This configuration causes procmail(1) to deliver mail
# to maildir format as the recipient's UID.



<bad reference>A single file to rule them all</bad reference>

Sorry, couldn't resist :)

Let me know if you need any help with this setup.


David Robillard
UNIX systems administrator & Oracle DBA
CISSP, RHCE & Sun Certified Security Administrator
Montreal: +1 514 966 0122

More information about the freebsd-questions mailing list