IMAP Problem with Postfix

SYSTEM INFORMATION
OS type and version Ubuntu 18.04
Virtualmin version 2.021
Postfix version 3.3.0

Hello everyone,

I have a problem with postfix.
I created an email address via virtualmin, then an alias.

When I try to connect my mail application I always get an IMAP connection error.
Looking in the logs I have nothing.

Does anyone have an idea?

Can you be more specific about the error?

This means your client is not connecting to the server at all.

So it can only be DNS, firewall, or network.

Before I realized this problem I had to solve another one first.
When I created the mailbox from virtualmin, I could send an email from the server, but when I replied I always got an error like:
postfix/error[8002]: E412220CE2: to=user@xxx.com, relay=none, delay=0.2, delays=0.19/0.01/0/0, dsn=5.1.1, status=bounced (User unknown in virtual alias table)

So I corrected the virtual file to have one line:
user@xxx.com user

Now if I answer the mail I sent myself I don’t have any more errors in the logs.

It’s now that I realize that I can’t connect in IMAP. Maybe it was already the case before, I don’t know.

So I think DNS is good.

Create another topic for that, topic here is your imap connection.

test here https://mxtoolbox.com/

I have on error:
No DMARC Record found

dmarc is a sending thing (needs to be fixed though), I mean is IP addresses ok. Also can you ping the server address your using for imap. Whats your “mail application”, i presume your mail client like outlook.

ping mail.xxx.com

Sending a ‘ping’ request to mail.xxx.com[xx.xxx.xxx.xx] with 32 bytes of data:
Response from xx.xxx.xxx.xx : bytes=32 time=150 ms TTL=44
Response from xx.xxx.xxx.xx : bytes=32 time=150 ms TTL=44
Response from xx.xxx.xxx.xx : bytes=32 time=150 ms TTL=44
Response from xx.xxx.xxx.xx : bytes=32 time=161 ms TTL=44

Ping statistics for xx.xxx.xxx.xx:
Packets: sent=4, received=4, lost=0 (0% loss),
Approximate loop duration in milliseconds :
Minimum = 150ms, Maximum = 161ms, Average = 152ms

My mail client is outlook on desktop.

And still no IMAP failures the mail log? Sounds like a firewall block.

No IMAP in the log.
I only have this kind of log:

Apr 15 11:30:22 XXX postfix/smtpd[31789]: warning: hostname choice-178.themedestiny.com does not resolve to address 141.98.11.55
Apr 15 11:30:22 XXX postfix/smtpd[31789]: connect from unknown[141.98.11.55]
Apr 15 11:30:26 XXX postfix/smtpd[31789]: warning: unknown[141.98.11.55]: SASL LOGIN authentication failed: authentication failure
Apr 15 11:30:27 XXX postfix/smtpd[31789]: disconnect from unknown[141.98.11.55] ehlo=1 auth=0/1 quit=1 commands=2/3

And it is not my IP.

Check fail2ban for your ip

Here is the fail2ban

Is your client IP 141.98.11.55?

If it is not, and you have no other entries in the mailllog when you try to make a connection, it remains a problem unrelated to the mail server (DNS, firewall, network). Your client is not even connecting. Nothing related to mail server can matter until there is network connectivity between the client and the server (Dovecot for retrieving mail via IMAP.)

Okay, just a couple of thoughts.
Turn off the firewall for a minute and test the mail. Tell you if the firewall is the issue.
Sounds like the name is not in the /etc/postfix/virtual table…
are others working or is this the first email setup? if others, remove the account and re-setup it up.
something like the virtual table was missed…

My IP is not 141.98.11.55.

I try to trun off firewall.
I try to connect outlook, mailspring on my computer, and my emil application on my phone. None are working.

This is the error I have on my outlook : “the connection to the incoming server (IMAP) has been deleted. check the incoming server (IMAP) settings, then try again.”

And in my log I have this (I replace my server IP by IP.IP.IP.IP, all other IP are not mine):

Apr 16 07:42:14 XXX postfix/smtpd[21810]: disconnect from unknown[141.98.10.132] ehlo=1 auth=0/1 quit=1 commands=2/3

Apr 16 07:42:24 XXX dovecot: imap-login: Disconnected (no auth attempts in 1 secs): user=<>, rip=MY.IP.MY.IP, lip=IP.IP.IP.IP, TLS: SSL_read() syscall failed: Connection reset by peer, session=</WsZN2/5xPYfJUkO>

Apr 16 07:43:20 XXX postfix/smtpd[21810]: warning: hostname dtarax-brsi.oinkhow.net does not resolve to address 141.98.10.48

Apr 16 07:43:20 XXX postfix/smtpd[21810]: connect from unknown[141.98.10.48]

