The real answer, without a milter, is that you cannot.
You can block "To:", "From:", etc by username and/or IP but there is not regular expression that says "block From except To and From".
You also need to consider that the client may not even use your SMTP server.
Please do not do what was recommended above. You need to be able to receive messages that originate locally (like daily logwatch information, local bounces, etc).
Defining what email for which domain your server accepts (as suggested above) is located in /etc/mail/local-host-names
Main Topics
Browse All Topics





by: NopiusPosted on 2009-07-10 at 07:39:18ID: 24823755
Turn off mail relay. ain RELAY
edit /etc/mail/access file
remove these lines (and all other RELAY or OK lines):
Connect:localhost.localdom
Connect:localhost RELAY
Connect:127.0.0.1 RELAY
and rebuild access.db:
cd /etc/mail
make access.db
then they will be able to send only to your local domain, that is served by this server.