Re: need help to solve route loop

2021-08-10 Thread Илья Коскин
Great! Thank's for clarifying! Now i see!
Thank you very much!

вт, 10 авг. 2021 г. в 18:53, Thomas Bohl :
>
> Hello,
>
>  > action "outbound" relay
>  >
>  > action "tomailer" relay host 172.16.2.5
>  >
> > match from local for local action "local_mail"
> > match from local for any action "outbound"
> >
> > match from any for domain "mydomain.here" action "tomailer"
> > match from src  for any action "outbound"
>
> The line "match from local for any action "outbound"" comes before
> "match from any for domain "mydomain.here" action "tomailer"".
>
> Therefore, locally send mails to "mydomain.here" go straight to relay,
> instead of 172.16.2.5. Relay uses the public MX record and lands on itself.
>
>
> > looks like this is a message from mailer-daemon with subject: Message
> > accepted for delivery
>
> "Message accepted" is not a mail subject. It just says that the
> receiving server accepted the mail.
>



Re: need help to solve route loop

2021-08-10 Thread Thomas Bohl

Hello,

> action "outbound" relay
>
> action "tomailer" relay host 172.16.2.5
>

match from local for local action "local_mail"
match from local for any action "outbound"

match from any for domain "mydomain.here" action "tomailer"
match from src  for any action "outbound"


The line "match from local for any action "outbound"" comes before 
"match from any for domain "mydomain.here" action "tomailer"".


Therefore, locally send mails to "mydomain.here" go straight to relay, 
instead of 172.16.2.5. Relay uses the public MX record and lands on itself.




looks like this is a message from mailer-daemon with subject: Message
accepted for delivery


"Message accepted" is not a mail subject. It just says that the 
receiving server accepted the mail.




need help to solve route loop

2021-08-10 Thread Илья Коскин
hello misc!
I need to configure opensmtpd to be a relay between local mail server and world.
Here is my conf:

pki gater cert "/etc/ssl/local.crt"
pki gater key "/etc/ssl/private/local.key"

filter "rspamd" proc-exec "filter-rspamd"
table mailer { 172.16.2.5 }

table aliases file:/etc/mail/aliases

listen on lo0
listen on egress tls pki tvema.ru hostname tvema.ru filter rspamd
listen on 172.16.0.1 tls pki gater filter rspamd

action "local_mail" mbox alias 
action "outbound" relay

action "tomailer" relay host 172.16.2.5

match from local for local action "local_mail"
match from local for any action "outbound"

match from any for domain "mydomain.here" action "tomailer"
match from src  for any action "outbound"

It mostly work, but sometimes server itself want to send mail to
users, and we have a loop:


Aug 10 16:33:12 gater smtpd[40569]: 33eeb7f6e2a67883 smtp message
msgid=b9e2ff2c size=1068255 nrcpt=1 proto=ESMTP
Aug 10 16:33:12 gater smtpd[40569]: 33eeb7f6e2a67883 smtp envelope
evpid=b9e2ff2c5a1938f6 from=<> to=
Aug 10 16:33:12 gater smtpd[40569]: 33eeb7f51e906746 mta delivery
evpid=cbb10abbe054c669 from=<> to= rcpt=<->
source="my.ip.he.re" relay="my.ip.he.re (mydomain.here)" delay=4s
result="Ok" stat="250 2.0.0 b9e2ff2c Message accepted for delivery"
Aug 10 16:33:14 gater smtpd[40569]: 33eeb7f6e2a67883 smtp message
msgid=70bc8e71 size=1069024 nrcpt=1 proto=ESMTP
Aug 10 16:33:14 gater smtpd[40569]: 33eeb7f6e2a67883 smtp envelope
evpid=70bc8e71318648d7 from=<> to=
Aug 10 16:33:14 gater smtpd[40569]: 33eeb7f51e906746 mta delivery
evpid=b9e2ff2c5a1938f6 from=<> to= rcpt=<->
source="my.ip.he.re" relay="my.ip.he.re (mydomain.here)" delay=3s
result="Ok" stat="250 2.0.0 70bc8e71 Message accepted for delivery"
Aug 10 16:33:16 gater smtpd[40569]: 33eeb7f6e2a67883 smtp message
msgid=16202305 size=1069793 nrcpt=1 proto=ESMTP
Aug 10 16:33:16 gater smtpd[40569]: 33eeb7f6e2a67883 smtp envelope
evpid=162023051dae4938 from=<> to=
Aug 10 16:33:16 gater smtpd[40569]: 33eeb7f51e906746 mta delivery
evpid=70bc8e71318648d7 from=<> to= rcpt=<->
source="my.ip.he.re" relay="my.ip.he.re (mydomain.here)" delay=3s
result="Ok" stat="250 2.0.0 16202305 Message accepted for delivery"
Aug 10 16:33:18 gater smtpd[40569]: warn: loop detected
Aug 10 16:33:18 gater smtpd[40569]: 33eeb7f6e2a67883 smtp
failed-command command="DATA" result="500 5.4.6 Routing loop detected:
Loop detected"
Aug 10 16:33:18 gater smtpd[40569]: 33eeb7f51e906746 mta delivery
evpid=162023051dae4938 from=<> to= rcpt=<->
source="my.ip.he.re" relay="my.ip.he.re (mydomain.here)" delay=3s
result="PermFail" stat="500 5.4.6 Routing loop detected: Loop
detected"
Aug 10 16:33:18 gater smtpd[50493]: warn: queue: no return path!
Aug 10 16:33:28 gater smtpd[40569]: 33eeb7f6e2a67883 smtp disconnected
reason=quit
Aug 10 16:33:28 gater smtpd[40569]: 33eeb7f51e906746 mta disconnected
reason=quit messages=98

looks like this is a message from mailer-daemon with subject: Message
accepted for delivery
How can i solve such type of loops?
Thank's in advance