Centos – Postfix server block outgoing fake domain permit only one domain

centosemailpostfix

We are having postfix mail server in centos webserver. In that server users able to send from fake email id like admin@gmail.com and all.

But I am having only one domain in that server, So I need to block fake Id and give permission only for my example.com domain.

Is it possible if I edit /etc/postfix/header_checks or in transport we will block.

All the outgoing mail will go with my example.com only. Please anyone help me.

Best Answer

To force that users use email address like something@example.lan for mail sended from inside the server, you can use this configuration

smtpd_restriction_classes =
   inside

inside =
  check_sender_access hash:/etc/postfix/allowed_senders
  reject

smtpd_recipient_restrictions =
   reject_unauth_destination
   check_client_access hash:/etc/postfix/inside_network
   ... your favourite anti spam stuff here ...
   permit

/etc/postfix/inside_network

127.0.0.1               inside
hostname.example.lan    inside

in /etc/postfix/allowed_senders:

example.lan     OK

Source: http://www.arschkrebs.de/postfix/postfix_restriction_classes3_en.shtml http://www.arschkrebs.de/postfix/postfix_restriction_classes2_en.shtml