Homebrew will give you instruction for the LaunchDaemons script needed to start and stop dovecot. Next step is to copy over some default configuration files.
cp -pr /usr/local/Cellar/dovecot/2.2.12/share/doc/dovecot/example-config /usr/local/etc/dovecot
Edit local.conf
nano /usr/local/etc/dovecot/local.conf
change all CHANGE_THIS
# A comma separated list of IPs or hosts where to listen in for connections.
# "*" listens in all IPv4 interfaces, "::" listens in all IPv6 interfaces.
# If you want to specify non-default ports or anything more complex,
# edit conf.d/master.conf.
listen = 127.0.0.1
# Protocols we want to be serving.
protocols = imap
# Static passdb.
# This can be used for situations where Dovecot doesn't need to verify the
# username or the password, or if there is a single password for all users:
passdb {
driver = static
args = password=CHANGE_THIS_to_whatever_password_you_like
}
# Location for users' mailboxes. The default is empty, which means that Dovecot
# tries to find the mailboxes automatically. This won't work if the user
# doesn't yet have any mail, so you should explicitly tell Dovecot the full
# location.
#
# If you're using mbox, giving a path to the INBOX file (eg. /var/mail/%u)
# isn't enough. You'll also need to tell Dovecot where the other mailboxes are
# kept. This is called the "root mail directory", and it must be the first
# path given in the mail_location setting.
#
# There are a few special variables you can use, eg.:
#
# %u - username
# %n - user part in user@domain, same as %u if there's no domain
# %d - domain part in user@domain, empty if there's no domain
# %h - home directory
#
# See doc/wiki/Variables.txt for full list. Some examples:
#
# mail_location = maildir:~/Maildir
# mail_location = mbox:~/mail:INBOX=/var/mail/%u
# mail_location = mbox:/var/mail/%d/%1n/%n:INDEX=/var/indexes/%d/%1n/%n
#
# <doc/wiki/MailLocation.txt>
#
mail_location = maildir:/CHANGE_THIS_to_the_path_where_you_want_to_store_the_mail/%n
# System user and group used to access mails. If you use multiple, userdb
# can override these by returning uid or gid fields. You can use either numbers
# or names. <doc/wiki/UserIds.txt>
mail_uid = CHANGE_THIS_to_your_short_user_name_or_uid
mail_gid = admin
# SSL/TLS support: yes, no, required. <doc/wiki/SSL.txt>
ssl = no
# Login user is internally used by login processes. This is the most untrusted
# user in Dovecot system. It shouldn't have access to anything at all.
default_login_user = _dovenull
# Internal user is used by unprivileged processes. It should be separate from
# login user, so that login processes can't disturb other processes.
default_internal_user = _dovecot
# Setting limits.
default_process_limit = 10
default_client_limit = 50
nano /usr/local/etc/dovecot/conf.d/10-auth.conf
Comment out the line that includes the default auth settings like this:
#!include auth-system.conf.ext
Disable the certs as well (or generate em.)
nano /usr/local/etc/dovecot/conf.d/10-ssl.conf
comment out:
#ssl_cert = </etc/ssl/certs/dovecot.pem
#ssl_key = </etc/ssl/private/dovecot.pem
make a plist for osx auto start
sudo touch /var/log/mail.log
sudo nano /Library/LaunchDaemons/homebrew.mxcl.dovecot.plist
paste:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>homebrew.mxcl.dovecot</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>/usr/local/sbin/dovecot</string>
<string>-F</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>ServiceDescription</key>
<string>Dovecot mail server</string>
</dict>
</plist>
Now the server should start without any errors:
sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dovecot.plist
If you need to stop it run:
sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.dovecot.plist
By default dovecot logs will show up in /var/log/mail.log.