I want to achieve sendmail/postfix configuration as in smtp.yandex.ru to make error "503 5.5.4 send AUTH command first" occur after:
Code:
telnet localhost 25
EHLO test
MAIL FROM: user@hostname
503 5.5.4 send AUTH command first
OS: debian
I tryed to add in /etc/postfix/main.cf:
Code:
smtpd_sender_restrictions = reject_unauthenticated_sender_login_mismatch
and
Code:
smtpd_sender_restrictions = reject_sender_login_mismatch
"AUTH" command is working by demand. But the problem is "MAIL FROM:" command working without "AUTH" command too.
When I try "MAIL FROM" in telnet smtp.yandex.ru 25 then it's immediately giving error "503 5.5.4 send AUTH command first" and don't let me send message. This is what I want.
Or it is impossible anyway?
Somehow on the internet there is no information about that.
another example is gmail with error "530-5.7.0 Authentication Required" that I want:
Code:
220 smtp.gmail.com ESMTP g21-20020aa78755000000b006ead618c010sm2628214pfo.192 - gsmtp
ehlo test
250-smtp.gmail.com at your service, [202.126.90.176]
250-SIZE 35882577
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250 SMTPUTF8
MAIL FROM:username2@6b98331036c5
530-5.7.0 Authentication Required. For more information, go to
530 5.7.0 https://support.google.com/mail/?p=WantAuthError g21-20020aa78755000000b006ead618c010sm2628214pfo.192 - gsmtp