[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Rant - Emacs mail is not user friendly

From: Kelly Dean
Subject: Rant - Emacs mail is not user friendly
Date: Sun, 16 Nov 2014 12:18:41 +0000

> In particular, mail
> queuing is about as complex as things get.  MUAs normally delegate
> queuing to the MTA (that's how I handle disconnected operation on my
> laptop, for example, and that's the *only* reason I run Postfix on my
> laptop), and in that sense feedmail.el is a hack.
It doesn't seem very complex, at least on the user side of things. You might 
want to consider msmtp instead of Postfix on your laptop.

> I'm sure you have good reason for doing that,
Yes. Emacs on my machine doesn't have Internet access.

> but that is a very unusual use case.
I certainly hope not! The usual case is that a person's instance of Emacs has 
access to his data (otherwise, Emacs wouldn't be very useful); if my use case 
is unusual, that means the usual case is that his Emacs has access not only to 
his data, but also to the Internet. With a program like Emacs serving as a 
bridge, that means his data isn't his data, but instead belongs to some Russian 
or Chinese hacker, whoever crosses the bridge first, and the original owner is 
permitted to retain a copy of the data just due to the hacker's mercifulness, 
or maybe just as bait so the hacker can get even more data later. The years 
when normal people weren't targets are long gone.

> Bottom line: I think the task you were trying to accomplish is far
> more complex that you are admitting, and has little to do with "user
> friendliness" of Emacs MUAs.
My previous, manual workflow was:
0. Compose a message in Emacs, note a subject and recipient, and note any files 
to attach.
1. Log in to webmail, and click ‟compose message”.
2. Copy the message, subject, and recipient from Emacs to the web browser, and 
attach the noted files.
3. Click ‟send”.
4. Save the message in Emacs to my file of sent messages (in anticipation of 
the webmail service's betrayal).

That was inconvenient, so I decided a better workflow would be:
0. Compose a message in Emacs in standard format, with Subject and To headers 
separated from the body by a blank line.
1. Add the From, Date, and Message-ID headers.
2. Save the message to a file foo in an outbox directory.
3. Run ⌜msmtp -t < outbox/foo⌝
4. If #3 succeeds, then run ⌜mv outbox/foo sent/foo⌝

The Emacs mail-sending functionality I wanted was simply automation of steps #1 
(plus let me attach files) and #2 of the better workflow, without also doing 
steps #3 and #4. That's hardly complex, and in fact is simply _omission_ of the 
last two steps that MUAs ordinarily do (or equivalents thereof). I looked in 
the Emacs manual, and it said Emacs can do what I wanted, and said to read 
feedmail.el to learn how. Nowhere did the manual warn ‟Here be dragons”; had I 
known to avoid feedmail, that would have saved me the day that I wasted on it.

For me, Emacs assists with step #0 except that the ⌜--text follows this line--⌝ 
is left in, it automates step #1 except that the Message-ID is broken, and it 
automates step #2 except that it leaves the draft in place after queuing the 

I eventually figured out that I don't need feedmail at all. The broken 
Message-ID is just because Emacs (in message.el; not feedmail's fault) rejects 
my ‟localhost” hostname (the machine has no network connection, so it needs no 
hostname), and the other things are fixable with just a few lines:

(defun delete-mail-header-separator ()
  "Delete `mail-header-separator'. This function copied from top of 
`message-send-mail-partially' in Emacs's message.el."
  (goto-char (point-min))
   (concat "^" (regexp-quote mail-header-separator) "\n"))
  (replace-match "\n"))

(defcustom message-outbox-directory
  (file-name-as-directory (expand-file-name "outbox" message-directory))
  :type 'directory)

; mv-rename copied from 
(defun queue-message-to-outbox ()
  (let ((filename (expand-file-name "out.mail" message-outbox-directory)))
    (write-file filename)
    (shell-command (concat "mv-rename " filename " " 

(defun discard-draft ()
  (delete-file (buffer-file-name)))

(setq message-send-mail-function 'queue-message-to-outbox)
(add-hook 'message-sent-hook 'discard-draft)

Also I had to add ⌜(pushnew '(utf-8 . 8bit) mm-body-charset-encoding-alist)⌝ to 
my init file to make Emacs stop mangling the text. (Yes I know, the mangling is 
intended as a preemptive surrender to the administrators of broken MTAs that 
used to dominate the Internet, but those seem to have been mostly vanquished 
now. At least my messages appear to be getting to the mailing list with no 

And Emacs doesn't like it if I open sent/foo that has the ⌜--text follows this 
line--⌝ deleted and switch to message-mode and try to resend it, so I have to 
put that back in this case. I don't know what the point of it is, but it's a 
minor inconvenience and I've already wasted enough time on Emacs email, so I'll 
live with it.

Last problem that I do care about is that Emacs keeps inserting line breaks 
after 72 characters, so I have to switch out of message-mode or copy/paste from 
another buffer to make it stop doing that because I can't find the setting to 
turn it off. Why is it turned on by default? Modern email readers do have 
word-wrap, after all. Even Emacs.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]