Server is running sendmail 8.14

From any machine:

$ telnet mydomain.com 25
HELO mydomain.com
MAIL FROM: <me@mydomain.com>
RCPT TO: <me@mydomain.com>
this is spam

How do I require authentication for any mail that claims to be from a local domain?

This seems like a no-brainer anti-spam feature.

FROM         TO           RESULT
any          non-local    "Relaying denied. Proper authentication required."
non-local    local        success [1]
local        local        success [2]

[1] This is acceptable. Outsiders can send to local users without any kind of authentication. Various DNS checks can be done.

[2] This is the problem. Why should I allow anyone to mail a local user while claiming to be a local user?

  • Similar question with no solution. – Marco Jan 29 '13 at 22:29
  • They're not claiming to "be a local user". They're claiming to have mail from a local user. What kind of "authentication" are you thinking of? – David Schwartz Jan 29 '13 at 23:17
  • When would that not be the same thing? The only place where mail-from-a-local-domain is going to originate is my server (via user's SMTP client). – Marco Jan 29 '13 at 23:45
  • Okay, so say it originated a local user's SMTP client. Now whatever agent has it is is delivering it to its final destination, your mail server. – David Schwartz Jan 29 '13 at 23:55
  • Er, what agent? When a user sends mail, there is a direct port-25 TCP connection from their SMTP client to my server. If the destination email address is local (and valid), the mail is moved to the appropriate local inbox. – Marco Jan 30 '13 at 0:39

As noted here:

You can require the use of SMTP AUTH for relaying by simply turning off other means of relaying for incoming mail, e.g., the access map or class R. That is, if you have my.domain in /etc/mail/relay-domains or "my.domain RELAY" in the access map, then remove the entry from class R (/etc/mail/relay-domains) and use "To:my.domain RELAY" in the access map.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.