In the last post, we examined the principle of how Dovecot works with Postfix.

Now, let's look at how Dovecot is configured and what the structure of the configuration files is.

๐ŸŽฏ Key Points of This Article

  • The structure of Dovecot configuration files
  • The role of the main configuration file dovecot.conf and detailed configuration files
  • Why the settings are separated into multiple files (structural reasons)
  • The principle of loading configuration files using !include
  • The order and priority of applying configuration files (this is very important!)

๐Ÿ“Œ Dovecot Configuration File Structure

The Dovecot configuration files are located in the /etc/dovecot/ directory and have the following structure.

/etc/dovecot/
โ”‚โ”€โ”€ dovecot.conf            # Main configuration file for Dovecot
โ”‚โ”€โ”€ conf.d/                 # Directory containing detailed configuration files
โ”‚   โ”œโ”€โ”€ 10-auth.conf        # User authentication related settings
โ”‚   โ”œโ”€โ”€ 10-mail.conf        # Mail storage (Mailbox) related settings
โ”‚   โ”œโ”€โ”€ 10-master.conf      # Service process and port related settings
โ”‚   โ”œโ”€โ”€ 10-ssl.conf         # SSL/TLS related settings
โ”‚   โ”œโ”€โ”€ 15-lda.conf         # Local mail delivery (Mailbox delivery) related settings
โ”‚   โ”œโ”€โ”€ 20-lmtp.conf        # LMTP protocol related settings (in conjunction with Postfix)
โ”‚   โ”œโ”€โ”€ 90-plugin.conf      # Dovecot plugin related settings
โ”‚   โ”œโ”€โ”€ 90-quota.conf       # Mail quota limit settings
โ”‚   โ”œโ”€โ”€ 90-sieve.conf       # Sieve mail filtering settings
โ”‚โ”€โ”€ dovecot-sql.conf.ext    # Configuration for SQL integration in virtual user (DB) environment
โ”‚โ”€โ”€ dovecot-dict-sql.conf.ext  # SQL settings needed when using Dict like Quota

Overview of Dovecot Configuration File Structure

Dovecot Configuration Structure

1๏ธโƒฃย dovecot.conf (Main Configuration File)

dovecot.conf is the main configuration file for Dovecot, managing the overall settings.

Individual configuration files are included here using !include syntax. While you can write settings directly here, most detailed configurations are managed in separate files under conf.d/.

# /etc/dovecot/dovecot.conf
disable_plaintext_auth = yes
ssl = required

# Load individual configuration files
!include conf.d/*.conf

Important note!

  • !include conf.d/*.conf โ†’ conf.d/ directory loads all .conf files in order.
  • Therefore, the order of applying configuration files is important (this will be explained later!).

2๏ธโƒฃ conf.d/ Directory (Detailed Configuration Files)

Dovecot's detailed configuration files are separated by functionality and logically divided, making maintenance easier.

๐Ÿ“Œ Essential Configuration Files (The following 4 files are considered essential detailed configuration files.)

File Name Description
10-auth.conf User authentication related settings
10-mail.conf Mailbox path and mail storage settings
10-master.conf Service process settings that Dovecot runs (IMAP, POP3, LMTP, etc.)
10-ssl.conf TLS/SSL encryption settings

๐Ÿ”น Why separate the configuration files?

  • ย Ease of managementย โ†’ Settings can be divided by functionality, allowing for only necessary parts to be modified.
  • Provides flexibilityย โ†’ Specific settings can be easily activated/deactivated.
  • Ease of version updates and maintenanceย โ†’ Only specific configuration files can be replaced when Dovecot is updated.

By being separated like this,
activating only the necessary functions or modulating specific settings becomes much more convenient.

๐Ÿ”น Principle of Applying Configuration Files (!include Syntax)

When loading individual configuration files from dovecot.conf, !include is used to apply the settings.

# /etc/dovecot/dovecot.conf
!include conf.d/*.conf

Why the order of loading configuration files is important

  • Configuration files in conf.d/ are executed in numerical order.
  • This means the contents set in 10-ssl.conf can be overwritten in 99-custom.conf.
  • It's important to arrange configuration files considering priority.

Conclusion: Understanding Dovecot Configuration Files Allows for More Powerful Customization!

  • Dovecot loads configuration files from conf.d/ directory in dovecot.conf using !include syntax.
  • Configuration files in conf.d/ are executed in numerical order, so the filenames are important.
  • ย The design of separating settings into multiple files enables convenience in management and ease of maintenance.
  • ย To overwrite specific settings, you just need to set the filename with a larger number to ensure it runs later.

๐Ÿš€ Next Episode Preview

In this article, we explored the structure and application method of Dovecot's configuration files.

However, since there are too many configuration files, trying to understand all of them at once can be overwhelming.

Therefore, in the next episode, we will be focusing on the essential core configuration files needed to operate Dovecot.

๐Ÿ“Œ Core configuration files to be covered in the next episode

  • 10-auth.conf โ†’ User authentication related settings
  • 10-mail.conf โ†’ Mailbox path and mail storage settings
  • 10-master.conf โ†’ Service process settings that Dovecot runs (IMAP, POP3, LMTP, etc.)
  • 10-ssl.conf โ†’ TLS/SSL encryption settings

Understanding just these settings will allow you to operate a mail server without issues.

The remaining configuration files are used to adjust additional functions, so it's more efficient to study them gradually after starting operations.

In the next episode, we will analyze these 4 essential configuration files one by one and see how the settings are actually applied.

See you in the next post! ๐Ÿš€๐Ÿ˜Š