Fedora 38
Sponsored Link

Mail Server : Install Postfix2023/04/28

 
Install Postfix to configure SMTP Server.
[1] Install Postfix.
[root@mail ~]#
dnf -y install postfix
[2] This example shows to configure SMTP-Auth to use Dovecot's SASL feature.
[root@mail ~]#
vi /etc/postfix/main.cf
# line 98 : uncomment and specify hostname
myhostname = mail.srv.world

# line 106 : uncomment and specify domain name
mydomain = srv.world

# line 122 : uncomment
myorigin = $mydomain

# line 139 : change
inet_interfaces = all

# line 142 : change it if use only IPv4
inet_protocols = ipv4

# line 187 : add
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain

# line 290 : uncomment and specify your local network
mynetworks = 127.0.0.0/8, 10.0.0.0/24

# line 447 : uncomment (use Maildir)
home_mailbox = Maildir/

# line 602 : add
smtpd_banner = $myhostname ESMTP

# add follows to the end
# disable SMTP VRFY command
disable_vrfy_command = yes

# require HELO command to sender hosts
smtpd_helo_required = yes

# limit an email size
# example below means 10M bytes limit
message_size_limit = 10240000

# 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 ~]#
systemctl enable --now postfix

[3] If Firewalld is running, allow SMTP service. SMTP uses [25/TCP].
[root@mail ~]#
firewall-cmd --add-service=smtp

success
[root@mail ~]#
firewall-cmd --runtime-to-permanent

success
Matched Content