Article 6M0KM How to configure local smtp server sendmail/postfix to occur error 503 5.5.4 send AUTH command first?

How to configure local smtp server sendmail/postfix to occur error 503 5.5.4 send AUTH command first?

by
dodoes
from LinuxQuestions.org on (#6M0KM)
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 firstOS: debian
I tryed to add in /etc/postfix/main.cf:Code:smtpd_sender_restrictions = reject_unauthenticated_sender_login_mismatchandCode: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.
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments