MBF Knowledge Base

I'm using Sendmail. How do I stop/avoid backscatter?

Your MX servers should reject email for unknown users at the SMTP initial transaction and NOT forward them to internal SMTP servers without a “user check”.

Step1: In MX SERVER, add these 4 lines to your “.mc” file in the right place:

FEATURE(access_db, hash -T<TMPF> /etc/mail/access)dnl
define(`VIRTUSER_TABLE’, `hash -o /etc/mail/virtusertable’)dnl

Step2: In MX SERVER,  put YOUR internal valid domains in /etc/mail/virtuserdomain
Step3: In MX SERVER, add these lines to your “access” file (/etc/mail/access):

#List of internal domains that have their own servers and you do not serve them. Your server only #receives email from them. Equal to “internal domains that you receive email via MX”
From:example.my.org         OK
From:example.example.com    OK

#check_mail <valid.user@example.com> –> ACCESS DENIED
From:example.com      REJECT
#check_mail <valid.user@my.org> –> ACCESS DENIED
From:my.org           REJECT

#General rejection strings

To:example.com     error:5.1.1:”550 User unknown”
To:my.org          error:5.1.1:”550 User unknown”

#List ALL valid internal EMAIL addresses. If not listed here, sender server will get a “550 User unknown

To:john.doe@example.com    RELAY
To:jane.joe@my.org         RELAY
To:postmaster@example.com  RELAY

Step4: In MX SERVER, regenerate your “sendmail.cf” and re-makemap your “access” database.

Step5: In MX SERVER, TEST the configuration using an external IP address (in this example mx.uchile.cl):$ /usr/lib/sendmail -bt -d21.4

#check_rcpt <user.notexist@example.com> should produce a —> “550 User unknown"