1

There is sendmail relay host for LAN/external users using AUTH or trusting local users, but there is a problem that sendmail accepts mail from trusted users addressed for non existing domains (non intentionally), like gmai@.cm which are written by mistake.

Flow is this: Auth user -> sendmail -> relay mail server

of course mail gets back from relay server with error that recipient domain does not exist, but I want to intercept this situation at sendmail with smart host.

sendmail config has important parameters:

dnl SMTP Auth
define(`confAUTH_OPTIONS',`A y')
include(`/etc/mail/sasl/sasl.m4')dnl

FEATURE(`no_default_msa')dnl
DAEMON_OPTIONS(`Family=inet,  Name=MTA-v4, Port=smtp, Addr=0.0.0.0')dnl
DAEMON_OPTIONS(`Family=inet,  Name=MSP-v4, Port=submission, Addr=0.0.0.0')dnl

define(`confPRIVACY_FLAGS',dnl
`needmailhelo,needexpnhelo,needvrfyhelo,restrictqrun,restrictexpand,nobodyreturn,authwarnings,noreceipts')dnl

FEATURE(`access_db')dnl

FEATURE(`use_cw_file')dnl
FEATURE(`always_add_domain')dnl
FEATURE(`virtusertable')dnl

define(`SMART_HOST',`smarthost.mydom.com')dnl
define(`conf_LOG_Level',`14')dnl

dnl # antispam
FEATURE(`dnsbl',`....

MAILER_DEFINITIONS
MAILER(`local')dnl
MAILER(`smtp')dnl

and it's important to mention, there is mimedefang filter with antivirus and spam-assasin.

How I can force sendmail to not relay bad recipient domain?

Arunas Bartisius
  • 669
  • 1
  • 6
  • 13
  • What's your definition a "bad recipient domain"? Sendmail already blocks mail from gmail@.cm with a `553 5.1.2 ... Invalid host name` response. – Mike B Jan 18 '16 at 23:00
  • @MikeB You are talking about email addresses in `MAIL FROM:`. He is talking about email addresses in `RCPT TO:`. – AnFi Jan 19 '16 at 15:26
  • yes, problem is that trusted user email is accepted for some reason without simple checks in case of smart host usage. – Arunas Bartisius Jan 20 '16 at 19:35

0 Answers0