Friday, April 23, 2021

Mail Server Configuration - openSUSE

  1. install debian with GUI
  2. set static id address with nds 8.8.8.8
  3. set hostname
    1. root# cp /etc/hostname /etc/hostname.bak
    2. root# vi /etc/hostname
    3. debian8
  4. set hosts
    1. root# cp /etc/hosts /etc/hosts.bak
    2. root# vi /etc/hosts
    3. 10.64.204.8         opensuse8.sus8.com      opensuse8
  5. close firewall
    1. root# systemctl disable firewalld
    2. root# systemctl stop firewalld
  6. install bind9
    1. root# zypper install -y bind9
    2. root# systemctl enable named
    3. root# systemctl start named
  7. after install DNS server, we modify setting of DNS.
    1. vi /etc/named.conf
    2. listen-on port 53 { 10.64.204.X; };
    3. dnssec-validateion no;
    4. add recursion yes;

 

 

  1. go to webmin.com to install webmin
  2. open webmin by https://fedora8:10000
  3. webmin fix in openSUSE to control bind as below pic:
  4. create master zoons(sus8.com and sus8.ca), and A records, and MX records.
  5. In ‘zoon option’ allow zoon transfer to class dns server.
  6. Create secondary zoon in class dns server to transfer dns zoons.
  7. After these DNS setting, we change back DNS from 8.8.8.8 to local 10.64.204.8
  8. Install postfix for openSUSE.
  9. zypper install postfix
  10. After installed postfix, we need to modify main.cf
  11. root# vi /etc/postfix/main.cf
  12. Make sure the settings:
  13. myhostname = opensuse8.sus8.com
  14. mydestination add deb8.com, deb8.ca
  15. mydomain = sus8.com (Not find the place to put)
  16. mynetworks add 10.64.0.0/12 (Not find the place to put)
  17. Install alpine
  18. zypper install alpine
  19. Install Dovecot
  20. Install dovecot
  21. zypper install -y dovecot
  22. Vi /etc/dovecot/dovecot.conf
  23. #listen = *,;; àlisten = *
  24. #login_trusted_networks = à login_trusted_networks = 10.64.0.0/12
  25. Add the end of following at the bottom
  26. pop3_uidl_format = %08Xu%08Xv
  27. mail_location = mbox:~/mail:INBOX=/var/mail/%u
  28. chmod 600 /var/spool/mail/*
  29. systemctl restart postfix
  30. vi /etc/dovecot/conf.d/10-mail.conf
  31. remove the # to indicate the mail location.
  32. SOLUTION FOR ERROR WITH OUTLOOK CONNECTING TO POP3 (Not yet test)
  33. cd /etc/dovecot/conf.d
  34. vi 10-auth.conf
  35. disable_plaintext_auth = no
  36. save the file, Restart the service
  37. In outlook turn of secure authentication SPA
  38. And under the advanced tab uncheck the pop3 ssl authentication
  39. Now we can setup the client email using outlook
  40. add new pop and imap account in outlook

 

Thursday, April 22, 2021

Mail Server Configuration - Fedora (CentOS)

  • Webmin DNS
  1. install Fedora with GUI
  2. set static id address with DNS: 8.8.8.8
  3. set hostname
    1. root# cp /etc/hostname /etc/hostname.bak
    2. root# vi /etc/hostname
    3. fedora8
  4. set hosts
    1. root# cp /etc/hosts /etc/hosts.bak
    2. root# vi /etc/hosts
    3. 10.64.201.8         fedora8.fed8.com           fedora8
  5. install bind
    1. root# dnf install -y bind
    2. root# systemctl enable named
    3. root# systemctl start named
  6. after install dns server, we modify setting of DNS.
    1. vi /etc/named.conf
    2. listen-on port 53 { 10.64.201.x; }
    3. dnssec-validation no;
    4. add recursion yes;
  7. install sendmail
    1. root# dnf install -y sendmail sendmail-cf
    2. root# systemctl enable sendmail
    3. root# systemctl start sendmail
  8. go to webmin.com to install webmin
  9. open webmin by https://fedora8:10000
  10. create master zone

  1. create A records

  1. create alias records for FTP

  1. create MX record with fed11.com. priority 5

  1. change dns from8.8.8.8 to itself 10.64.201.8
  2. transfer dns zone to class dns server

  1. turn off firewall
    1. systemctl disable firewalld
    2. Systemctl stop firewalld
  2. go to class dns server to create secondary zoon.

 

  1. force fedora forward the dns zoon always to class dns server.

 

  • Setup 2nd Domain DNS and Sendmail

  1. create master zone: fed8.ca

  1. create MX records

  1. zoon transfer to class dns

  1. go to class dns server to create sendory zoon: fed8.ca
  2. go back to fedora, modify configure file of sendmail: /etc/mail/sendmail.mc

  1. comment out the line: DAEMON_OPT….

  1. generate a new configure file of sendmail after any change.
    1. make -C /etc/mail

  1. restart sendmail : systemctl restart sendmail
  2. install alpine for testing.

dnf install -y alpine

  1. change local configure of alpine

  1. change the access file to add relay:
    1. vi /etc/mail/access
  2. generate a new configure file of sendmail after any change.
    1. make -C /etc/mail
  3. restart sendmail and test using alpine.

                You can test by nslokup -q=mx fed8.com before send mail to the mailbox

  • Install Dovecot
  1. Install dovecot

for fedora and centos:

dnf install -y dovecot

  1. Check the configure file:
  2. vi /etc/dovecot/dovecot.conf
  3. vi /etc/covecot/conf.d/10-mail.conf
  1. remove the # to indicate the mail location.
  1. SOLUTION FOR ERROR WITH OUTLOOK CONNECTING TO POP3 (Not yet test)
  1. cd /etc/dovecot/conf.d
  2. vi 10-auth.conf
  3. disable_plaintext_auth = no
  4. save the file and restart the service in outlook turn of secure authentication SPA
  5. And under the advanced tab uncheck the pop3 ssl authentication
  1. change the mail folder permission to 600.

  • Now we can setup the client email using outlook
  1. add new pop and imap account in outlook

 

 

 

Mail Server Configuration - Ubuntu


  • Webmin DNS

  1. install ubuntu with GUI
  2. set static id address with nds 8.8.8.8
  3. set hostname
    1. root# cp /etc/hostname /etc/hostname.bak
    2. root# vi /etc/hostname
    3. ubuntu8
  4. set hosts
    1. root# cp /etc/hosts /etc/hosts.bak
    2. root# vi /etc/hosts
    3. 10.64.203.8         ubuntu8.ubu8.com         ubuntu8
  5. close firewall
    1. root# systemctl disable ufw
    2. root# systemctl stop ufw
  6. install bind9
    1. root# apt-get install -y bind9
    2. root# systemctl enable named
    3. root# systemctl start named
  7. after install dns server, we modify setting of DNS.
    1. vi /etc/bind/named.conf.options
    2. dnssec-validateion no;
    1. add recursion yes;



  1. go to webmin.com to install webmin

  1. open webmin by https://ubuntu8:10000
  2. create master zoons(ubu8.com and ubu8.ca), and A records, and MX records.
  3. In ‘zoon option’ allow zoon transfer to class dns server.
  4. Create secondary zoon in class dns server to transfer dns zoons.
  5. After these DNS setting, we change back DNS from 8.8.8.8 to local 10.64.203.8
  6. This time we remove sendmail and install postfix for Debian.
  7. Apt-get install postfix.

 

  1. After installed postfix, we need to modify main.cf

        root# nano /etc/postfix/main.cf 

  1. Make sure the settings for myhostname: ubuntu8.ubu8.com
  1. Mydestination add ubu8.com, ubu8.ca
  1. mynetworks add 10.64.0.0/12

 


  1. Install alpine

 

  • Install Dovecot

  1. Install dovecot
  2. apt-get install -y dovecot-core dovecot-pop3d dovecot-imapd dovecot-lmtpd
  1. Check the configure file: (not need to change anything for now)

vi /etc/dovecot/dovecot.conf

  1. vi /etc/dovecot/conf.d/10-mail.conf

 

  1. remove the # in order to indicate the mail location.

 

 

  1. SOLUTION FOR ERROR WITH OUTLOOK CONNECTING TO POP3 (Not yet test)

cd /etc/dovecot/conf.d

vi 10-auth.conf

disable_plaintext_auth = no

then, save the fileRestart the serviceIn outlook turn of secure authentication SPAAnd under the advanced tab uncheck the pop3 ssl authentication

  1. change the mail folder permission to 600.

  • Now we can setup the client email using outlook

  1. add new pop and imap account in outlook

 

Mail Server Configuration - Debian


  • Webmin DNS
  1. install debian with GUI
  2. set static id address with nds 8.8.8.8
  3. set hostname
    1. root# cp /etc/hostname /etc/hostname.bak
    2. root# vi /etc/hostname
    3. debian8
  4. set hosts
    1. root# cp /etc/hosts /etc/hosts.bak
    2. root# vi /etc/hosts
    3. 10.64.202.8         debian8.deb8.com          debian8
  5. close firewall
    1. root# systemctl disable firewalld
    2. root# systemctl stop firewalld
  6. install bind9
    1. root# apt-get install -y bind9
    2. root# systemctl enable bind9
    3. root# systemctl start bind9
  7. after install dns server, we modify setting of DNS.
    1. nano /etc/bind/named.conf.options
    2. dnssec-validateion auto --> dnssec-validateion no



    1. add recursion yes; (optional)

  1. go to webmin.com to install webmin

 

  1. open webmin by https://debian8:10000
  2. create master zoons(deb8.com and deb8.ca), and A records, and MX records.
  3. In ‘zoon option’ allow zoon transfer to class dns server.
  4. Create secondary zoon in class dns server to transfer dns zoons.
  5. After these DNS setting, we change back DNS from 8.8.8.8 to local 10.64.202.8
  6. This time we remove sendmail and install postfix for Debian.
  7. Apt-get install postfix.

  1. After installed postfix, we need to modify main.cf

 

  1. Make sure the settings for myhostname:

 

  1. Mydestination add deb8.com, deb8.ca

 

  1. mynetworks add 10.64.0.0/12
        

 

  1. Install alpine

 

 

  • Install Dovecot
  1. Install dovecot
  2. apt-get install -y dovecot-core dovecot-pop3d dovecot-imapd dovecot-lmtpd

Or for fedora and centos:

  1. Check the configure file:

vi /etc/dovecot/dovecot.conf

  1. vi /etc/dovecot/conf.d/10-mail.conf

 

  1. remove the # to indicate the mail location.

 

 

  1. SOLUTION FOR ERROR WITH OUTLOOK CONNECTING TO POP3 (Not yet test)
  1. cd /etc/dovecot/conf.d
  2. vi 10-auth.conf
  3. disable_plaintext_auth = no
  4. save the file, restart the service, in outlook turn of secure authentication SPA
  5. And under the advanced tab uncheck the pop3 ssl authentication
  1. change the mail folder permission to 600.

Now we can setup the client email using outlook

  1. add new pop and imap account in outlook