Apr 16 07:43:25 XXX postfix/smtpd[21810]: warning: unknown[141.98.10.48]: SASL LOGIN authentication failed: authentication failure

Apr 16 07:43:25 XXX postfix/smtpd[21810]: disconnect from unknown[141.98.10.48] ehlo=1 auth=0/1 quit=1 commands=2/3

Apr 16 07:43:38 XXX dovecot: imap-login: Disconnected (no auth attempts in 1 secs): user=<>, rip=176.145.81.172, lip=IP.IP.IP.IP, TLS: Disconnected, session=<R7h9O2/5th+wkVGs>

Apr 16 07:44:15 XXX dovecot: imap-login: Disconnected (auth failed, 1 attempts in 35 secs): user=user@XXX.com, method=PLAIN, rip=176.145.81.172, lip=IP.IP.IP.IP, TLS: Disconnected, session=<ktyjO2/5vh+wkVGs>

Apr 16 07:44:20 XXX postfix/smtpd[21810]: connect from unknown[52.125.140.0]

Apr 16 07:44:21 XXX dovecot: imap-login: Disconnected (no auth attempts in 2 secs): user=<>, rip=52.125.140.0, lip=IP.IP.IP.IP, TLS handshaking: SSL_accept() syscall failed: Connection reset by peer, session=<2AEXPm/5gAc0fYwA>

Apr 16 07:44:21 XXX postfix/smtpd[21810]: lost connection after STARTTLS from unknown[52.125.140.0]

Apr 16 07:44:21 XXX postfix/smtpd[21810]: disconnect from unknown[52.125.140.0] ehlo=1 starttls=1 commands=2

Apr 16 07:44:21 XXX dovecot: pop3-login: Disconnected (no auth attempts in 2 secs): user=<>, rip=52.125.140.0, lip=IP.IP.IP.IP, TLS: SSL_read() syscall failed: Connection reset by peer, session=<3AEXPm/5gAc0fYwA>

Apr 16 07:44:31 XXX dovecot: imap-login: Disconnected (auth failed, 1 attempts in 3 secs): user=user@XXX.com, method=PLAIN, rip=MY.IP.MY.IP, lip=IP.IP.IP.IP, session=<VXx+Pm/53fYfJUkO>

Apr 16 07:47:00 XXX postfix/smtpd[22747]: warning: hostname choice-178.themedestiny.com does not resolve to address 141.98.11.55

Apr 16 07:47:00 XXX postfix/smtpd[22747]: connect from unknown[141.98.11.55]

Apr 16 07:47:03 XXX postfix/smtpd[22747]: warning: unknown[141.98.11.55]: SASL LOGIN authentication failed: authentication failure

Apr 16 07:47:04 XXX postfix/smtpd[22747]: disconnect from unknown[141.98.11.55] ehlo=1 auth=0/1 quit=1 commands=2/3

Apr 16 07:47:58 XXX dovecot: imap-login: Disconnected: Inactivity (no auth attempts in 180 secs): user=<>, rip=MY.IP.MY.IP, lip=IP.IP.IP.IP, TLS handshaking, session=<qQAGS2/53vYfJUkO>

Apr 16 07:50:19 XXX postfix/smtpd[23251]: warning: hostname livehh.poppopprision.com does not resolve to address 141.98.11.52

Apr 16 07:50:19 XXX postfix/smtpd[23251]: connect from unknown[141.98.11.52]

Apr 16 07:50:23 XXX postfix/smtpd[23251]: warning: unknown[141.98.11.52]: SASL LOGIN authentication failed: authentication failure

Apr 16 07:50:23 XXX postfix/smtpd[23251]: disconnect from unknown[141.98.11.52] ehlo=1 auth=0/1 quit=1 commands=2/3

Apr 16 07:50:35 XXX postfix/anvil[21812]: statistics: max connection rate 1/60s for (smtp:91.224.92.22) at Apr 16 07:40:35

Apr 16 07:50:35 XXX postfix/anvil[21812]: statistics: max connection count 1 for (smtp:91.224.92.22) at Apr 16 07:40:35

Apr 16 07:50:35 XXX postfix/anvil[21812]: statistics: max cache size 2 at Apr 16 07:44:19

You will need to use something like telnet on your PC and see if your computer can get to the imap server and this should be seen in the mail log file.
https://blog.andrewc.com/2013/01/connect-to-imap-server-with-telnet/

This is my test with telnet:

telnet>op mail.xxx.com
Looking up host: mail.xxx.com
Trying IP.IP.IP.IP:23…
Connection timed out.

Well you need to work out why as you log file shows IMAP connections. Mostly this is a firewall issue

I didn’t change anythong in the firewall config, so do you know wht could be the problem?