Ubuntu 14.04
Sponsored Link

Install/Configure Postfix2014/05/03

 
Install Postfix to configure SMTP server. SMTP uses 25/TCP.
[1] This example shows to configure SMTP-Auth to use Dovecot's SASL function.
root@mail:~#
apt-get -y install postfix sasl2-bin
# Enter

  +------------------------+ Postfix Configuration +------------------------+
  |                                                                         |
  | Please select the mail server configuration type that best meets your
  | needs.
  |
  |  No configuration:
  |   Should be chosen to leave the current configuration unchanged.
  |  Internet site:
  |   Mail is sent and received directly using SMTP.
  |  Internet with smarthost:
  |   Mail is received directly using SMTP or by running a utility such
  |   as fetchmail. Outgoing mail is sent using a smarthost.
  |  Satellite system:
  |   All mail is sent to another machine, called a 'smarthost', for
  | delivery.
  |  Local only:
  |
  |                                 <Ok>
  |                                                                         |
  +-------------------------------------------------------------------------+

# select 'No Configuration' (configure manually)

                    +------+ Postfix Configuration +-------+
                    | General type of mail configuration:  |
                    |                                      |
                    |       No configuration               |
                    |       Internet Site                  |
                    |       Internet with smarthost        |
                    |       Satellite system               |
                    |       Local only                     |
                    |                                      |
                    |                                      |
                    |       <Ok>           <Cancel>        |
                    |                                      |
                    +--------------------------------------+

root@mail:~#
cp /usr/lib/postfix/main.cf /etc/postfix/main.cf

root@mail:~#
vi /etc/postfix/main.cf
# line 59: uncomment

mail_owner = postfix
# line 76: uncomment and specify hostname

myhostname =
mail.srv.world
# line 83: uncomment and specify domain name

mydomain =
srv.world
# line 104: uncomment

myorigin = $mydomain
# line 118: uncomment

inet_interfaces = all
# line 166: uncomment

mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
# line 209: uncomment

local_recipient_maps = unix:passwd.byname $alias_maps
# line 268: uncomment and specify your LAN

mynetworks = 127.0.0.0/8,
10.0.0.0/24
# line 388: uncomment

alias_maps = hash:/etc/aliases
# line 399: uncomment

alias_database = hash:/etc/aliases
# line 421: uncomment (use Maildir)

home_mailbox = Maildir/
# line 557: comment out and add below

#
smtpd_banner = $myhostname ESMTP $mail_name (@@DISTRO@@)
smtpd_banner = $myhostname ESMTP
# line 631: add

sendmail_path =
/usr/sbin/postfix
# line 636: add

newaliases_path =
/usr/bin/newaliases
# line 641: add

mailq_path =
/usr/bin/mailq
# line 647: add

setgid_group =
postdrop
# line 651: comment out

#
html_directory =
# line 655: comment out

#
manpage_directory =
# line 660: comment out

#
sample_directory =
# line 664: comment out

#
readme_directory =
# add at the lasdt line: limit an email size 10M

message_size_limit = 10485760

# limit mailbox 1G

mailbox_size_limit = 1073741824
# for SMTP-Auth settings

smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
smtpd_recipient_restrictions = permit_mynetworks, permit_auth_destination, permit_sasl_authenticated, reject
root@mail:~#
root@mail:~#
/etc/init.d/postfix restart

 * Stopping Postfix Mail Transport Agent postfix
   ...done.
 * Starting Postfix Mail Transport Agent postfix
   ...done.
Matched Content