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/13 14:05] – [Configuring Dovecot] willy | email:configure-dovecot [2026/01/22 17:58] (current) – [Setup Sieve] willy | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| For each file, i will show you the changes from the defaults that you need to apply. | For each file, i will show you the changes from the defaults that you need to apply. | ||
| + | |||
| + | **NOTE:** Dovecot 2.4 introduced some changes to the config file. The following has been adapted to this new format. | ||
| ===== Main changes ===== | ===== Main changes ===== | ||
| Line 11: | Line 13: | ||
| Edit **doveconf.conf**: | Edit **doveconf.conf**: | ||
| < | < | ||
| - | protocols | + | dovecot_config_version |
| - | login_greeting | + | dovecot_storage_version |
| - | # Optional DEBUG stuff to enable if things don't work: | + | |
| - | # | + | !include_try conf.d/ |
| - | # | + | |
| - | # | + | protocols { |
| - | # | + | imap = yes |
| - | # | + | |
| - | # | + | |
| + | } | ||
| + | |||
| + | mail_home | ||
| + | mail_driver | ||
| + | mail_path = ~/maildir | ||
| + | |||
| + | mail_uid = vmail | ||
| + | mail_gid = vmail | ||
| + | |||
| + | namespace inbox { | ||
| + | inbox = yes | ||
| + | separator = / | ||
| + | } | ||
| + | |||
| + | sql_driver = sqlite | ||
| + | sqlite_path = / | ||
| + | |||
| + | passdb sql { | ||
| + | query = SELECT username, domain, password FROM mailbox WHERE username = ' | ||
| + | } | ||
| + | |||
| + | userdb sql { | ||
| + | query = SELECT CONCAT('/ | ||
| + | iterate_query = SELECT username AS user FROM mailbox | ||
| + | } | ||
| </ | </ | ||
| Line 48: | Line 75: | ||
| Sieve let's you create custom filters that will filter your inbound emails. | Sieve let's you create custom filters that will filter your inbound emails. | ||
| - | Changes in **conf.d/20-lmtp.conf**: | + | Changes in **conf.d/90-sieve.conf**: |
| < | < | ||
| - | protocol lmtp { | + | sieve_script personal |
| - | | + | |
| } | } | ||
| </ | </ | ||
| - | And specify which folder should store the filters. | + | And enable sieve for lmtp (local delivery), edit **conf.d/20-lmtp.conf**: |
| - | + | ||
| - | Changes in **conf.d/90-sieve.conf**: | + | |
| < | < | ||
| - | plugin | + | protocol lmtp { |
| - | sieve = file:/ | + | |
| + | | ||
| + | } | ||
| </ | </ | ||
| + | |||
| ===== Setup authentication ===== | ===== Setup authentication ===== | ||
| Line 68: | Line 96: | ||
| < | < | ||
| auth_mechanisms = plain login | auth_mechanisms = plain login | ||
| - | # | ||
| - | # | ||
| - | #!include auth-system.conf.ext | ||
| - | !include auth-sql.conf.ext | ||
| - | </ | ||
| - | |||
| - | ===== Setup SQL backend ===== | ||
| - | |||
| - | Changes in **dovecot-sql.conf.ext**: | ||
| - | < | ||
| - | driver = sqlite | ||
| - | connect = / | ||
| - | password_query = SELECT username, domain, password FROM mailbox WHERE username = ' | ||
| - | user_query = SELECT CONCAT('/ | ||
| - | iterate_query = SELECT username AS user FROM mailbox | ||
| </ | </ | ||
| Line 89: | Line 102: | ||
| Changes in **conf.d/ | Changes in **conf.d/ | ||
| < | < | ||
| - | mail_location | + | mail_home |
| - | mail_uid = 5000 | + | mail_driver = maildir |
| - | mail_gid = 5000 | + | mail_path = ~/maildir |
| + | |||
| + | mail_uid = vmail | ||
| + | mail_gid = vmail | ||
| </ | </ | ||
| Line 100: | Line 116: | ||
| Changes in **conf.d/ | Changes in **conf.d/ | ||
| < | < | ||
| - | ssl_cert | + | ssl = yes |
| - | ssl_key | + | ssl_server { |
| + | cert_file | ||
| + | | ||
| + | } | ||
| </ | </ | ||
| - | ===== Setup Sieve and ManageSieve ===== | + | For this to work, you need to ensure that the certs are properly moved after being renewed by Let's Encrypt. I use the following post hook in **/ |
| - | + | <file - dovecot.sh> | |
| - | TBD | + | cp / |
| - | + | cp / | |
| - | <code> | + | chmod o+r / |
| - | # Sieve | + | / |
| - | managesieve_notify_capability = mailto | + | </file> |
| - | managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i; | + | |
| - | </code> | + | |
| + | the chmod is required for command line tools using **doveadm**, | ||
| ===== Testing ===== | ===== Testing ===== | ||