DBMAIL.CONF(5)

NAME
dbmail.conf - configuration file for DBMail Message Delivery Agent.

SYNOPSIS

There are 8 sections: DBMAIL, SMTP, LMTP, POP, IMAP, SIEVE, LDAP, DELIVERY. The default config file has documentation for all settings.

DESCRIPTION

    # Configuration file for DBMAIL
     #
     # Copyright (c) 2000-2006 IC&S, The Netherlands
     # Copyright (c) 2004-2013 NFG Net Facilities Group BV support@nfg.nl
     # Copyright (c) 2014-2019 Paul J Stevens, The Netherlands, support@nfg.nl
     # Copyright (c) 2020-2026 Alan Hicks, Persistent Objects Ltd support@p-o.co.uk
     #
     [DBMAIL]
     ###################
     # Database settings
     #
     # database connection URI
     #
     # The format is as follows
     # database://[user:password@][host][:port]/database[?name=value][&name=value]...
     #
     # You probably want one of the following:
     # dburi = mysql://user:password@db.example.com:3306/dbmail
     # dburi = postgresql://user:password@db.example.com:5432/dbmail
     dburi                = sqlite:///var/tmp/dbmail.db
     # Authentication and email address lookup
     #
     # Supported drivers are sql and ldap
     #
     # The openldap client supports many ldap servers including
     # OpenLDAP and Microsoft Active Directory
     #
     # If you choose ldap, please configure [LDAP]
     authdriver           = sql
     #
     # Number of database connections per threaded daemon
     # This also determines the size of the worker threadpool
     #
     # Do NOT increase this without proper consideration. A
     # very large database/worker pool will not only increase
     # the connection pressure on the database, but will more
     # significantly cause unnecessary context-switching in
     # your CPUs.
     #
     #max_db_connections   = 10
     #
     # Table prefix. Defaults to "dbmail_" if not specified.
     #
     table_prefix         = dbmail_
     ###################
     # Network
     #
     # The IPv4 and/or IPv6 addresses the services will bind to.
     # Use * for all local interfaces.
     # Use 127.0.0.1 for localhost only.
     # Separate multiple entries with spaces ( ) or commas (,).
     #
     bindip                = 0.0.0.0		# IPv4 only - all IP's
     #bindip                = ::		# IPv4 and IPv6 - all IP's (linux)
     #bindip                = ::		# IPv6 only - all IP's (BSD)
     #bindip                = 0.0.0.0,::	# IPv4 and IPv6 - all IP's (BSD)
     #
     # The maximum length of the queue of pending connections. See
     # listen(2) for more information
     #
     # backlog              = 128
     #
     # Idle time allowed before a connection is shut off.
     #
     timeout               = 300
     #
     # Idle time allowed before a connection is shut off if you have not logged in yet.
     #
     login_timeout         = 60
     #
     # If yes, resolves IP addresses to DNS names when logging.
     #
     resolve_ip            = no
     #
     # If yes, allow multiple loadbalanced dbmail processes on the same port.
     #
     reuseport = no
     ###################
     # TLS Transport Layer Security
     #
     # SSL/TLS certificates
     #
     # A file containing a list of CAs in PEM format
     tls_cafile            =
     # A file containing your certificate in PEM format
     tls_cert              =
     # A file containing your ECDSA or RSA key in PEM format
     tls_key               =
     # A cipher list string in the format given in openssl-ciphers(1)
     # Leave blank for openssl defaults
     tls_ciphers           =
     ###################
     # Message encoding
     #
     # encoding must match the database/table encoding.
     # i.e. latin1, utf8
     encoding             = utf8
     #
     # messages with unknown encoding will be assumed to have
     # default_msg_encoding
     # i.e. iso8859-1, utf8
     default_msg_encoding = utf8
     #
     # Only valid emails are accepted
     # Set allow_invalid_messages to yes to add a mime header
     # allowing dbmail to store invalid messages
     allow_invalid_messages = no
     #
     # Postmaster's email address for use in bounce messages.
     #
     #postmaster           = DBMAIL-MAILER
     ###################
     # Sending emails
     #
     # Define mail_host to use smtp instead of sendmail
     # smtp_host = smtp://smtp.example.com:587
     #
     # smtp_host
     # smtp_user
     # smtp_password
     #
     # Sendmail executable for forwards, replies, notifies, vacations.
     # You may use pipes (|) in this command, for example:
     # dos2unix|/usr/sbin/sendmail  works well with Qmail.
     # You may use quotes (") for executables with unusual names.
     #
     sendmail              = /usr/sbin/sendmail
     ###################
     # Logging
     #
     # The following items can be overridden in the service-specific sections.
     #
     #
     # Logging goes to logfile and syslog using one of the following:
     # emergency, alert, critical, error, warning, notice, info, debug, database, nothing
     #
     file_logging_levels       = notice
     syslog_logging_levels     = warning
     #
     # Location and name of the logfile.  Set this to "stderr" if running
     # under docker or systemd, which expect to receive and handle log lines.
     #
     logfile               = /var/log/dbmail/dbmail.log
     #
     # If you need a specific logging level, numeric values are available:
     # Logging is broken up into 8 logging levels and each level can be
     # individually turned on or off.
     # The Stderr/log file logs all entries to stderr or the log file.
     # Syslog logging uses the facility mail and the logging level of the event for
     # logging.
     # Syslog can then be configured to log data according to the levels.
     #
     # Set the log level to the sum of the values next to the levels you want to record.
     #   1 = Emergency
     #   2 = Alert
     #   4 = Critical
     #   8 = Error
     #  16 = Warning
     #  32 = Notice
     #  64 = Info
     # 128 = Debug
     # 256 = Database -> Logs at debug level
     #
     # Examples:   0 = Nothing
     #            31 = Emergency + Alert + Critical + Error + Warning
     #           511 = Everything
     #
     #
     # Generate a log entry for database queries for the log level at number of
     # seconds of query execution time.
     #
     query_time_info       = 10
     query_time_notice     = 20
     query_time_warning    = 30
     #
     # Throw an exception is the query takes longer than query_timeout seconds
     query_timeout         = 300
     # Time in seconds to wait for a stopped connection pool before exiting (default: 90).
     # Keep this above the recoverable-reconnect worst case (~53s: db_connect succeeds on
     # the last retry after ~50s of backoff plus a 3s ping sleep) so a transient DB blip is
     # not turned into a process restart. An all-retries-fail stall (~78s) is unrecoverable,
     # so exiting past that point is the intended behavior. 90 clears both.
     connection_pool_timeout = 90
     ###################
     # Privileges
     #
     # Root privileges are used to open a port, then privileges
     # are dropped down to the user/group specified here.
     #
     effective_user        = nobody
     effective_group       = nobody
     ###################
     # Statistics
     #
     # If yes, keep statistics in the authlog table for connecting users
     #
     authlog               = no
     ###################
     # File locations
     #
     # directory for storing PID files
     #
     pid_directory         = /var/run/dbmail
     #
     # directory for locating libraries
     # (normally has a sane default compiled-in)
     #
     #library_directory       =
     ###################
     # Miscellaneous
     #
     # hashing algorithm. You can select your favorite hash type
     # for generating unique ids for message parts.
     #
     # for valid values check mhash(3) but minus the MHASH_ prefix.
     #
     # if you ever change this value run 'dbmail-util --rehash' to
     # update the hash for all mimeparts.
     #
     # examples: MD5, SHA1, SHA256, SHA512, TIGER, WHIRLPOOL
     #
     # hash_algorithm = SHA1
     # header_cache tuning
     #
     # set header_cache_readonly to 'yes' to prevent new
     # unknown header-names from being cached.
     #
     # header_cache_readonly = yes
     # message storing into database
     # in order to decrease storage, individual parts of the email are stored in such a way
     # that reduces the spaces
     # 0 = default behaviour, check hash, size and content
     # 1 = check  hash and size. starting from sha1 should be ok and having a hash having the same size has a low probability
     # 2 = do not check any, just insert, is the fatest but takes a lot of space.
     #message_part_hash = 0
     [LMTP]
     port                  = 24
     #tls_port              =
     [IMAP]
     # IMAP State Reload Strategy. Internally DBMail is loading various information
     # about the selected folders (flags, message ids, etc)
     # 1 = full reload (default)
     # 2 = diff reload (experimental)
     #   In some setups it might be beneficial to use it, due to the fact that
     #   reloading is done in differential mode, which may result in lower DB usage
     # mailbox_update_strategy = 1
     # IMAP Search strategy.
     # 1 = full sql search (default). All searches performed on the current folder
     #   are made via sql queries.
     # 2 = optimized search, use partial sql search  (experimental). Some searches
     #   will be made via loaded state of the current folder.
     #   In some setups it might be beneficial to use it, due to lower DB usage.
     # mailbox_search_strategy = 1
     # Only for IMAP Reload Strategy (mailbox_search_strategy = 2)
     # Might be beneficial to do a full reload after n iterations. Sometimes might
     # be beneficial to reload the full state reload.
     # -1 = no expiration
     #  x = number of iterations. If no mails are received (IDLE Server) those
     #    iterations can be transform in seconds
     #    mailbox_update_strategy_2_max_iterations * idle_timeout * idle_interval = s
     #
     # mailbox_update_strategy_2_max_iterations = 64
     # Allow reporting UNSEEN in SELECT command.
     # Although RFC 3501 does state it that is mandatory, missing it means that the
     # client need to issue a search for the unseen messages
     # 1 = allow UNSEEN in SELECT Command (default)
     # 0 = Do not Allow UNSEEN in SELECT Command
     # command_select_allow_unseen = 1
     # In some instances clients to issue a UID STORE xxxxx FLAGS.SILENT but need the flags afterwards (maybe an issue on their part, eg: Outlook)
     #
     # 0 = do not ignore .SILENT part and do not return flags on UID FETCH (default)
     # 1 = ignore .SILENT part and return FLAGS on next fetch (usually it helps witch the set read reverts back to unread until folder sync)
     #
     # command_store_flags_silent_ignore_silent = 0
     # Mailbox Sequence update strategy.
     # 1 = normal behaviour, transactional safe
     # 2 = non transaction, still safe, might be better in clustered environments
     # mailbox_update_seq_strategy = 1
     # Mailbox DELETE and message status synchronization.
     # In some instances messages marked as deleted are not having the status as deleted
     # 1 = normal do not sync
     # 2 = sync
     # mailbox_sync_deleted = 1
     # If mailbox_sync_deleted=2, size of the batch.
     # Due to the fact that this flag is making correction live, protection should
     # be put in place
     # mailbox_sync_batch_size = 64
     # You can set an alternate banner to display when connecting to the service
     # banner = imap 4r1 server (dbmail 3.4.x)
     #
     # Port to bind to.
     #
     port                  = 143
     #tls_port              = 993
     #
     # IMAP prefers a longer timeout than other services.
     #
     timeout               = 4000
     #
     # If yes, allows SMTP access from the host IP connecting by IMAP.
     # This requires addition configuration of your MTA
     #
     imap_before_smtp      = no
     #
     # during IDLE, how many seconds between checking the mailbox
     # status (default: 30)
     #
     # idle_timeout          = 30
     # during IDLE, how often should the server send an '* OK' still
     # here message (default: 10)
     #
     # the time between such a message is idle_timeout * idle_interval
     # seconds
     #
     # idle_interval         = 10
     #
     # If TLS is enabled, login before starttls is normally
     # not allowed. Use login_disabled=no to change this
     #
     # login_disabled        = yes
     #
     # There is support for AUTH=CRAM-MD5 in the code, but
     # the mechanism is officially deprecated, and you may
     # want to disable it, using enable_cram_md5=no here.
     #
     # enable_cram_md5       = yes
     #
     # Provide a CAPABILITY to override the default
     #
     # capability 		= IMAP4 IMAP4rev1 AUTH=LOGIN ACL RIGHTS=texk NAMESPACE CHILDREN SORT QUOTA THREAD=ORDEREDSUBJECT UNSELECT IDLE
     # max message size. You can specify the maximum message size
     # accepted by the IMAP daemon during APPEND commands.
     #
     # Supported formats:
     #  decimal: 1000000
     #  octal:   03777777
     #  hex:     0xfffff
     #
     # max_message_size      =
     [SIEVE]
     #
     # Port to bind to.
     #
     port                  = 4190
     [LDAP]
     # If your LDAP library supports ldap_initialize(), then you can use the
     # LDAP server DSN as follows:
     #
     # URI                 = ldap://127.0.0.1:389
     # URI                 = ldapi://%2fvar%2frun%2fopenldap%2fldapi/
     uri                   = ldap://example.com/
     # The following are available if you LDAP library doesn't support URIs
     #port                 = 389
     #version              = 3
     #hostnam              = ldap
     #base_dn              = ou=People,dc=example,dc=com
     #
     # Leave blank for anonymous bind.
     # example: cn=admin,dc=mydomain,dc=com
     #
     bind_dn               =
     #
     # Leave blank for anonymous bind.
     #
     bind_pw               =
     scope                 = SubTree
     # AD users may want to set this to 'no' to disable
     # ldap referrals if you are seeing 'Operations errors'
     # in your logs
     #
     referrals             = yes
     user_objectclass      = top,account,inetOrgPerson
     forw_objectclass      = top,account,dbmailUser
     cn_string             = uid
     field_passwd          = userPassword
     field_uid             = uid
     field_nid             = uidNumber
     min_nid               = 10000
     max_nid               = 15000
     field_cid             = gidNumber
     min_cid               = 10000
     max_cid               = 15000
     # a comma-separated list of attributes to match when searching
     # for users or forwards that match a delivery address. A match
     # on any of them is a hit.
     field_mail            = mail
     # field that holds the mail-quota size for a user.
     field_quota           = mailQuota
     # field that holds the forwarding address.
     field_fwdtarget       = mailForwardingAddress
     # override the query string used to search for users
     # or forwards with a delivery address.
     # query_string          = (mail=%s)
     [DELIVERY]
     #
     # Run Sieve scripts as messages are delivered.
     #
     SIEVE                 = yes
     #
     # Use 'user+mailbox@domain' format to deliver to a mailbox.
     #
     SUBADDRESS            = yes
     #
     # Turn on/off the Sieve Vacation extension.
     #
     SIEVE_VACATION        = yes
     #
     # Turn on/off the Sieve Notify extension
     #
     SIEVE_NOTIFY          = no
     #
     # Turn on/off additional Sieve debugging.
     #
     SIEVE_DEBUG           = no
     # Use the auto_notify table to send email notifications.
     #
     AUTO_NOTIFY           = no
     #
     # Use the auto_reply table to send away messages.
     #
     AUTO_REPLY            = no
     #
     # Defaults to "NEW MAIL NOTIFICATION"
     #
     #AUTO_NOTIFY_SUBJECT        =
     #
     # Defaults to POSTMASTER from the DBMAIL section.
     #
     #AUTO_NOTIFY_SENDER        =
     # If you set this to 'yes' dbmail will check for duplicate
     # messages in the relevant mailbox during delivery using
     # the Message-ID header
     #
     suppress_duplicates	= no
     #
     # Soft or hard bounce on over-quota delivery
     #
     quota_failure           = hard
     [POP]
     port                  = 110
     #tls_port              = 995
     # You can set an alternate banner to display when connecting to the service
     # banner = DBMAIL pop3 server ready to rock
     # If TLS is enabled, login before starttls is normally
     # allowed. Use login_disabled=yes to change this
     #
     # login_disabled        = no
     #
     # If yes, allows SMTP access from the host IP connecting by POP3.
     # This requires addition configuration of your MTA
     #
     pop_before_smtp       = no
     [HTTP]
     port                  = 41380
     #
     # the httpd daemon provides full access to all users, mailboxes
     # and messages. Be very careful with this one!
     bindip                = 127.0.0.1
     admin                 = admin:secret
     # end of configuration file

