Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@polarathene
Copy link
Member

@polarathene polarathene commented Feb 10, 2025

Description

I noticed the postmaster_address line looked odd in the Dockerfile, and that we actually run it properly in our startup scripts (it's been in scripts for over 5 years). That motivated this PR.

The protocol line was likewise migrated to be grouped with the related script lines with some minor revision.

The other 3 lines from the Dockerfile were all LDA specific which we haven't used since prior to DMS v2 (2016?), actually no I think we switched from Courier to Dovecot for v2, and then there was a switch from LDA to LMTP when around when LDAP support was contributed (2016H2 or 2017 IIRC, EDIT: LDA to LMTP in Oct 2016). Anyway LDA is still technically relevant for supporting Getmail at least I think, and anything else that might call /usr/lib/dovecot/deliver to give mail to Dovecot directly.

I've included some extensive commentary inline since these settings at least for hostname and postmaster_address don't seem to be specific to LDA, that's just where they were placed in the Dovecot example configs we've copied. Dovecot 2.4 has removed those, so this will at least keep awareness of the original source until a maintainer/contributor addresses the TODO and we've migrated to 2.4 in a future base image update.

No changelog entry as this did not seem like a change that is user facing, it's effectively just shifting some commands around. I have altered the sed expressions into what should be easier to grok, along with only doing a single write/update to the file. I've manually tested the sed command to ensure it still works as intended 👍

@polarathene
Copy link
Member Author

polarathene commented Feb 10, 2025

Additional context.

I've also removed the quote wrapping around the value of hostname in 15-lda.conf, I don't think that was necessary / intentional.

postmaster_address

postmaster_address is technically related to #3769

mail_plugins appending sieve - LDA vs LMTP protocol config blocks

mail_plugins with sieve being hard-coded was introduced with original sieve support: #166 (comment)

/etc/dovecot/conf.d/15-lda.conf is provided from the dovecot package install, while we're replacing the 20-lmtp.conf with our own copy when DMS Dovecot was switched to LMTP.

This is the content as of debian:12-slim image with dovecot-lmtpd package installed:

##
## LMTP specific settings
##

# Support proxying to other LMTP/SMTP servers by performing passdb lookups.
#lmtp_proxy = no

# When recipient address includes the detail (e.g. user+detail), try to save
# the mail to the detail mailbox. See also recipient_delimiter and
# lda_mailbox_autocreate settings.
#lmtp_save_to_detail_mailbox = no

# Verify quota before replying to RCPT TO. This adds a small overhead.
#lmtp_rcpt_check_quota = no

# Add "Received:" header to mails delivered.
#lmtp_add_received_header = yes

# Which recipient address to use for Delivered-To: header and Received:
# header. The default is "final", which is the same as the one given to
# RCPT TO command. "original" uses the address given in RCPT TO's ORCPT
# parameter, "none" uses nothing. Note that "none" is currently always used
# when a mail has multiple recipients.
#lmtp_hdr_delivery_address = final

# Workarounds for various client bugs:
#   whitespace-before-path:
#     Allow one or more spaces or tabs between `MAIL FROM:' and path and between
#     `RCPT TO:' and path.
#   mailbox-for-path:
#     Allow using bare Mailbox syntax (i.e., without <...>) instead of full path
#     syntax.
#
# The list is space-separated.
#lmtp_client_workarounds =

protocol lmtp {
  # Space separated list of plugins to load (default is global mail_plugins).
  #mail_plugins = $mail_plugins
}

The only difference is we change the mail_plugins line (config reference as of DMS v14).

Some of the other settings may have relevance to support/document, but we could delete our outdated git copy of this config and apply the same mail_plugins change as this PR does with LDA.

I'm not sure if a future 2.4 Dovecot package in debian will affect these configs, or if Debian/Dovecot will continue to supply them as defaults to /etc/dovecot/conf.d 🤷‍♂️

@polarathene polarathene self-assigned this Feb 10, 2025
@polarathene polarathene added service/dovecot area/scripts kind/improvement Improve an existing feature, configuration file or the documentation labels Feb 10, 2025
@polarathene polarathene added this to the v15.0.0 milestone Feb 10, 2025
@georglauterbach
Copy link
Member

This was opened against the v15.0.0 milestone. Do you think you can cram this in? It is probably fine because we are waiting on the ClamAV CVE fix, right?

@polarathene
Copy link
Member Author

Do you think you can cram this in? It is probably fine because we are waiting on the ClamAV CVE fix, right?

Yeah this change should be fairly minor. There's no rush to get this change in, just a drive-by improvement while I was looking into something else.

I can add a changelog entry if you like, but logically nothing should have really changed, just shifting around the same logic and improving the sed expression. Although hostname will no longer quote the value, but I don't think it should have been to begin with.

@polarathene polarathene merged commit 83bfe72 into master Feb 11, 2025
7 checks passed
@polarathene polarathene deleted the chore/migrate-dockerfile-dovecot-modifications branch February 11, 2025 22:56
@polarathene polarathene mentioned this pull request Feb 11, 2025
53 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/scripts kind/improvement Improve an existing feature, configuration file or the documentation service/dovecot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants