Testing IMAP

You have already completed the configuration of Dovecot. So fetching emails via IMAP should already work. Let’s give it a try using a simple-looking but powerful IMAP client: mutt.

mutt -f imaps://john@example.org@webmail.example.org

The connection URL may look a little confusing because of the two “@” characters. Usually mutt expects the format imaps://user@server. And as we use the email address as the “user” part you get this look.

You should get prompted for the password which we set to “summersun”. If you get any certificate warnings then check if you used the correct server name to connect to and if you completed the certificate/LetsEncrypt part earlier in this guide.

After logging in you will see an empty inbox:

Very good – IMAP connections and authentication works. That’s all we wanted to test. Exit mutt by pressing “q”.

8 thoughts on “Testing IMAP”

  1. Hello,
    In this step I get an error. I attach it:

    dovecot: auth-worker(36067): Error: mysql( Connect failed to database (mailserver): Access denied for user ‘mailserver’@’localhost’ (using password: YES) – waiting for 125 seconds before retry

    1. I had the same error in a different place (Testing email delivery), but you may have made the same error I did – there are several files where the mailserver user name and password must be entered – in one of them (/etc/dovecot/dovecot-sql.conf.ext), I entered the password for mailadmin instead of mailserver. Check that and all of the files you had to create and incorporate into postfix’s main.cf file.

  2. Techieferret

    Again… You can’t send mail as john if John doesn’t exist since he was deleted. Right?

    1. Martin Kuchar

      If you have in Postfix smtpd_recipient_restrictions=reject_sender_login_mismatch, you cannot send as another user. If you do not have this directive (and you are logged in), you can have anything in MAIL FROM.

  3. I’m getting this error, I am also unable to load the Inbox and neomutt exits immediately after entering my password

    myhostname dovecot[12411]: imap(john@example.org): Error: Couldn’t load required plugin /usr/lib/dovecot/modules/lib90_sieve_plugin.so: dlopen() failed: /usr/lib/dovecot/modules/lib90_sieve_plugin.so: undefined symbol: mail_deliver_ctx_get_log_var_expand_table

    I have a feeling it is related to sieve, I have checked online and all the fixes for this issue were already applied

    == By the way ==

    If anyone gets any SSL errors, those are related to this line in /etc/ssl/openssl.cnf

    providers = provider_sect

    so comment it out and restart dovecot to fix that one

    1. I fixed the error w/ sieve like this (pretend this is a diff):

      in /etc/dovecot/conf.d/20-lmtp.conf

      — SNIP —

      protocol lmtp {
      # Space separated list of plugins to load
      + mail_plugins = $mail_plugins sieve

      – mail_plugins = $mail_plugins sieve

      Essentially, move the mail_plugins line into the protocol block.

      Hopefully that fixes any issues you may be having with sieve and IMAP connections.

  4. Hello, it’s probably nothing important but I think you should mention that the first time you try to test mailing with mutt to your “john@example.org@webmail.example.org”, it prompts you to create the “Mail” directory as “root/Mail” and that you have to accept it to be prompted with your password. And then to your empty mailbox.

  5. I get an error after entering the password.

    “SASL authentication failed mutt”

    Any idea how to fix it ? I have tried changing the password but no luck.

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top