Installing the iRedMail mail server on CentOS 7. Part 4. Configuring Postfix, authorization without entering a domain

Installing the mail server iRedMail. Postfix configuration, authorization without entering a domain

Postfix is ​​a mail transfer agent (MTA). Postfix is ​​free software created as an alternative to Sendmail. Postfix was originally developed by Weits Venema while he was working at IBM’s Thomas Watson Research Center.

A series of articles on installing and configuring the iRedMail mail server

  • Installing the iRedMail mail server on CentOS 7. Part 1. Basic installation
  • Installing the iRedMail mail server on CentOS 7. Part 2. Fighting spam
  • Installing the iRedMail mail server on CentOS 7. Part 3. Aliases, a web interface for working with aliases
  • Installing the iRedMail mail server on CentOS 7. Part 4. Configuring Postfix, authorization without entering a domain
  • Installing the iRedMail mail server on CentOS 7. Part 5. Storage structure of virtual mailboxes
  • Installing the iRedMail mail server on CentOS 7. Part 6. DKIM, SPF, DMARC
  • Installing the iRedMail mail server on CentOS 7. Part 7. Greylisting whitelist, WEB interface, Dovecot quota
  • Installation of the mail server iRedMail on CentOS 7. Part 8. White and black lists. Web interface

Open SMTPS (port 465 / tcp)

Editing the Postfix configuration file – master.cf

[[email protected]]# nano /etc/postfix/master.cf
smtps     inet  n       -       n       -       -       smtpd
  -o syslog_name=postfix/smtps
  -o smtpd_tls_wrappermode=yes
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_reject_unlisted_recipient=no
  -o smtpd_client_restrictions=$mua_client_restrictions
  -o smtpd_helo_restrictions=$mua_helo_restrictions
  -o smtpd_sender_restrictions=$mua_sender_restrictions
  -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject
  -o milter_macro_daemon_name=ORIGINATING

Rebooting Postfix

[[email protected]]# systemctl restart postfix

Adding rules to the firewall

[[email protected]]# firewall-cmd --permanent --add-service=smtp
[[email protected]]# firewall-cmd --permanent --add-service=pop3
[[email protected]]# firewall-cmd --permanent --add-service=imap
[[email protected]]# firewall-cmd --permanent --add-service=smtps
[[email protected]]# firewall-cmd --permanent --add-service=pop3s
[[email protected]]# firewall-cmd --permanent --add-service=imaps
[[email protected]]# firewall-cmd --reload

Checking

[[email protected]]# firewall-cmd --list-all
iredmail (active)
  target: default
  icmp-block-inversion: no
  interfaces: ens192
  sources: 
  services: http https smtp smtp-submission pop3 pop3s imap imaps ssh smtps
  ports: 465/tcp
  protocols: 
  masquerade: no
  forward-ports: 
  source-ports: 
  icmp-blocks: 
  rich rules:

Cutting Headers in Postfix

In order not to shine your local ip in the source of the letter, edit the header_checks file by adding the lines

[[email protected]]# nano /etc/postfix/header_checks
/^s*(Received: from)[^n]*(.*for <.*@(?!itdraft.ru).*)/ REPLACE $1 [127.0.0.1] (localhost [127.0.0.1])$2
/^s*Mime-Version: 1.0.*/ REPLACE Mime-Version: 1.0
/^s*User-Agent/ IGNORE
/^s*X-Enigmail/ IGNORE
/^s*X-Mailer/ IGNORE
/^s*X-Originating-IP/ IGNORE

Rebooting Postfix

[[email protected]]# systemctl restart postfix

Login to Dovecot without entering a domain

Editing the dovecot.conf configuration file, uncommenting the line

[[email protected]]# nano /etc/dovecot/dovecot.conf
auth_default_realm = itdraft.ru

Restarting Dovecot

[[email protected]]# systemctl restart dovecot

Roundcube authorization without domain entry

We edit the configuration file config.inc.php, add a line at the end

[[email protected]]# nano /opt/www/roundcubemail-1.3.8/config/config.inc.php
$config['username_domain'] = 'itdraft.ru';

Authorization in SOGo without entering a domain

Editing the SOGo configuration file sogo.conf

[[email protected]]# nano /etc/sogo/sogo.conf
SOGoLanguage = Russian
SOGoTimeZone = "Europe/Moscow";
SOGoMailDomain = "itdraft.ru";

Reboot SOGo

[[email protected]]# systemctl restart sogod

This method did not work for me in sogo, although I studied the manual on the official website.

Sidebar