출처 : http://wiki.dovecot.org/
Basic Installation
This page describes how to get a minimal Dovecot installation up and running. It's often easier to make things work one at a time, so instead of wondering why your Dovecot/LDAP/Postfix/etc. installation isn't working, make sure the individual packages work standalone first, and only after that glue them together. That way you don't have to wonder if it's an LDAP-specific problem or a generic Dovecot problem when something isn't working.
Starting Dovecot
Dovecot usually runs standalone. If you really want to, you can also start it from inetd or xinetd. Dovecot is started by simply running the dovecot binary. You can stop it by killing the dovecot process. Note that existing IMAP or POP3 sessions (processes) aren't stopped by killing the dovecot process.
Configuration File
If you compiled Dovecot from sources, Dovecot has installed a /usr/local/etc/dovecot-example.conf file, which you'll have to rename to /usr/local/etc/dovecot.conf. Prebuilt packages usually install /etc/dovecot.conf directly. It's a good idea to read through the whole file and see what settings you might want to change.
Mailbox Formats
Dovecot currently supports maildir and mbox formats. They are the most commonly used mailbox formats. They both have their own benefits, discussed in here. Mbox format is sometimes also called "traditional UNIX mailbox format".
If you have trouble figuring out what you are using, it's most likely mbox. Maildir mails are almost always stored in ~/Maildir/ directory, which contains cur/, new/ and tmp/ subdirectories. In maildir each mail is stored in a separate file, while with the mbox format one file contains all mails in the mailbox. Files in /var/mail/ are nearly always mbox files, one for each user.
If you have trouble figuring out what you should be using, choose maildir. It's overall more scalable and it can't get corrupted.
Mail Location
You need to tell Dovecot where your mails are stored. Dovecot attempts to do some automatic detection by default, but usually it's better to specifically tell it just to be sure users don't mess things up.
With maildir you probably want this:
default_mail_env = maildir:~/MaildirWith mbox you probably want this:
default_mail_env = mbox:~/mail:INBOX=/var/mail/%uThe above specifies that INBOX exists in /var/mail/<username> file and the rest of the folders under ~/mail.
See VirtualUsers for more information about this.
Mbox Issues
If you use mbox, there are a few things that you need to check.
Locking
Mbox is very sensitive to handling locking correctly, otherwise you may corrupt the mailboxes or cause deadlocks. All software that accesses the mbox must use compatible locking. Typically this includes Dovecot and your local delivery agent (LDA). SMTP servers usually include some built-in LDAs, but there are also some commonly used external ones, for example Procmail.
Traditionally all software accessing mboxes create "dotlock" files to protect them. This is done by creating mailbox.lock file for the mailbox file. As long as the file exists, no-one else is allowed to read or write to the mbox. There are a couple of problems with dotlocks however, so other locking mechanisms have also been created.
Other locking mechanisms are called fcntl, flock and lockf. Some operating systems don't support all of them.
You have to make sure that all software use at least one common locking mechanism, and if they are using multiple common mechanisms, they must be used in the same order to avoid deadlocks. Consult other software's documentation and configuration files to see what locking they use.
Dotlocks should always be included in write locks, because nearly all software uses it. That makes sure your mbox files never get corrupted accidentally. Including it in read locks will however block other readers which would be permitted, so it may not be a good idea to do.
Dovecot 1.0-tests have separate settings for read and write locking: mbox_read_locks and mbox_write_locks. 0.99 has only mbox_locks and mbox_read_dotlock to specify if dotlocking should be used while reading.
MboxSoftwareLocks lists some software and how to see what locking they use.
Access to /var/mail
Since every user's mails are stored here, it should not be possible for users to delete each other's mail files. Usually this is done by allowing only a special group to create or delete files in this directory. Usually this group is called mail.
When dotlocking is used, Dovecot needs to be able to create the dotlock files into the directory. Usually this means that Dovecot also needs to have access to the special group that owns the /var/mail directory. This can be set with:
mail_extra_groups = mailAuthentication
auth_userdb and auth_passdb settings specify how Dovecot finds out which users have access to mails (in 1.0-tests these are just userdb and passdb inside the auth { .. } section).
If you intend to give access only to users that already have UNIX access (ie. in /etc/passwd) you don't usually have to do anything. The default is to use passwd and PAM for authenticating users.
If you intend to use virtual users, or you have any trouble logging, try first that passwd-file works correctly. First set:
auth_userdb = passwd-file /etc/imap.passwd auth_passdb = passwd-file /etc/imap.passwdand create the /etc/imap.passwd file (in the same format as /etc/passwd):
testuser:{plain}pass:65534:65534::/home/testuserAfter this, you should be able to log in as testuser using password pass. The home directory is /home/testuser, so mails would be stored under /home/testuser/Maildir or /home/testuser/mail/.
The /home/testuser is expected to be owned by user ID (UID) number 65534. You can change that to something else if you want. The first 65534 is the UID, the second is the group ID.
See UserIds for more information about UIDs and GIDs.
SSL/TLS Configuration
If you intend to use SSL, set ssl_cert_file and ssl_key_file settings. Otherwise set ssl_disable = yes.
By default Dovecot doesn't allow users to send passwords unencrypted to the server. Usually if SSL is enabled, it's a good idea not to allow this. However, if you don't offer SSL for some reason, you'll probably want to set disable_plaintext_auth = no.
Logging
By default Dovecot logs to syslog's mail facility. Usually this goes to /var/log/mail.log, /var/log/maillog or a similar file. If you don't see the "Dovecot starting up" message after starting Dovecot, you're looking at the wrong file.
You can also specify files where to store the logs with log_path and info_log_path settings. log_path is used for errors, while info_log_path is used for information messages. They can point to the same file.
Testing
Now that you know the most important settings, you can go and start dovecot.
-
Make sure you see the "Dovecot starting up" message in your log file.
-
Try logging in with telnet or similar: telnet localhost 143
-
It should reply with the * OK Dovecot ready. message. If not, it's not running for some reason. Probably some configuration mistake, see log file for errors.
-
Try to log in: x login testuser pass
-
You should see the x OK Logged in. message. If not, authentication failed for some reason. Set auth_verbose = yes in the configuration file, restart Dovecot, try to log in again and see what the error is in the log file.
-
-
Log out: x logout
-
-
Try logging in with a real IMAP client and make sure everything works
'O / S > FreeBSD' 카테고리의 다른 글
| APM of FreeBSD 2005/1/10 (0) | 2007/06/01 |
|---|---|
| openWebmail 설치가이드 (0) | 2007/06/01 |
| dovecot - imap,pop3서버 (0) | 2007/06/01 |
| (펌)FreeBSD 4.8 with qMail (v0.01) (0) | 2007/06/01 |
| Qmail + vpopmail + CourierIMAP + sqwebmail + MySQL .. (0) | 2007/06/01 |
| sendmail + sasl + imap 설치 (0) | 2007/06/01 |




최근에 달린 댓글
링크
최근에 받은 트랙백
태그목록