I'm using emacs as an external editor for mutt, and am hoping to get format=flowed messages to compose properly. The default behavior for fill-paragraph is to end lines without any whitespace, but the format=flowed style as detailed in RFC 2646 and 3676 requires trailing spaces before "soft" newlines. Is there an easy modification to append a space before every newline added by fill-paragraph? My elisp skill is quite limited.
To elaborate on specifically what kind of text is wanted, RFC 3676 establishes the "format=flowed" parameter to MIME type text/plain to describe text that flows well both on devices that automatically line-wrap and those that don't. The salient idea is that a newline immediately following a space is considered a "soft" newline, one provided for line-wrapping for display on devices which don't automatically line-wrap, and that other devices are free to remove this newline and to wrap text according to their own preferences. A newline without a preceding space is a "hard" newline, one meant to be rendered as a newline regardless of the line-width or wrap capabilities of the display.
So from a text processing point of view, what I'd like for format=flowed text is for fill-paragraph to precede every intra-paragraph line break with at least one whitespace, while leaving the end-of-paragraph line break with no whitespace preceding it. All of this of course could be done with post-processing search-and-replace on all my messages, but it seems like it should be possible to dothis with some appropriate modification of fill-paragraph.