Note

The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.

Difference between revisions of "Package:Postfix"

From Funtoo
Jump to navigation Jump to search
(Added explanation how to switch to listening to IP addresses (useful for applications that don't support unix sockets by default))
 
(6 intermediate revisions by 2 users not shown)
Line 2: Line 2:
|Summary=A fast and secure drop-in replacement for sendmail.
|Summary=A fast and secure drop-in replacement for sendmail.
|CatPkg=mail-mta/postfix
|CatPkg=mail-mta/postfix
|Maintainer=
|Homepage=http://www.postfix.org
|Homepage=http://www.postfix.org
}}
}}
Postfix is an advanced mail server, MTA (mail transport agent).  Postfix attempts to be fast, easy to administer, and secure.  The outside has a definite Sendmail-ish flavor, but the inside is completely different.  Funtoo is providing postfix as default MTA.  The main change in funtoo's default postfix configuration is that it is running using unix sockets instead listening on IP address.
Unix sockets allow for greater security and speed when running services that use postfix on the same server as postfix. If you prefer to listen to IP addresses,
or your application doesn't support listening on UNIX sockets, editing master.cf should do the trick:
{{file|name=/etc/postfix/master.cf|desc=master.cf|body=
# /etc/postfix/master.cf:
#
# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master" or
# on-line: http://www.postfix.org/master.5.html).
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#              (yes)  (yes)  (no)    (never) (100)
# ==========================================================================
#smtp      unix  n      -      y      -      -      smtpd
smtp      inet  n      -      n      -      1        smtpd
#smtpd    pass  -      -      n      -      -      smtpd
#dnsblog  unix  -      -      n      -      0      dnsblog
#tlsproxy  unix  -      -      n      -      0      tlsproxy
#submission inet n      -      n      -      -      smtpd
}}
The above configuration shows that the "smtp unix" line is commented out, disabling listening on sockets. Instead, the line "smtp inet" is uncommented which tells
postfix to listen on IP addresses. After editing the file reload the configuration:
{{console|body=
###i## postfix reload
}}
After that, check that postfix is listening on a port (port 25 by default):
{{console|body=
###i## netstat -tlpn
tcp        0      0 172.97.103.72:25        0.0.0.0:*              LISTEN      1099/master       
tcp        0      0 127.0.0.1:25            0.0.0.0:*              LISTEN      1099/master
}}
Depending on your configuration, additional steps might be required, but this should be enough to get simple applications started.
{{EbuildFooter}}
{{EbuildFooter}}

Latest revision as of 00:54, February 10, 2017

Postfix

   Tip

We welcome improvements to this page. To edit this page, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.

Postfix is an advanced mail server, MTA (mail transport agent). Postfix attempts to be fast, easy to administer, and secure. The outside has a definite Sendmail-ish flavor, but the inside is completely different. Funtoo is providing postfix as default MTA. The main change in funtoo's default postfix configuration is that it is running using unix sockets instead listening on IP address.

Unix sockets allow for greater security and speed when running services that use postfix on the same server as postfix. If you prefer to listen to IP addresses, or your application doesn't support listening on UNIX sockets, editing master.cf should do the trick:

   /etc/postfix/master.cf - master.cf
# /etc/postfix/master.cf:
#
# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master" or
# on-line: http://www.postfix.org/master.5.html).
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (no)    (never) (100)
# ==========================================================================
#smtp      unix  n       -       y       -       -       smtpd
smtp      inet  n       -       n       -       1        smtpd
#smtpd     pass  -       -       n       -       -       smtpd
#dnsblog   unix  -       -       n       -       0       dnsblog
#tlsproxy  unix  -       -       n       -       0       tlsproxy
#submission inet n       -       n       -       -       smtpd

The above configuration shows that the "smtp unix" line is commented out, disabling listening on sockets. Instead, the line "smtp inet" is uncommented which tells postfix to listen on IP addresses. After editing the file reload the configuration:

root # postfix reload

After that, check that postfix is listening on a port (port 25 by default):

root # netstat -tlpn
tcp        0      0 172.97.103.72:25        0.0.0.0:*               LISTEN      1099/master         
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1099/master

Depending on your configuration, additional steps might be required, but this should be enough to get simple applications started.