1

Topic: Setting from header when forwarding mail.

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (1.4.2 MARIADB edition):
- Deployed with iRedMail Easy or the downloadable installer?
- Linux/BSD distribution name and version: Ubuntu 20.04.3 LTS
- Store mail accounts in which backend (MySQL):
- Web server (Nginx):
- Manage mail accounts with iRedAdmin-Pro? no
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

I am trying to forward mails using the roundcube webclient. Im sending the mails to account (example@mydomain.com) from an external gmail account(example@gmail.com).

I've set the forwarding rule to send the emails to a external address (example@hotmail.com)

If i send mail to my domain acc (example@mydomain.com) from an external address (example@*.com) it wont be forwarded.

It only works if the sender is *@mydomain.com.

Im using sendgrid as a relay and im getting the 550 error. How can I set example@mydomain.com as the sender address when im forwading mail? It seems like iredmail is using the original senders address in the from header.


Log:

Sep 22 14:03:51 mail postfix/smtp[4045]: SSL_connect:SSLv3/TLS read server certificate
Sep 22 14:03:51 mail postfix/smtp[4045]: SSL_connect:SSLv3/TLS read server key exchange
Sep 22 14:03:51 mail postfix/smtp[4045]: SSL_connect:SSLv3/TLS read server done
Sep 22 14:03:51 mail postfix/smtp[4045]: SSL_connect:SSLv3/TLS write client key exchange
Sep 22 14:03:51 mail postfix/smtp[4045]: SSL_connect:SSLv3/TLS write change cipher spec
Sep 22 14:03:51 mail postfix/smtp[4045]: SSL_connect:SSLv3/TLS write finished
Sep 22 14:03:51 mail postfix/smtp[4045]: SSL_connect:SSLv3/TLS write finished
Sep 22 14:03:51 mail postfix/smtp[4045]: SSL_connect:SSLv3/TLS read server session ticket
Sep 22 14:03:51 mail postfix/smtp[4045]: SSL_connect:SSLv3/TLS read change cipher spec
Sep 22 14:03:51 mail postfix/smtp[4045]: SSL_connect:SSLv3/TLS read finished
Sep 22 14:03:51 mail postfix/smtp[4045]: smtp.sendgrid.net[52.57.139.126]:587: subject_CN=*.smtp.sendgrid.net, issuer_CN=Go Daddy Secure Certificate Authority - G2, fingerprint=CC:F2:77:3A:02:A7:DE:69:FA:C5:34:00:8D:05:1E:DF, pkey_fingerprint=D0:A1:F5:87:DA:A4:A0:BE:20:1F:FD:AF:E7:07:19:06
Sep 22 14:03:51 mail postfix/smtp[4045]: Trusted TLS connection established to smtp.sendgrid.net[52.57.139.126]:587: TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)
Sep 22 14:03:51 mail postfix/smtp[4045]: 4MYH7q4qjvzCj2R: to=<examile@gmail.com>, relay=smtp.sendgrid.net[52.57.139.126]:587, delay=0.14, delays=0.01/0/0.02/0.11, dsn=5.0.0, status=bounced (host smtp.sendgrid.net[52.57.139.126] said: 550 The from address does not match a verified Sender Identity. Mail cannot be sent until this error is resolved. Visit sendgrid to see the Sender Identity requirements (in reply to end of DATA command))

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Setting from header when forwarding mail.

Sieve doesn't rewrite From: header while redirecting message, i'm afraid this is not easy to overcome on iRedMail side, please contact your vendor SendGrid to figure out another way.

3

Re: Setting from header when forwarding mail.

Replied too soon. Sieve has "editheader" and "deleteheader" action, you can use it to rewrite mail headers. FYI:
https://www.rfc-editor.org/rfc/rfc5293

BTW, don't forgot to also check with SendGrid to figure out other possible solutions.