Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I configured postfix & mutt to read mails being sent by applications locally, but I just found out that they are going out on the internet too. Sometimes they reach my inbox and many times get marked as spam.

How do I configure postfix to not send mail outside my machine? I only want to be able to read emails through mutt.

Right now, I have this in /etc/postfix/

myorigin = localhost
mydestination = $myhostname, localhost.$mydomain, localhost
mynetworks = [::ffff:]/104 [::1]/128
relayhost =
share|improve this question
up vote 1 down vote accepted

Try setting the relayhost to an nonexistent host. That way it would bounce (after some timeout) anything destined for outside your localhost.

share|improve this answer
You mean relayhost = randomstring will work? – Ashfame Feb 4 '13 at 13:33
I wouldn't put any random string, but I might put something like "nohost.local" and have "nohost.local" in your hosts file pointing to some local LAN IP that does not exist (do not use 127.0.0.x) – J. Chin Feb 4 '13 at 15:20
Thanks! That seems to have done it. – Ashfame Feb 4 '13 at 19:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.