Short Version - Quick installation

จาก Wiki_EAI
รุ่นแก้ไขเมื่อ 16:08, 30 กันยายน 2562 โดย Titipong (คุย | มีส่วนร่วม) (Created page with "Setup directories and install required libraries <syntaxhighlight lang="bash"> sudo apt-get update sudo apt-get install courier-imap courier-imap-ssl courier-pop courier-pop-...")
(ต่าง) ←รุ่นแก้ไขก่อนหน้า | รุ่นแก้ไขล่าสุด (ต่าง) | รุ่นแก้ไขถัดไป→ (ต่าง)
ไปยังการนำทาง ไปยังการค้นหา

Setup directories and install required libraries

sudo apt-get update
sudo apt-get install courier-imap courier-imap-ssl  courier-pop courier-pop-ssl  icu-devtools libicu-dev libsasl2-dev libssl-dev libsasl2-modules sasl2-bin
sudo mkdir -p /etc/skel/Maildir/{cur,new,tmp}
sudo apt-get build-dep postfix

Answers:

Web Admin - No
Internet Site

Download and build postfix-3.x

tar -xzvf postfix-3.0.2.tar.gz
cd postfix-3.0.2
sed -i 's/.\x08//g' README_FILES/*

make CCARGS="-DUSE_TLS -I/usr/include/openssl/  \
             -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/include/sasl" \			
             AUXLIBS="-lssl -lcrypto -lsasl2" makefiles && make


sudo sh postfix-install -non-interactive   daemon_directory=/usr/lib/postfix  \
                    manpage_directory=/usr/share/man  \
                    html_directory=/usr/share/doc/postfix-3.0.1/html  \
                    readme_directory=/usr/share/doc/postfix-3.0.1/readme


Configure SASL

					
sudo cp /etc/default/saslauthd /etc/default/saslauthd-postfix

edit /etc/default/saslauthd-postfix , set START, NAME and OPTIONS /etc/default/saslauthd-postfix

					
START=yes
DESC="SASL Auth. Daemon for Postfix"
NAME="saslauthd-postf"      # max. 15 char.
# Option -m sets working dir for saslauthd (contains socket)
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd"        # postfix/smtp in chroot()


							 
sudo rm -rf /run/saslauthd
sudo ln -s /var/spool/postfix/var/run/saslauthd   /run/saslauthd
sudo dpkg-statoverride --add root sasl 710 /var/spool/postfix/var/run/saslauthd
sudo adduser postfix sasl
cd /etc/pam.d
sudo cp other smtp
sudo mkdir /etc/sasl2

edit or create /etc/sasl2/smtpd.conf

pwcheck_method: saslauthd
mech_list: PLAIN LOGIN

Restart SASLAUTHD

sudo service saslauthd  restart


Update your configuration and reload. Note: Change SUB.YOURDOMAIN, YOURDOMAIN, YOUROTHERDOMAIN to your own. YOUROTHERDOMAIN is optional.

sudo postconf compatibility_level=2
sudo postconf -e 'myhostname  = SUB.YOURDOMAIN'
sudo postconf -e 'mydomain    = YOURDOMAIN'
sudo postconf -e 'myorigin    = $mydomain'
sudo postconf -e 'inet_interfaces = all'
sudo postconf -e 'mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 192.168.0.0/24'
sudo postconf -e 'alias_database = hash:/etc/aliases'
sudo postconf -e 'alias_maps = hash:/etc/aliases'
sudo postconf -e 'mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, YOUROTHERDOMAIN'
sudo postconf -e 'smtputf8_enable = yes'			 
sudo postconf -e 'smtpd_sasl_path = smtpd'
sudo postconf -e 'smtpd_sasl_auth_enable = yes'
sudo postconf -e 'broken_sasl_auth_clients = yes'
sudo postconf -e 'smtpd_sasl_security_options = noanonymous'
sudo postconf -e 'home_mailbox = Maildir/'
sudo postconf -e 'smtpd_relay_restrictions =  permit_mynetworks permit_sasl_authenticated reject_unauth_destination reject_sender_login_mismatch'
sudo postfix reload