Tuesday, October 31, 2023

Re: smtpd rcpt-to match

31.10.2023 11:47, kasak пишет:
> hello misc!
>
> I already wrote similar question to opensmtpd list, but nobody
> replied. Maybe there are more subscribers here.
>
> I cannot understand how rcpt-to match directive works!
>
> White trying to understand, I have simplified config to this ( i
> cropped listen lines ):
>
> action "tomailer" relay host 172.16.0.25 tls no-verify
> action "trap" maildir "/home/kasak/spam"
>
> match from any for rcpt-to "aapot@tvema.ru" action "trap"
> match from any for domain "tvema.ru" action "tomailer"
>
> the idea is to catch some emails to specific spoled address and to
> teach spam filter. But when I send test email there, smtpd reject it:
>
> smtp failed-command command="RCPT TO: <aapot@tvema.ru>" result="550
> Invalid recipient: <aapot@tvema.ru>"
>
> other mails, to other mailboxes successfully go to "tomailer".
>
> please help!
>
Suddenly I came up with the idea, that smtpd try to find local user
"aapot@tvema.ru" and does not find one!
So I created one more table with mapping spoiled address to local user.

And it worked!!!

So my action should be:

action "trap" maildir "/home/kasak/spam" virtual <virtualtrap>

And I have table "virtualtrap" with mapping like this:
aapot@tvema.ru kasak

Mission accomplished :)

Thank's all!

No comments:

Post a Comment