Linux Level 2: 14 Linux Postfix Mail Server - Validation error

Help me find and fix the issue

sudo -i

yum update -y && yum install -y dovecot postfix

vi/etc/postfix/main.cf
uncomment following:
myhostname = mail.stratos.xfusioncorp.com
mydomain = stratos.xfusioncorp.com
myorigin = $mydomain
inet_interfaces = all
#inet_interfaces = localhost #comment
mydestination = $myhostname, localhost.$mudomain. localhost, $mydomain
home_mailbox = Maildir/ #uncomment

systemctl enable --now postfix
systemctl status postfix

vi /etc/dovecot/conf.d/10-auth.conf
disable_plaintext_auth = no
auth_mechanisms = plain login

vi /etc/dovecot/conf.d/10-main.conf
mail_location = maildir:~/Maildir

systemctl enable --now dovecot
systemctl status dovecot

getent passwd | grep mariyam
useradd -m mariyam
passwd mariyam
8FmzjvFU6S

mkdir -p /home/mariyam/Maildir
chown -R mariyam:mariyam /home/mariyam/Maildir/
chmod -R 700 /home/mariyam/Maildir/

echo “Hello from the sysAdmin” | mail -s “Greeting” [email protected]

:white_check_mark: Validation:

[root@stmail01 ~]# cat /home/mariyam/Maildir/new/1754419537.V3000ddIbe2b40M493872.stmail01.stratos.xfusioncorp.com
Return-Path: [email protected]
X-Original-To: [email protected]
Delivered-To: [email protected]
Received: by mail.stratos.xfusioncorp.com (Postfix, from userid 0)
id 70503BE2B3C; Tue, 5 Aug 2025 18:45:37 +0000 (UTC)
Date: Tue, 05 Aug 2025 18:45:37 +0000
To: [email protected]
Subject: Greeting
User-Agent: s-nail v14.9.22
Message-Id: [email protected]
From: root [email protected]

Error:

  • Mail not received!, ‘dovecot’ is not configured correctly on Mail Server

I tried all possible way but unable to clear the task.

Solution:

sudo su -

yum install -y postfix

vi /etc/postfix/main.cf
myhostname = stmail01.stratos.xfusioncorp.com
mydomain = stratos.xfusioncorp.com
myorigin = $mydomain
inet_interfaces = all
#inet_interfaces = localhost
mydestination = $myhostname, localhost.$mudomain. localhost,
mydestination = $myhostname, localhost.$mudomain. localhost, $mydomain
home_mailbox = Maildir/ #uncomment
mynetworks = 168.100.189.0/28, 127.0.0.0/8

systemctl enable --now postfix
systemctl status postfix

:white_check_mark: Create User
useradd -m james
echo “LQfKeWWxWD” | passwd --stdin james

=======================================================
telnet stmail01 25
EHLO localhost
mail from:[email protected]
rcpt to:[email protected]
DATA
test mail
.
quit

=======================
su - james
ls
cd Maildir/

cat new/1754424947.V400028I4c80083M945570.stmail01.stratos.xfusioncorp.com

========================

yum install dovecot -y

:white_check_mark: Configure Dovecot

