HOWTO Setup Postfix: Difference between revisions

From Research
Jump to navigation Jump to search
 
(18 intermediate revisions by the same user not shown)
Line 5: Line 5:


edit '''/etc/postfix/main.cf'''
edit '''/etc/postfix/main.cf'''
<font color=red>hostname</font> <font color=blue>~ #</font> '''emacs -nw /etc/postfix/main.cf'''
  myhostname = zero.iat.sfu.ca  
  myhostname = zero.iat.sfu.ca  
             ''naturally, use '''your''' server's '''real''' name'' :-)
             ''naturally, use '''your''' server's '''real''' name'' :-)
Line 10: Line 13:
  mydomain = iat.sfu.ca
  mydomain = iat.sfu.ca


add to '''/etc/postfix/main.cf'''
add to '''/etc/postfix/main.cf''' (somewhere around line 98 / SENDING MAIL)
   
   
  # rewrites addresses
  # rewrites addresses
recipient_canonical_maps = hash:/etc/postfix/recipient_canonical
  sender_canonical_maps = hash:/etc/postfix/sender_canonical
  sender_canonical_maps   = hash:/etc/postfix/sender_canonical
   
   
# maps 'virtual' addresses
virtual_maps            = hash:/etc/postfix/virtual
# the name says everything
###append_dot_mydomain = yes


We don't receive mail, so comment this line out, as shown, in '''/etc/postfix/main.cf'''
We don't receive mail, so comment this line out, as shown, in '''/etc/postfix/main.cf''' (it usually '''is''' commented out, but please verify; around Line 159)
  #mydestination = $myhostname, localhost.$mydomain, localhost
  #mydestination = $myhostname, localhost.$mydomain, localhost




Check that this is uncommented, in '''/etc/postfix/main.cf'''
Check that these are uncommented, in '''/etc/postfix/main.cf'''.  Gentoo is shown; other distributions omit the '''''/mail''''' path (FC6 is one).
  alias_maps = hash:/etc/aliases
  alias_maps = hash:/etc/mail/aliases
alias_database = hash:/etc/mail/aliases
 
You can quickly and succinctly get an overview of the non-default postfix settings:
postconf -n
 
Create the file '''/etc/postfix/sender_canonical'''.  This ensures that any replies or whatever will go to a real (or nearly :-) ) human
 
<font color=red>hostname</font> <font color=blue>~ #</font> '''emacs -nw /etc/postfix/sender_canonical'''
 
root    gordonp+''server_name''@sfu.ca
 
Turn this plain-text file into a postfix db format with this command:
<font color=red>hostname</font> <font color=blue>~ #</font> '''postmap /etc/postfix/sender_canonical'''
 
Create the /etc/mail/aliases.db file:
<font color=red>hostname</font> <font color=blue>~ #</font> '''postalias /etc/mail/aliases'''


  relayhost = ''gotta check on this!''
Create the '''.forward''' file in root's home-dir. This will cause root-directed mail (like logwatch and cron output) to go to our admin mailing-list:
<font color=red>hostname</font> <font color=blue>~ #</font> '''emacs -nw ~/.forward'''
admin@siat.sfu.ca

Latest revision as of 17:19, 6 March 2007

Install Postfix

# emerge postfix -va

Configuration

edit /etc/postfix/main.cf

hostname ~ # emacs -nw /etc/postfix/main.cf
myhostname = zero.iat.sfu.ca 
           naturally, use your server's real name :-)

mydomain = iat.sfu.ca

add to /etc/postfix/main.cf (somewhere around line 98 / SENDING MAIL)

# rewrites addresses
sender_canonical_maps = hash:/etc/postfix/sender_canonical

We don't receive mail, so comment this line out, as shown, in /etc/postfix/main.cf (it usually is commented out, but please verify; around Line 159)

#mydestination = $myhostname, localhost.$mydomain, localhost


Check that these are uncommented, in /etc/postfix/main.cf. Gentoo is shown; other distributions omit the /mail path (FC6 is one).

alias_maps = hash:/etc/mail/aliases
alias_database = hash:/etc/mail/aliases

You can quickly and succinctly get an overview of the non-default postfix settings:

postconf -n

Create the file /etc/postfix/sender_canonical. This ensures that any replies or whatever will go to a real (or nearly :-) ) human

hostname ~ # emacs -nw /etc/postfix/sender_canonical
root     gordonp+server_name@sfu.ca

Turn this plain-text file into a postfix db format with this command:

hostname ~ # postmap /etc/postfix/sender_canonical

Create the /etc/mail/aliases.db file:

hostname ~ # postalias /etc/mail/aliases

Create the .forward file in root's home-dir. This will cause root-directed mail (like logwatch and cron output) to go to our admin mailing-list:

hostname ~ # emacs -nw ~/.forward
admin@siat.sfu.ca