I have a virtual server running Debian Wheezy, and I am trying to configure it as a Postfix mail server. I haven't found though any easy to follow tutorial on how to secure Postfix... and my mail.log file is already full of requests from spammers for sure, since my server is only a few weeks old, and I haven't configured it yet.

So, I am looking for the proper Postfix configuration to accept emails going to my domains or going to other domains only if they are coming from my domains. I don't want Postfix to relay emails from joeblow@NotMyDomain1.com to MrSmith@NotMyDomain2.com.

Also, I would like my SMTP server to require a secure authentication to send emails.

However, let's say I own domains abc.com, def.com and xyz.com, then I want all emails coming from these domains to be relayed by my server if proper authentication is given, and I want all emails going to these domains to be relayed by the server.

And I don't want to restrict emails relaying by network address, since I may be on any network with my laptop, and I want to be able to send emails from it.

I have ssh access to my server, and I have Webmin on it. I don't mind using shell commands, but it would be nice to have a web interface to manage all this and more on my server... if anyone has a suggestion.


You can do this mixing hash tables or regex tables containing your domains and tune the parameters mynetworks, relaydomains and smtpd_sender_restrictions permitting only your networks.

Take a look here: http://www.postfix.org/postconf.5.html#mynetworks

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.