Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| email:configure-dovecot [2025/03/03 20:27] – willy | email:configure-dovecot [2025/03/13 14:05] (current) – [Configuring Dovecot] willy | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Configuring Dovecot ====== | + | ====== |
| Dovecot configuation is stored in **/ | Dovecot configuation is stored in **/ | ||
| Line 11: | Line 11: | ||
| Edit **doveconf.conf**: | Edit **doveconf.conf**: | ||
| < | < | ||
| - | protocols = imap sieve managesieve | + | protocols = imap lmtp sieve |
| login_greeting = IMAP server ready. | login_greeting = IMAP server ready. | ||
| + | # Optional DEBUG stuff to enable if things don't work: | ||
| + | # | ||
| + | # | ||
| + | #auth_debug = yes | ||
| + | # | ||
| + | #mail_debug = yes | ||
| + | # | ||
| </ | </ | ||
| - | ===== Setup auth endpoint for postfix ===== | + | ===== Setup link to postfix ===== |
| Changes in **conf.d/ | Changes in **conf.d/ | ||
| < | < | ||
| + | service lmtp { | ||
| + | unix_listener / | ||
| + | group = postfix | ||
| + | mode = 0660 | ||
| + | user = postfix | ||
| + | } | ||
| + | |||
| service auth { | service auth { | ||
| unix_listener / | unix_listener / | ||
| Line 26: | Line 40: | ||
| } | } | ||
| } | } | ||
| + | </ | ||
| + | |||
| + | This is required because postfix will use dovecot to deliver mail to mailboxes internally and to perform SASL authentication as well. | ||
| + | |||
| + | ===== Setup Sieve ===== | ||
| + | |||
| + | Sieve let's you create custom filters that will filter your inbound emails. | ||
| + | |||
| + | Changes in **conf.d/ | ||
| + | < | ||
| + | protocol lmtp { | ||
| + | mail_plugins = $mail_plugins sieve | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | And specify which folder should store the filters. | ||
| + | |||
| + | Changes in **conf.d/ | ||
| + | < | ||
| + | plugin { | ||
| + | sieve = file:/ | ||
| </ | </ | ||
| Line 80: | Line 115: | ||
| + | ===== Testing ===== | ||
| + | |||
| + | Start dovecot | ||
| + | |||
| + | Check that login works: | ||
| + | <code bash> | ||
| + | doveadm auth test -a / | ||
| + | </ | ||
| + | |||
| + | Test IMAP: | ||
| + | <code bash> | ||
| + | telnet mail.mydomain.com 143 | ||
| + | Trying 1.2.3.4... | ||
| + | Connected to mail.mydomain.com. | ||
| + | Escape character is ' | ||
| + | * OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ STARTTLS AUTH=PLAIN AUTH=LOGIN] IMAP </ | ||
| + | |||
| + | Test that login works: | ||
| + | <code bash> | ||
| + | telnet 127.0.0.1 1143 | ||
| + | Trying 127.0.0.1... | ||
| + | Connected to 127.0.0.1. | ||
| + | Escape character is ' | ||
| + | * OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LITERAL+ STARTTLS AUTH=PLAIN AUTH=LOGIN] IMAP server ready. | ||
| + | a login user@mydomain.com password | ||
| + | a OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY PREVIEW=FUZZY PREVIEW STATUS=SIZE SAVEDATE LITERAL+ NOTIFY SPECIAL-USE] Logged in | ||
| + | </ | ||
| + | |||
| + | Test TLS works: | ||
| + | <code bash> | ||
| + | openssl s_client -connect mail.mydomain.com: | ||
| + | [ expect similar output as above ] | ||
| + | </ | ||
| + | |||
| + | Test STARTTLS works: | ||
| + | <code bash> | ||
| + | openssl s_client -connect mail.mydomain.com: | ||
| + | [ expect similar output as above ] | ||
| + | </ | ||
| + | |||
| + | If all those checks worked fine, your dovecot seems all set! | ||