content/blog/mail_server_alpine_postfix_dovecot_tutorial.md: dovecot.logging section

This commit is contained in:
revsuine 2024-11-25 00:57:42 +00:00
parent 54f2e52bbc
commit c6d8eb817c
Signed by: revsuine
GPG key ID: 3F257B68F5BC9339

View file

@ -493,7 +493,41 @@ Now let's enable IMAP by editing `/etc/dovecot/dovecot.conf`. Find a `protocols
protocols = imap
```
## Configure how to store emails
## Logging
By default, Dovecot logs to the syslog (`/var/log/messages`). It would be easier to monitor Dovecot if it logged to its
own log file, so we'll configure that at `/etc/dovecot/conf.d/10-logging.conf`:
```conf
log_path = /var/log/dovecot.log
```
The file also has various settings on logging verbosity you can configure. I set:
```conf
auth_verbose = yes
auth_debug = yes
mail_debug = yes
```
You should already have an `/etc/logrotate.d/dovecot` file. If not, create it with the following contents:
```logrotate
/var/log/dovecot*.log {
daily
missingok
copytruncate
rotate 7
compress
notifempty
sharedscripts
postrotate
/etc/init.d/dovecot --quiet --ifstarted reopen
endscript
}
```
## Configure IMAP and email storage
You probably want to use the Maildir format for storing emails, where each user's mail is stored at `~/Maildir` (this
can be set to another location if desired).