Hello,
I would like to receive messages for a specific mailbox on a domain
and relay those to a Gmail account.
I scame up with the following config (this is an SSCCE):
table aliases { [email protected] }
table recipients { [email protected] }
table forwardedrecipients { [email protected] }
table domains { "@mydomain.invalid" }
table external-relays { ".*\.verybestsmtpservice\.com" }
listen on eth0
action "relay" relay helo myhost.mydomain.invalid
action "aliasedrelay" forward-only virtual <aliases>
match from local for rcpt-to <forwardedrecipients> action "relay"
match from any for rcpt-to regex <recipients> action "aliasedrelay"
With this config running I got a SPAM message from
<[email protected]> to <[email protected]>.
I realize this is because I am accepting and relaying any message to
my listed address, I am not checking that the sender is not one of my
addresses.
Since I have an external SMTP service I added a line to reject emails
from spoofed addresses, like the one I received, but allowing those
from my SMTP service toward aliases:
match !from rdns regex <external-relays> mail-from <domains> for any reject
Now for the question, is a config like:
table aliases { [email protected] }
table recipients { [email protected] }
table forwardedrecipients { [email protected] }
table domains { "@mydomain.invalid" }
table external-relays { ".*\.verybestsmtpservice\.com" }
listen on eth0
action "relay" relay helo myhost.mydomain.invalid
action "aliasedrelay" forward-only virtual <aliases>
match from local for rcpt-to <forwardedrecipients> action "relay"
match !from rdns regex <external-relays> mail-from <domains> for any reject
match from any for rcpt-to regex <recipients> action "aliasedrelay"
enough for my intended goal, or is there some corner case I am not
thinking about?
Best regards
--
Andrea D'Amore