Hello,
I am using a opensmtpd 7.3.0 instance to collect and forward email from my
domains toward a gmail account.

My stripped down config is:


    table aliases { [email protected] }
    table addresses { "test[-+]?[0-9]*@mydomain\.net" }
    table forwardedrecipients { [email protected] }

    pki "mydomain.net" cert "/etc/letsencrypt/live/mydomain.net/fullchain.pem"
    pki "mydomain.net" key "/etc/letsencrypt/live/mydomain.net/privkey.pem"

    srs key "Ku2PP9TZm3DtWS+fak7wQNu6mPiLpV6aRyuUF7uq"

    filter   "rdns" phase connect match   !rdns disconnect "550 DNS error"
    filter "fcrdns" phase connect match !fcrdns disconnect "550 DNS error"
    filter "rspamd" proc-exec "/usr/libexec/opensmtpd/filter-rspamd"

    listen on eth0 port 25 tls pki "mydomain.net" filter { "rdns",
"fcrdns", "rspamd" }

    action "relay" relay srs
    action "aliasedrelay" forward-only virtual <aliases>

    match from any for rcpt-to regex <addresses> action "aliasedrelay"
    match from local for any action "relay"

in this example I am catching (rather trying to catch) everything
toward test*@mydomain.net and forward that to mynicefake gmail
mailbox.

My previous regex was "test(\+[a-zA-Z0-9_.-]*)?@mydomain\.net",
mimicking Gmail's `user+tag@` feature.
Now I am trying to expand that to allow dash and to use arbitrary
characters after, I am using 0-9 for the tests, once it work I'll add
the alphas.

The config I pasted works fine for messages addressed to   test+123
@mydomain.net or  test @mydomain.net  but fails if I use a dash in
place of plus sign, or remove the sign at all, in that case I get

    result="524 5.2.4 Mailing list expansion problem: <[email protected]>"

whereas using the plus sign I get a nice SRS forwarding.

I am attaching config and logs since Gmail's web is breaking line length.


What is wrong in my config?

What's so special about the plus sign?


Thanks in advance

--
A.
smtpd[6772]: db51e4133f65f49f smtp connected address=[2607:f8b0:4864:20::c35] 
host=mail-oo1-xc35.google.com
smtpd[6772]: db51e4133f65f49f smtp tls 
ciphers=TLSv1.3:TLS_AES_256_GCM_SHA384:256
smtpd[6772]: db51e4133f65f49f smtp message msgid=affcaaa4 size=2974 nrcpt=1 
proto=ESMTP
smtpd[6772]: db51e4133f65f49f smtp envelope evpid=affcaaa4692d46b7 
from=<[email protected]> to=<[email protected]>
smtpd[6772]: db51e4133f65f49f smtp disconnected reason=quit
smtpd[6772]: db51e416f1509d2a mta connecting address=smtp://108.177.14.26:25 
host=lt-in-f26.1e100.net
smtpd[6772]: db51e416f1509d2a mta connected
smtpd[6772]: db51e416f1509d2a mta tls ciphers=TLSv1.3:TLS_AES_256_GCM_SHA384:256
smtpd[6772]: db51e416f1509d2a mta cert-check result="unverified" 
fingerprint="SHA256:1246e4d0564031a61ebaba03e13b9c0f1c0cb3f98d7154ada99ba8e2bd7de11f"
smtpd[6772]: db51e416f1509d2a mta delivery evpid=affcaaa4692d46b7 
from=<[email protected]> 
to=<[email protected]> rcpt=<[email protected]> 
source="211.14.87.213" relay="108.177.14.26 (lt-in-f26.1e100.net)" delay=1s 
result="Ok" stat="250 2.0.0 OK  1688856263 
u7-20020ac243c7000000b004f608ac6577si1979799lfl.506 - gsmtp"
smtpd[6772]: db51e416f1509d2a mta disconnected reason=quit messages=1

smtpd[6772]: db51e4174fed0c57 smtp connected address=[2607:f8b0:4864:20::22e] 
host=mail-oi1-x22e.google.com
smtpd[6772]: db51e4174fed0c57 smtp tls 
ciphers=TLSv1.3:TLS_AES_256_GCM_SHA384:256
smtpd[6772]: db51e4174fed0c57 smtp message msgid=4d0a33cd size=2988 nrcpt=1 
proto=ESMTP
smtpd[6772]: db51e4174fed0c57 smtp envelope evpid=4d0a33cdd5dd62bb 
from=<[email protected]> to=<[email protected]>
smtpd[6772]: db51e4174fed0c57 smtp disconnected reason=quit
smtpd[6772]: db51e41a84538cca mta connecting address=smtp://108.177.14.26:25 
host=lt-in-f26.1e100.net
smtpd[6772]: db51e41a84538cca mta connected
smtpd[6772]: db51e41a84538cca mta tls ciphers=TLSv1.3:TLS_AES_256_GCM_SHA384:256
smtpd[6772]: db51e41a84538cca mta cert-check result="unverified" 
fingerprint="SHA256:1246e4d0564031a61ebaba03e13b9c0f1c0cb3f98d7154ada99ba8e2bd7de11f"
smtpd[6772]: db51e41a84538cca mta delivery evpid=4d0a33cdd5dd62bb 
from=<[email protected]> 
to=<[email protected]> rcpt=<[email protected]> 
source="211.14.87.213" relay="108.177.14.26 (lt-in-f26.1e100.net)" delay=2s 
result="Ok" stat="250 2.0.0 OK  1688856276 
a6-20020a2e9806000000b002b6dee1e1d7si2191676ljj.629 - gsmtp"
smtpd[6772]: db51e41a84538cca mta disconnected reason=quit messages=1

smtpd[6772]: db51e41b68dd60e7 smtp connected address=[2607:f8b0:4864:20::235] 
host=mail-oi1-x235.google.com
smtpd[6772]: db51e41b68dd60e7 smtp tls 
ciphers=TLSv1.3:TLS_AES_256_GCM_SHA384:256
smtpd[6772]: db51e41b68dd60e7 smtp failed-command command="RCPT 
TO:<[email protected]>" result="524 5.2.4 Mailing list expansion problem: 
<[email protected]>"
smtpd[6772]: db51e41b68dd60e7 smtp disconnected reason=quit

smtpd[6772]: db51e41c78ae0f06 smtp connected address=[2607:f8b0:4864:20::32f] 
host=mail-ot1-x32f.google.com
smtpd[6772]: db51e41c78ae0f06 smtp tls 
ciphers=TLSv1.3:TLS_AES_256_GCM_SHA384:256
smtpd[6772]: db51e41c78ae0f06 smtp failed-command command="RCPT 
TO:<[email protected]>" result="524 5.2.4 Mailing list expansion problem: 
<[email protected]>"
smtpd[6772]: db51e41c78ae0f06 smtp disconnected reason=quit

Attachment: smtpd.conf
Description: Binary data

Reply via email to