SEE ALSO

dbmail(1), dbmail.conf(5), dbmail-deliver(1), dbmail-export(8), dbmail-httpd(8), dbmail-imapd(8), dbmail-lmtpd(8), dbmail-pop3d(8), dbmail-sieved(8), dbmail-sievecmd(8), dbmail-users(8), dbmail-util(8)

BUGS

For the latest announcements, please subscribe to the DBMail announce mailing list[1]

For general discussion, please subscribe to the DBMail general mailing list[2]

If you experience an issue with DBMail, please report it on the DBMail Bug Tracker[3]. It may be helpful to have a debug log available.

LICENSE

DBMail and its components are distributed under the terms of the GNU General Public License Version 2. Copyrights are held variously by the authors listed below.

AUTHOR(S)

DBMail is a collaborative effort among the core developers listed below and the tremendous help of the testers, patchers and bug hunters listed in the AUTHORS and THANKS files found in the DBMail source distribution.

    Alan Hicks          Persistent Objects Ltd https://p-o.co.uk
    Eelco van Beek      Aaron Stone            Paul J Stevens
    Roel Rozendaal      Open Source Engineer   NFG Net Facilities Group BV
    Ilja Booij          Palo Alto, CA USA      http://www.nfg.nl
    IC&S                                       http://www.ic-s.nl

AUTHOR

Alan Hicks <ahicks@p-o.co.uk>
    Author.

NOTES

1.  DBMail announce mailing list
    https://dbmail.org/wws/info/dbmail-announce/

2.  DBMail general mailing list
    https://dbmail.org/wws/info/dbmail-general/

3.  DBMail Bug Tracker
    https://github.com/dbmail/dbmail/issues