mirror of
https://github.com/axllent/mailpit.git
synced 2026-04-26 00:35:51 +03:00
[GH-ISSUE #484] Automatic relaying of messages to specific receipiants not working #318
Labels
No labels
awaiting feedback
bug
docker
documentation
enhancement
github_actions
invalid
pull-request
question
stale
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/mailpit#318
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @vendion on GitHub (Apr 28, 2025).
Original GitHub issue: https://github.com/axllent/mailpit/issues/484
Using mailpit v1.24.1 I have SMTP relay setup and can manually release messages and they get successfully delivered. The problem is I want to configure mailpit's automatic relay based on the recipient, I have the
MP_SMTP_RELAY_MATCHINGenvironment variable configured and there is no warning in mailpit's logs. The problem is when mailpit receives a message to one or more of the configured addresses it doesn't automatically relay them.@axllent commented on GitHub (Apr 29, 2025):
Hi @vendion. Can you please confirm that Mailpit does in fact show that the relay and that the relay-matching is being detected properly? You should get something like this when you start Mailpit in the logs:
@vendion commented on GitHub (May 2, 2025):
On startup, I only get the following:
I'm configuring it with the following environment variables defined via SystemD:
@axllent commented on GitHub (May 2, 2025):
I really don't understand why it doesn't work on your end, however I suspect it may have something to do with systemd. I note that there also isn't a log entry for the
MP_SMTP_RELAY_ALLOWED_RECIPIENTSso I suspect it has something to do with the single quotes within the double quotes.If I run manually the exact "same" command you're running it detects it fine:
So I'm pretty sure it has to do with the formatting in your systemd config, as neither of those two lines that include both
"and'are getting detected.Maybe try one of the following:
or maybe
@axllent commented on GitHub (May 2, 2025):
You could also look at using EnvironmentFile instead of Environment,
or alternatively passing the. Sorry, those two options can't be added as flags. You could however use a yaml config file instead.MP_SMTP_RELAY_ALLOWED_RECIPIENTSandMP_SMTP_RELAY_MATCHINGas command flags rather than environment variables in systemd.I hope this helps.
@vendion commented on GitHub (May 2, 2025):
Yeah, it seems moving the environment variables to a separate file loaded with
EnvironmentFileworked rather than just defining the variables directly in the SystemD service.Thanks for your help