So, I can send emails with Emacs now. But reading emails seems to be more difficult task. I want to do it with rmail. This article says that I need to add the following lines:

(setenv "MAILHOST" "pop.openmailbox.org")
(setq rmail-primary-inbox-list '("po:[email protected]")
      rmail-pop-password-required t)

into my .emacs file. As you can see I'm trying to use my Openmailbox account.

Now, if I execute M-x rmail, after entering my password I see the following message in the echo area:

movemail: Error connecting to POP server: -ERR [AUTH] Plaintext authentication disallowed on non-secure (SSL/TLS) connections.
(No new mail has arrived)
0 new messages read

I'm wondering why I don't have to supply port number (for example I used 587 to send emails) and why do I get this error. How to read emails with Emacs?

  • I'm not really able to help you, as I'm not using RMAIL but Gnus. This is my configuration: raw.githubusercontent.com/LeMeteore/emacs.d/master/init_mail.el
    – Nsukami _
    Nov 9, 2014 at 16:05
  • Rmail suddenly stopped working for me. Now when it reads the spool file, it yields the error "Wrong type argument: stringp, nil". I have tried starting over with a new .emacs file containing the bare minimum of settings, including rmail-primary-inbox-list, but that has no effect. I have tried starting over with a new spool file, but I get this error even if the spool file is empty. It may be that rmail is just no longer working for some reason. Mar 31, 2021 at 12:08

2 Answers 2


You need to connect to the server over TLS. In order to do that, you need to add --tls to rmail-movemail-flags. You can use customize to set this variable interactively; if you wish to set it in your init file instead, you can do something like

(setq rmail-movemail-flags '("--tls"))

Note however that Rmail is a fairly primitive mailer. There are better mailers for Emacs, notably Wanderlust (probably the best for IMAP if you wish to keep all your mail on the server), Mew, VM, mu4e, notmuch, etc. Some people also like to use Gnus, the Emacs newsreader, for reading mail.

  • What should be contents of rmail-movemail-flags a list of symbols, list of strings, string? I used '(--tls) and Emacs says "Wrong type argument: stringp, --tls". I tried C-h v rmail-movemal-flags but it does not explain format of data that this variable should hold. Nov 9, 2014 at 16:17
  • With '("--tls") it's a bit better: invalid option -- '-'. But still doesn't work. Nov 9, 2014 at 16:26
  • I've updated my answer to mention that you should use customize which will pick the right datatype for you. The issue you're having with invalid option is a different one — you've probably got obsolete versions of movemail lying around, and Emacs is picking the wrong one. Either uninstall your obsolete Emacs versions, or set rmail-movemail-program to something sane.
    – jch
    Nov 9, 2014 at 16:34
  • Thanks for your help, although I'm still unable to make it work. I'm completely perplexed. I read various manuals, try all possible combinations, but now I don't even get that first message, but just 'authentication failed'. I don't know what people mean by user name 'username' or '[email protected]' and what is meant by host 'openmailbox.org' or 'pop.openmailbox.org'. I tried all combinations and I'm really tired. I seems to be impossible to read emails with Emacs. I'll try later again... Nov 9, 2014 at 17:34
  • @Mark, many of us read emails in Emacs but I personally don't know anybody that still uses email. Try mu4e, mew, wanderlust or just gnus. You still need to know your 'username' and mail host/port though...
    – rimero
    Nov 10, 2014 at 4:14

I have used RMAIL for the past fifteen years or so (and I think there are highly respected persons on gnu.emacs.help who do). What I always did was have an external script get the mail from the POP server (I do not use IMAP) and write it to a spool file, say ~/mail/spool/inbox.


(setq rmail-primary-inbox-list '("~/mail/spool/inbox"))

is enough for RMAIL to find the mail. I use a self-written Perl script to do the fetching, but there must be tried-and-testing programs around (there used to be a program called fetchmail - I do not know if that is still an option. Movemail is really an external program that comes with Emacs. I am not sure if movemail does the same as fetchmail, but the above pretty much sounds like it, and that it is called from within Rmail.).

RMAIL can be a little confusing at first because there are so many possibilities of how you can use it. On the other hand, I have always been completely happy with it because of its simplicity -- I still do not even make use of all its functionality.

It is also important to note that Rmail is not "a mailer", but only a mode for reading and keeping mail. It can call a different mode for writing and sending mail, but there are also different choices available for that. Again, I use the most old-fashioned and simple one, by setting

(setq mail-user-agent 'sendmail-user-agent)

(The default is now a mode called message-mode.)

If you do wish to use Rmail, and these tips do not help you, you might want to ask for help on gnu.emacs.help. Some very impressive authorities read this list and very often provide helpful answers. The Rmail info page (C-h i m Emacs m Rmail) also explains that there is also an independent movemail program available (part of 'mailutils'), which has additional options. If the plain vanilla movemail (the one which comes with Emacs) does not work for some reason, maybe the mailutils one can.

The bottom line is: Rmail works. It sometimes requires some fiddling, but once it works, it works.

Best regards,


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.