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:

Or if you have played around with quotas in the previous section you will see a couple of emails plus the quota warnings:

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

Congratulations. At this point your server can already receive emails.

5 thoughts on “Testing IMAP”

  1. I’ve combed through the steps a couple of times but I keep getting “Could not connect to webmail.example.org (No route to host).” I accepted the prompt to create “root/Mail” but was never prompted for a password. Any idea what I could be missing?

    1. Update: /var/vmail/ is empty but I noticed elsewhere in the guides that there should be many ~/Maildir items from when we did ‘/var/vmail/%d/%n’ AS home’ in an earlier step . How can I generate these for the host route?

  2. I’m having the same issue as well. I have followed the instructions for Bullseye several times and they are perfect – fantastic instruction while explaining just enough… This is the first time installing on Bookworm.

    1. I’m not sure if this is a perfect fix but I discovered the cause for me. Although I was setting up webmail.example.org, I had given my server a silly hostname (“Mercury”). I was able to confirm this by using “mutt -f imaps://john@example.org@Mercury” instead of “mutt -f imaps://john@example.org@webmail.example.org”. There will be a warning saying “WARNING: Server hostname does not match certificate”.

      You can learn your current hostname by running [hostname].
      You can update your hostname by running [hostnamectl set-hostname _____]
      You must ALSO update /etc/hosts by adding the line [ webmail.example.org] to the end.
      Reboot the server for good measure.

  3. I got an error about the auth process (auth process broken) when I tried to run this mutt command. Turns out I didn’t copy the entire code block for /etc/dovecot/dovecot-sql.conf.ext from an earlier page on accident. Found this out by running systemctl status dovecot.

Leave a Reply

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

Scroll to Top