Linux, Virtualization and whatever I find interesting ...

User Tools

Site Tools


Postfix use with gmx

  • How to use postfix to send mails via a public provider.
  • Here an example with gmx using Ubuntu.


apt-get install postfix libsasl2-modules mailx 


  • When you install postfix a configuration dialog is opened.
  • internet with smarthost
  • mail relay: mail.gmx.net
  • mail name: hostname
  • You can reconfigure postfix:
    dpkg-reconfigure --priority=low postfix



  • add to main.cf of postfix


smtp_sasl_auth_enable = yes
# noplaintext # only wenn you provider doesn't support password encryption :
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_password
  • create /etc/postfix/sasl_password
sudo touch /etc/postfix/sasl_password 
  • Enter the necessary authentication informations in the following format “smtp.mailanbieter.de username:securepassword”.
  • Create db file with postmap an then delete plain text file.
sudo postmap /etc/postfix/sasl_password 
rm /etc/postfix/sasl_password
  • restart postfix
/etc/init.d/postfix restart

Correct sender address

  • Most provider check the sender address so you can't send mails under another name.
  • Therefor postfix has to replace the sender address.


sender_canonical_maps = hash:/etc/postfix/sender_canonical
  • create “/etc/postfix/sender_canonical” as shown below.
user user@gmx.net
www-data user@gmx.net
root user@gmx.net
  • create db file and restart postfix
sudo postmap /etc/postfix/sender_canonical
sudo /etc/init.d/postfix restart   


  • Now you need aliases so that postfix know where to send mails to root.


root:   user@gmx.net
  • Reload the db file
  • You don't need to restart postfix


hostname | mailx -s "root `hostname` `date`" root


No comments on such a useful post!

This is great, every now and again I keep coming back to this post for reference, it's exactly the information I needed.


1 |
| 06.12.2012 14:53 | reply
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
linux/postfix.txt · Last modified: 23.03.2013 18:41 by eanderalx