Testing Dovecot

August 12, 2012 by Roberto Puzzanghera 11 comments

netstat test

Now that almost all services are installed, you may want to check that all ports related to your mail server are open as expected:

# netstat -plunt

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name 
tcp        0      0 0.0.0.0:587             0.0.0.0:*               LISTEN      5644/tcpserver       
tcp        0      0 0.0.0.0:993             0.0.0.0:*               LISTEN      23216/dovecot/imap-  
tcp        0      0 0.0.0.0:995             0.0.0.0:*               LISTEN      23605/dovecot        
tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN      23216/dovecot/imap-  
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      5638/tcpserver       
tcp        0      0 0.0.0.0:110             0.0.0.0:*               LISTEN      23605/dovecot        
tcp        0      0 0.0.0.0:89              0.0.0.0:*               LISTEN      5645/tcpserver       
tcp        0      0 0.0.0.0:465             0.0.0.0:*               LISTEN      5662/sslserver       
tcp        0      0 0.0.0.0:4190            0.0.0.0:*               LISTEN      23605/dovecot       

Testing POP3

Remember that the plain text login is allowed only from localhost.

# telnet [your-IP] 110
Trying [your-IP]...
Connected to [your-IP].
Escape character is '^]'.
+OK Dovecot ready.
user test@yourdomain.net
+OK
pass [PASSWORD]
+OK Logged in.
quit
+OK Logging out.
Connection closed by foreign host.

Check also the secure POP connection on port 995

openssl s_client -connect [your-IP]:995

Testing IMAP

Now let's test the IMAP server. This plain text login test is allowed only from localhost.

# telnet [your-IP] 143
Trying [your-IP]...
Connected to [your-IP].
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE STARTTLS AUTH=PLAIN AUTH=LOGIN AUTH=DIGEST-MD5 AUTH=CRAM-MD5] Dovecot ready.
a login test@yourdomain.net [PASSWORD]
a OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS MULTIAPPEND UNSELECT IDLE CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS QUOTA] Logged in
a select inbox
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
* OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] Flags permitted.
* 0 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1287576448] UIDs valid
* OK [UIDNEXT 1] Predicted next UID
* OK [HIGHESTMODSEQ 1] Highest
a OK [READ-WRITE] Select completed.
a list "" *
* LIST (\HasNoChildren) "." "INBOX"
a OK List completed.
a GETQUOTA "" 
* QUOTA "" (STORAGE 29620 409600) 
a OK Getquota completed (0.001 + 0.000 secs).
a logout
* BYE Logging out
a OK Logout completed.
Connection closed by foreign host.

We have tested both the connection and if the server can find the mailbox. As you can see the only folder is  INBOX.

Test now the secure connection to IMAP:

openssl s_client -connect [your-IP]:993

 

Comments

Temporary authentication failure

Hi Roberto

i tested dovecot but with error message as below:

telnet 127.0.0.1 110
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
+OK Dovecot ready.
user kenny@domain.com
+OK
pass test
-ERR [SYS/TEMP] Temporary authentication failure. [EmailServer:2023-04-14 03:04:01]

i checked my dovecot log file and found this:

Apr 14 11:42:46 auth-worker(9438): Error: mysql(localhost): Connect failed to database (vpopmail): Access denied for user 'vpopmail'@'localhost' (using password: NO) - waiting for 125 seconds before retry

i checked my database, i found vpopmail database and also vpopmail user... please help to advise which steps i have setup wrong.

Thank you

Regards,

Kenny

Reply |

Temporary authentication failure

Hi Kenny, it seems that the vpopmail@localhost user of mysql doesn't have the privileges to access the database. Double check the privileges setup in the vpopmail page.

Try also to reset the pwd.

To test if it is working from command line:

mysql -u vpopmail -p

Once you are connected to mysql try to use the vpopmail db:

use vpopmail;
show tables;

Reply |

Temporary authentication failure

hi Roberto, below is the output:

