Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

forwarded mail is rejected by SMTP relay services #1278

Closed
memmerto opened this issue Sep 14, 2024 · 2 comments · May be fixed by #1279
Closed

forwarded mail is rejected by SMTP relay services #1278

memmerto opened this issue Sep 14, 2024 · 2 comments · May be fixed by #1279

Comments

@memmerto
Copy link

memmerto commented Sep 14, 2024

As a rule of thumb: before reporting an issue

  • see if it hasn't been reported (and possibly already been fixed) first
  • try with the git master

Describe the bug
When a SMTP relay service is configured on the host (eg, MailJet, DuoCircle), forwarded mails are rejected.
This is because the Dovecot LDA configuration does not rewrite the envelope sender, and the SMTP relay service rejects it because the envelope sender is not a permitted domain.

System information

  • Froxlor version: 2.2.1-1
  • Web server: N/A
  • DNS server: N/A
  • POP/IMAP server: Dovecot
  • SMTP server: postfix
  • FTP server: N/A
  • OS/Version: Ubuntu 22.04

To Reproduce
Steps to reproduce the behavior:

  1. Configure postfix using a SMTP relay service. (Example: set relayhost = [outbound.mailhop.org]:25 in master.cf)
  2. Setup an email forward. (Example: [email protected] -> [email protected])
  3. Attempt to send email to [email protected] from some other address. (Example: [email protected] -> [email protected])
  4. Relay host will reject email since it sees [email protected] -> [email protected] as envelope sender/receiver and rejects the mail since the envelope sender [email protected] is not configured with the service.

Expected behavior
I expect the relay host to accept the mail being forwarded.

Logfiles
See attached.

Additional context
The solution is to have dovecot rewrite the envelope sender.
Change master.cf from this:

dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -d ${recipient}

to this:

dovecot unix - n n - - pipe flags=DORhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${recipient}

The -f option rewrites the envelope sender, and the O flag adds an X-Original-To header. The original From: header is preserved.

Under this configuration, when a mail is forwarded, the SMTP relay service sees [email protected] -> [email protected] and accepts the email, since mydomain.com is configured with the SMTP relay service.

@memmerto
Copy link
Author

Server logs are attached.
froxlor1278.txt

@memmerto memmerto changed the title forwarded mail cannot traverse SMTP relay services forwarded mail is rejected by SMTP relay services Sep 14, 2024
@d00p
Copy link
Member

d00p commented Sep 18, 2024

How is this a froxlor bug? You've adjusted the postfix configuration ...you are free to adjust configs according to your needs. Froxlor tries to stay as close to the system default configs as possible

@d00p d00p closed this as not planned Won't fix, can't repro, duplicate, stale Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants