Task: Linux Postfix Mail Server: getting error at the end

I am getting this error even configuration seems to be correct, please give a check.
Also FYI I am not having option to mark the task for review, I am getting skip button instead.

- Mail not recieved!, ‘dovecot’ is not configured correctly on Mail Server
FAILED test_postfix.py::test_postfix - AssertionError: - Mail not recieved!, …

Did you have this lines in postfix main.cf?

inet_interfaces = all
home_mailbox = Maildir/
myhostname = stratos.xfusioncorp.com
mydomain = stratos.xfusioncorp.com

Did you have this lines in dovecot.conf?

protocols = imap pop3 lmtp submission
listen = *, ::

Did you enable&restart postfix and dovecot?
Did you made user from the task?

Its all from my task notes. Maybe your task slightly different.

Thank you for commenting, it´s there.

I get the same error. Have you managed to find the reason for the error?

Did you do the same config, as I write above?

yes, it´s same and you can see my screenshot that it´s working, I can give a another try if you want.

I used the same config and it is not working.
More exactly I made the following changes:

sshpass -p Gr00T123 ssh -o StrictHostKeyChecking=no groot@stmail01
sudo -s

yum install postfix dovecot -y
useradd kareem
echo Rc5C9EyvbU | passwd --stdin kareem

sed -i ‘/^inet_interfaces/ s/localhost/all/’ /etc/postfix/main.cf
sed -i ‘/home_mailbox\s*=\sMaildir//s/^#//g’ /etc/postfix/main.cf
sed -i '/myhostname\s
=\shost.domain.tld/s/^#//g’ /etc/postfix/main.cf
sed -i '/myhostname\s
=\shost.domain.tld/s/host.domain.tld/stmail01.stratos.xfusioncorp.com/’ /etc/postfix/main.cf
sed -i '/mydomain\s
=\sdomain.tld/s/^#//g’ /etc/postfix/main.cf
sed -i '/mydomain\s
=\s*domain.tld/s/domain.tld/stratos.xfusioncorp.com/’ /etc/postfix/main.cf

sed -i ‘/protocols\s*=\simap/s/^#//g’ /etc/dovecot/dovecot.conf
sed -i '/listen\s
=\s*/s/^#//g’ /etc/dovecot/dovecot.conf
sed -i ‘/mail_location\s*=\smaildir/s/^#//g’ /etc/dovecot/conf.d/10-mail.conf
sed -i '/disable_plaintext_auth\s
=\syes/s/^#//g’ /etc/dovecot/conf.d/10-auth.conf
sed -i '/auth_mechanisms\s
=\s*plain/s/plain/plain login/’ /etc/dovecot/conf.d/10-auth.conf
sed -i ‘/unix_listener auth-userdb/{n; n; s/#user =/user = postfix/}’ /etc/dovecot/conf.d/10-master.conf
sed -i ‘/unix_listener auth-userdb/{n; n; n; s/#group =/group = postfix/}’ /etc/dovecot/conf.d/10-master.conf

systemctl enable postfix
systemctl enable dovecot
systemctl start postfix
systemctl start dovecot

And I get:

  • Mail not recieved!, ‘dovecot’ is not configured correctly on Mail Server
    FAILED test_postfix.py::test_postfix - AssertionError: - Mail not recieved!, …

I tried many times but it seems kodekloud has an issue with their validation script and I see no one is responded that they will check.

Having exact same issue here =((

In my case, after many attempts, I finally managed to get it working with a “postfix reload” command before trying the KodeKloud check.

Maybe it could be a validation error. Have you anyone here tried to telnet to the email ? I tried almost anything but not the postfix reload command, insted just reloading the service with systemctl. I also i’m been using the same configurations.

Hello there !
I have done kind of the same thing, same steps in this video : https://youtu.be/kdcUfw5vJKY?si=6ZCSQPZd20_K-653 but didn’t work for me, but found another quicky way …

After doing all the steps in the video, except the testing using telnet command .

What i did is i monitored previous failing tasks to see the validation process, and i understand, that a validation mail is being sent, but the validation is not waiting for the mail to be received, so it fails before even the mail gets created under user_home/Maildir/new/ .

So, I copied the content of the validation mail, and used telnet to make a kind of validation mail so the process works and it is working actually !

the validation mail looks like this :

Return-Path: <[email protected]>
X-Original-To: [email protected]
Delivered-To: [email protected]
Received: by stmail01.stratos.xfusioncorp.com (Postfix, from userid 1002)
        id 64EA96A8F572; Fri, 20 Sep 2024 23:01:43 +0000 (UTC)
Date: Fri, 20 Sep 2024 23:01:43 +0000
To: [email protected]
Subject: Welcome
User-Agent: s-nail v14.9.22
Message-Id: <[email protected]>
From: [email protected]

Welcome to xFusionCorp Industries

you can send this using telnet or send any mail and then update it using vim …