Description
Describe the feature
Currently, forwardemail.net only supports forwarding to an email address in a different domain (the original envelope recipient is transformed to a different address). When forwarding, forwardemail.net does the usual MX lookup for the transformed destination domain and uses SMTP to send it to an appropriate server.
I want forwardemail.net to support a new operating mode: relaying. This is almost identical to forwarding, with the following differences:
- The envelope recipient is unchanged.
- Instead of performing an MX lookup on the recipient domain to find the next hop (which would cause a routing loop to itself because the envelope recipient is unchanged), forwardemail.net would use an explicitly configured server as the next hop.
- As a configurable option, forwardemail.net would use RFC 6409 message submission to port 587 or 465 instead of the usual SMTP to port 25.
- Ideally, forwardemail.net would use the Postfix
XFORWARD
command when relaying a message (assuming the destination server advertises support).
I believe this feature request is a duplicate of forwardemail/free-email-forwarding#284 which has been archived.
Example
outgoingsmtp.sender.example
→mx1.forwardemail.net
:MAIL FROM:<[email protected]>
RCPT TO:<[email protected]>
mx1.forwardemail.net
→receivingsmtp.recipient.example:587
STARTTLS
AUTH PLAIN <base64>
XFORWARD
(optional, but preferred)MAIL FROM:<[email protected]>
RCPT TO:<[email protected]>
The above can be achieved in Postfix with a configuration that includes something like the following in main.cf
:
relay_domains = recipient.example
transport_maps = inline:{
recipient.example=relay:[receivingsmtp.recipient.example]:submission
}
smtp_tls_policy_maps = inline:{
[receivingsmtp.recipient.example]:submission=verify
}
smtp_sasl_password_maps = inline:{
[receivingsmtp.recipient.example]:submission=username:password
}
smtp_send_xforward_command = yes
Motivation
This feature would make it possible to adopt forwardemail.net as a drop-in frontend for an existing MX setup. All a new customer would need to do is:
- Sign up for forwardemail.net
- Tell forwardemail.net to relay
recipient.example
emails to the existingreceivingsmtp.recipient.example:25
server - Optionally tell forwardemail.net to relay via submission as an authenticated user:
- Create a submission-only account called
forwardemail
onreceivingsmtp.recipient.example
- Configure
receivingsmtp.recipient.example
to listen on port 587 (submission) - Update the forwardemail.net configuration to relay to
receivingsmtp.recipient.example:587
with usernameforwardemail
and the appropriate password
- Create a submission-only account called
- Configure
receivingsmtp.recipient.example
to accept emails from forwardemail.net's mail servers (SRS should make this a no-op) - Optionally set up outgoing email from
*@recipient.example
to relay through forwardemail.net - Change MX records for
recipient.example
to return forwardemail.net's MX servers - Update SPF records if necessary
Checklist
- I have searched through GitHub issues for similar issues.
- I have completely read through the README and documentation.