How can DMS include a X-Original-To
header (to support BCC when using DMS as a cache/proxy?)
#4056
-
I'm using a docker-mailserver as a sort of "cache/proxy" mailserver. This is running fine on a VPS that I hired somewhere. I use it for sending email, and for receiving it (and temporarily holding is). It is configured with a catchall account, and appropriate alias so that all email for a single domain end up in 1 account. My other mailserver (which runs at home) uses fetchmail to retrieve those emails, and process them. I have multiple users there, with aliases, (and also an alias set up with the same name as the user). This setup works great for emails with the user in either TO or in CC. However, for BCC this fails, and never gets delivered. The problem is, that the "caching" mailserver does not add the postfix's "X-Original-To" (which makes sense for an normal mailserver, as you would want the BCC stripped there, being the whole point of a BCC of course). I know there is a flag that can be used by postfix to still add the "X-Original-To" header when delivering mail to the final mailbox. Syntax for that would be something like this:
Specifically the 'O' flag is what is needed. Current configuration works a bit different, and doesnt use deliver, so it's not a matter of adding that O flag at the moment. Anybody has any idea whether or not this is yet possible (or would be easy to "patch") for docker-mailserver? My other alternative would be adding the same users and aliases to the cache server, but I would prefer to avoid that :-). |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Please note that this response was created using generative AI, leveraging previously available information from the repository. This information may be helpful. However, it is our strong recommendation that you carefully consider the information before blindly applying it. This response is generated only once - you will not be able to interact with the glime-ai. To address the issue of BCC emails not being delivered due to the absence of the "X-Original-To" header, you can configure Postfix to add this header. This can be achieved by modifying the Postfix configuration to include the necessary flag. Here is a step-by-step guide to achieve this:
This configuration will ensure that the For more detailed information on using This comment was generated by Glime. |
Beta Was this translation helpful? Give feedback.
-
I don't have time to review the past discussion on a related topic, but I did investigate this previously and provide insights + solution for enabling what you want (along with caveats to account for): https://github.com/orgs/docker-mailserver/discussions/3898 As the highlighted answer there notes, we need to sequentially deliver mail per recipient rather than delegating that for Dovecot to handle. That will allow the header you want to have added when used in combination with the additional flag. Rather than calling the Dovecot deliver executable like your example shows, DMS uses LMTP to integrate with Dovecot. That should still be fine for your requirements AFAIK. So try this #!/bin/bash
# Required for the Postfix to send with original recipient headers for Sieve to use:
# Change from default limit of 50 to 1,
# Postfix will send mail with multiple recipients to Dovecot one at a time
# instead of delegating to Dovecot to manage all at once:
postconf lmtp_destination_recipient_limit=1
# Modify the `lmtp` service to use the `lmtp` transport command with extra `flags=DO` arg:
# This will enable both `Delivered-To:` and `X-Original-To` headers for Sieve to have access:
postconf -F 'lmtp/unix/command=lmtp flags=DO' I've not reviewed anything else in the linked discussion, if that doesn't resolve it for you skim through the rest of the discussion and it might help you troubleshoot 👍 |
Beta Was this translation helpful? Give feedback.
I don't have time to review the past discussion on a related topic, but I did investigate this previously and provide insights + solution for enabling what you want (along with caveats to account for): https://github.com/orgs/docker-mailserver/discussions/3898
As the highlighted answer there notes, we need to sequentially deliver mail per recipient rather than delegating that for Dovecot to handle. That will allow the header you want to have added when used in combination with the additional flag.
Rather than calling the Dovecot deliver executable like your example shows, DMS uses LMTP to integrate with Dovecot. That should still be fine for your requirements AFAIK.
So try this
user-patch…