Mails don’t work when locally but sometimes it might prove to be very useful in development if one can send & receive mails to & from localhost. It can be setup pretty easily too. Basic idea is to configure postfix for localhost & then use mutt to read local mails. Here is how it is done (should work fine for any UNIX based OS):
Install postfix
sudo apt-get install postfix
Install mutt
sudo apt-get install mutt
To configure postfix for localhost, specify the following in its config file at /etc/postfix/main.cf
myorigin = localhost mydestination = $myhostname, localhost.$mydomain, localhost mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 relayhost =
Restart postfix
sudo /etc/init.d/postfix restart
Now you can read localhost mails using mutt
mutt
It will read emails from /var/mail/USERNAME
Leave a Reply