setting format=flowed with msmtp

141 views
Skip to first unread message

vic...@gmail.com

unread,
May 23, 2015, 12:05:36 PM5/23/15
to mu-di...@googlegroups.com
Hi,

According to the faq[1] it should be possible to apply format=flowed to outgoing messages by setting this in the init file:

(add-hook 'mu4e-compose-mode-hook
      "Outgoing mails get format=flowed."
      (defun cpb-compose-setup ()
        (use-hard-newlines t '
guess)))



I encounter two problems.

1) If I use the exact block from the FAQ, I get an error upon composing a new message:
 run-hooks: Invalid function: "Outgoing mails get format=flowed."

Is the line "Outgoing mails get format=flowed." supposed to be a comment?

2) I use msmtp. After commenting out the offending line, the error disappears, but the header is not set. As I understand it, the code depends on using emacs’s builtin smtp sender.  Is it possible to set "format=flowed" for other sendmail programs like msmtp?

Thanks for your attention,
Victor


[1] http://www.djcbsoftware.nl/code/mu/mu4e/Writing-messages.html

Dirk-Jan C. Binnema

unread,
May 24, 2015, 4:26:38 AM5/24/15
to mu-di...@googlegroups.com

On Saturday May 23 2015, vic...@gmail.com wrote:

> Hi,
>
> According to the faq[1] it should be possible to apply format=flowed to
> outgoing messages by setting this in the init file:
>
> (add-hook 'mu4e-compose-mode-hook
> "Outgoing mails get format=flowed."
> (defun cpb-compose-setup ()
> (use-hard-newlines t 'guess)))
>
>
>
> I encounter two problems.
>
> 1) If I use the exact block from the FAQ, I get an error upon composing a
> new message:
> run-hooks: Invalid function: "Outgoing mails get format=flowed."

Seems the snippet got the lines in the wrong order; should be:

(add-hook 'mu4e-compose-mode-hook
(defun cpb-compose-setup ()
"Outgoing mails get format=flowed."
(use-hard-newlines t 'guess)))

I've updated the FAQ.


> Is the line "Outgoing mails get format=flowed." supposed to be a comment?
>
> 2) I use msmtp. After commenting out the offending line, the error
> disappears, but the header is not set. As I understand it, the code depends
> on using emacs’s builtin smtp sender. Is it possible to set
> "format=flowed" for other sendmail programs like msmtp?

You could try to influence the content-type directly to include
format=flowed, see `message-replace-header'.

Kind regards,
Dirk.


--
Dirk-Jan C. Binnema Helsinki, Finland
e:dj...@djcbsoftware.nl w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C

vic...@gmail.com

unread,
May 26, 2015, 7:56:44 PM5/26/15
to mu-di...@googlegroups.com

You could try to influence the content-type directly to include
format=flowed, see `message-replace-header'.

Thanks!
I’m a complete noob at lisp. Taking model on the faq on "Compose hooks", I tried various things around this:
(add-hook 'mu4e-compose-mode-hook
  (defun my-add-flowed ()
    "Add format=flowed."
    (message-replace-header "Content-Type" "text/plain; format=flowed" )))

When I compose a new message, mu4e shows a Content-Type header the way I want it. But the outgoing message has just "text/plain".
Occasionally it has also "charset=utf-8" if I type in accentuated charcters. So I understand that the Content-Type is set only after the message is composed? That should be the case also if there is an attachment (text/plain -> multipart). So I’m not sure where to use `message-replace-header' because it seems overwritten when the message is sent.

Thanks for your help!

Victor

Damien Cassou

unread,
May 27, 2015, 1:33:44 AM5/27/15
to mu-di...@googlegroups.com

vic...@gmail.com writes:

> According to the faq[1] it should be possible to apply format=flowed to
> outgoing messages

I tried the format=flowed approach some times ago and soon abandoned it.
This approach looks nice on the paper as it theoretically allows mail
readers to format the text depending on the display configuration of the
user. Nevertheless, I see the following 2 problems:

- when composing the email, you have to make sure to use hard and soft
new lines appropriately. For example, you have to use hard newlines
when writing bullet lists and source code but soft newlines when
writing paragraphs. Failure to do so perfectly would result in an
unreadable email.

- most mail readers will ignore the format and just display the email as is

--
Damien Cassou
http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
Reply all
Reply to author
Forward
0 new messages