Server:/usr/local/src # mysql -u vpopmail -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 94
Server version: 10.6.10-MariaDB MariaDB package

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use vpopmail;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [vpopmail]> show tables;
+--------------------+
| Tables_in_vpopmail |
+--------------------+
| aliasdomains |
| dir_control |
| lastauth |
| limits |
| vlog |
| vpopmail |
+--------------------+
6 rows in set (0.001 sec)

MariaDB [vpopmail]>

Reply |

Temporary authentication failure

Which authentication driver are you using in dovecot? If using SQL, you may have a mistype of the password in the config file.. If using the vpopmail driver, please do the vpopmail test with telnet

Reply |

Temporary authentication failure

hi Roberto,

thx for the advise, yes the password i set wrong in the config, after i changed the password to correct one.. another error popup

telnet 127.0.0.1 110
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
+OK Dovecot ready.
user kenny@domain.com
+OK
pass test
-ERR [SYS/TEMP] Internal error occurred. Refer to server log for more information.
Connection closed by foreign host.

i checked the log file and found below:

Apr 14 17:14:10 pop3(kenny@domain.com): Error: Plugin 'quota' not found from directory /usr/local/dovecot/lib/dovecot

i checked this folder /usr/local/dovecot/lib/dovecot, didnt have a file called quota inside.

Please advise.

Thanks

Reply |

Temporary authentication failure

how are you compiling dovecot?

you can disable the quota plugin from 10-mail.conf for the time being

Reply |

unable to get local issuer certificate

If you get the infamous "unable to get local issuer certificate" error while testing the secure versions of POP and IMAP, try running the following instead:

openssl s_client -connect localhost:995 -CApath /etc/ssl/certs

Reply |

testing error

dear edior:

telnet localhost 110
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
+OK Dovecot ready.
user wangyouyu@wangyouyu.com
+OK
pass 143youyu143
-ERR [SYS/TEMP] Temporary authentication failure. [iZ25orcjh1sZ:2015-11-22 09:51:45]

user wangyy@wangyouyu.com
+OK
pass mypassword
-ERR [SYS/TEMP] Temporary authentication failure. [iZ25orcjh1sZ:2015-11-22 09:49:35]

How can I do, Thanks very much

Reply |

I suggest to:

I suggest to:

  1. perform again the vpopmail test (look at "testing" page) 
  2. enable dovecot auth debug
  3. restart dovecot
  4. look at dovecot log file

Reply |

This problem is resolve

the problem is resolve

the error log is 

Password query failed: Table 'vpopmail.vpopmail' doesn't exist

i copy this table from other mail server and it is ok

i do not known why it is can not auto-create even if i rebuld the vpopmail?

my host is centos 6.5 and when i install vpopmail the configure is

./configure \
        --enable-qmaildir=/var/qmail/ \
        --enable-qmail-newu=/var/qmail/bin/qmail-newu \
        --enable-qmail-inject=/var/qmail/bin/qmail-inject \
        --enable-qmail-newmrh=/var/qmail/bin/qmail-newmrh \
        --disable-roaming-users \
        --enable-incdir=/usr/include/mysql \
        --enable-libdir=/usr/lib64/mysql \
        --enable-logging=p \
        --disable-clear-passwd \
        --enable-auth-logging \
        --disable-valias \
        --disable-mysql-limits \
        --disable-passwd \
        --enable-qmail-ext \
        --enable-learn-passwords

is this right?

     and i think i also have another problem in the vpopmail test

    telnet localhost 25

    i can send mail to other server but can not send mail to my own mail server

    that is no error when i did as your example but that is no mail in my mailbox

    can you give me some suggest? 

    thanks very much.

Reply |

problems in your mysql?

it could be another indication that you have problems in your mysql. Check the priviledges of the vpopmail mysql table. Look at your logs, too.

And yes, that table should be created the first time you access the db

Reply |

Recent comments
See also...
Recent posts

RSS feeds