decke / smtprelay

Simple Golang SMTP relay/proxy server
MIT License
459 stars 110 forks source link

remote_sender Parameter not working as expected #134

Closed Cerothen closed 11 months ago

Cerothen commented 1 year ago
; Relay all mails to this SMTP servers.
; If not set, mails are discarded.
;
; Format:
;   protocol://[user[:password]@][netloc][:port][/remote_sender][?param1=value1&...]
;
;   protocol: smtp (unencrypted), smtps (TLS), starttls (STARTTLS)
;   user: Username for authentication
;   password: Password for authentication
;   remote_sender: Email address to use as FROM
;   params:
;     skipVerify: "true" or empty to prevent ssl verification of remote server's certificate
;     auth: "login" to use LOGIN authentication

remotes = starttls://donotreply@DOMAIN.TLD:PASSWORD@SMTP.DOMAIN.TLD:587/donotreply@DOMAIN.TLD

The above configuration should based on my understanding take the parameter remote_sender and rewrite any FROM portion of the request to use that email to the upstream provider. Instead it just rejects the SMTP request.

Oct 14 15:08:13  Mailbox unavailable. The server response was: 5.7.1 Submission not allowed for messages in which header from does not match MAIL FROM
decke commented 1 year ago

Rewriting the mails content is definitely out of scope. If you think you need this there will be other mail servers out there that are happy to modify your mail to your taste.

decke commented 1 year ago

As a side note. Most mail providers (Google, Zoho, ...) don't care what you write in the From header and will automatically rewrite the header themselves based on your authentication credentials.