vi /etc/dovecot/dovecot.conf
:set nu
protocols = imap pop3 lmtp submission
!include conf.d/*.conf #uncomment

vi /etc/dovecot/conf.d/10-mail.conf
mail_location = maildir:~/Maildir # line 24

vi /etc/dovecot/conf.d/10-auth.conf
disable_plaintext_auth = yes #Line 10
auth_mechanisms = plain login #Line 100

vi /etc/dovecot/conf.d/10-master.conf # Line 100
unix_listener auth-userdb {
#mode = 0660
user = postfix
group = postfix
}

systemctl enable --now dovecot
sudo systemctl restart dovecot
systemctl status dovecot

:white_check_mark: Validation:

=========================================================
[root@stmail01 ~]# telnet stmail01 110
Trying 172.16.238.17…
Connected to stmail01.
Escape character is ‘^]’.
+OK Dovecot ready.

user james
+OK

pass LQfKeWWxWD
+OK Logged in.

retr 1
+OK 529 octets
Return-Path: [email protected]
X-Original-To: [email protected]
Delivered-To: [email protected]
Received: from localhost (stmail01 [172.16.238.17])
by stmail01.stratos.xfusioncorp.com (Postfix) with ESMTP id B4A8D4C80079
for [email protected]; Tue, 5 Aug 2025 20:13:57 +0000 (UTC)
Message-Id: [email protected]
Date: Tue, 5 Aug 2025 20:13:57 +0000 (UTC)
From: [email protected]

test mail

.
quit

[root@stmail01 ~]# ss -tulnp
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
udp UNCONN 0 0 127.0.0.11:39604 0.0.0.0:*
tcp LISTEN 0 4096 127.0.0.11:36663 0.0.0.0:*
tcp LISTEN 0 100 0.0.0.0:143 0.0.0.0:* users:((“dovecot”,pid=4969,fd=42))
tcp LISTEN 0 100 0.0.0.0:110 0.0.0.0:* users:((“dovecot”,pid=4969,fd=24))
tcp LISTEN 0 128 0.0.0.0:22 0.0.0.0:* users:((“sshd”,pid=1227,fd=3))
tcp LISTEN 0 100 0.0.0.0:25 0.0.0.0:* users:((“master”,pid=3296,fd=13))
tcp LISTEN 0 100 0.0.0.0:995 0.0.0.0:* users:((“dovecot”,pid=4969,fd=26))
tcp LISTEN 0 100 0.0.0.0:993 0.0.0.0:* users:((“dovecot”,pid=4969,fd=44))
tcp LISTEN 0 100 0.0.0.0:587 0.0.0.0:* users:((“dovecot”,pid=4969,fd=16))
tcp LISTEN 0 100 [::]:143 [::]:* users:((“dovecot”,pid=4969,fd=43))
tcp LISTEN 0 100 [::]:110 [::]:* users:((“dovecot”,pid=4969,fd=25))
tcp LISTEN 0 128 [::]:22 [::]:* users:((“sshd”,pid=1227,fd=4))
tcp LISTEN 0 100 [::]:25 [::]:* users:((“master”,pid=3296,fd=14))
tcp LISTEN 0 100 [::]:995 [::]:* users:((“dovecot”,pid=4969,fd=27))
tcp LISTEN 0 100 [::]:993 [::]:* users:((“dovecot”,pid=4969,fd=45))
tcp LISTEN 0 100 [::]:587 [::]:* users:((“dovecot”,pid=4969,fd=17))

Hi @sakthinandhan

Could you please check and try the solution here?

I able to fix issue on my own,

vi /etc/dovecot/conf.d/10-auth.conf
disable_plaintext_auth = no #Line 10

vi /etc/dovecot/conf.d/10-master.conf # Line 107
unix_listener /var/spool/postfix/private/auth {
mode = 0660
user = postfix
group = postfix
}

Hello,

When I’m modifying the 10-master.conf, I don’t see anything in the file, it’s empty. I’m using the following structure but I don’t know what’s going wrong, Could you take a look at it, please? Thank you.

ssh groot@stmail01
sudo su

yum install postfix -y

vi /etc/postfix/main.cf
myhostname = stmail01.stratos.xfusioncorp.com
mydomain = stratos.xfusioncorp.com
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks = 172.16.238.17/24, 127.0.0.0/8
home_mailbox = Maildir/

systemctl start postfix
systemctl status postfix

useradd ‘name’
passwd ‘name’

telnet stmail01 25
EHLO localhost
mail from: ‘email’
rcpt to: ‘email’
DATA
test mail
quit

su - ‘name’
mailq
cd Maildir/new
ls -l
cat new/‘reference’
exit

yum install dovecot -y

vi /etc/dovecot/dovecot.conf
protocols = imap pop3 lmtp

vi /etc/dovecot/conf.d/10-mail.conf
mail_location = maildir:~/Maildir

vi /etc/dovecot/conf.d/10-auth.conf
disable_plaintext_auth = no
auth_mechanisms = plain login

vi 10-master.conf
‘This file appears empty’ (HELP HERE, PLEASE)

systemctl start dovecot

You’re not using the full path for the master.conf file.

The correct path is /etc/dovecot/conf.d/10-master.conf

1 Like