User Tools

Site Tools


linux:postfix

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
linux:postfix [2017/03/10 19:14] rlunarolinux:postfix [2017/03/12 15:37] rlunaro
Line 12: Line 12:
 <code> <code>
 sudo apt-get install postfix  sudo apt-get install postfix 
 +sudo apt-get install mailutils
 </code> </code>
  
Line 29: Line 30:
 # See /usr/share/postfix/main.cf.dist for a commented, more complete version # See /usr/share/postfix/main.cf.dist for a commented, more complete version
  
 +
 +mail_owner = postfix
  
 # Debian specific:  Specifying a file name will cause the first # Debian specific:  Specifying a file name will cause the first
Line 44: Line 47:
  
 relay_domains = $mydestination relay_domains = $mydestination
 +
 +smtp_generic_maps = hash:/etc/postfix/generic
  
 smtpd_banner = $myhostname ESMTP $mail_name smtpd_banner = $myhostname ESMTP $mail_name
Line 55: Line 60:
  
 readme_directory = no readme_directory = no
 +compatibility_level = 2
  
 +inet_interfaces = all
 +inet_protocols = all
  
 +smtpd_use_tls = no
 +smtp_use_tls = no 
 +
 +
 +</code>
 +
 +
 +It's very important to configure the file ''/etc/postfix/generic'' with a remapping of the local 
 +users to complete email addresses: 
 +
 +<code>
 +# REMEMBER!!!! After making changes to this file you must run: 
 +#
 +# postmap /etc/postfix/generic
 +#
 +#
 +
 +username   username@complete.server.address.com
 +</code>
 +
 +In that way, every outgoing email is rewrited from username@localhost to username@complete.server.address.com and nowadays email servers can recognize it as a valid email 
 +address. 
 +
 +After that **don't forget to run postmap /etc/postfix/generic** in order to update the database with the fresh configuration.
 +
 +==== Open firewall ====
 +
 +
 +<code>
 +ufw allow 25
 +</code>
 +
 +http://serverfault.com/questions/149903/what-ports-to-open-for-mail-server
 +
 +==== Do some testing ====
 +
 +
 +<code>
 +mail --subject="hello from server" destination-address@example.com
 </code> </code>
  
linux/postfix.txt · Last modified: 2022/12/02 22:02 by 127.0.0.1