Automatic reformatting of an email: toppost→bottompost

emailtext formatting

I prefer replies to emails to be formatted as "quote first, then answer" instead of top-posting. When I reply to a top-posted reply, I sometimes manually reformat the email to make it fully bottom-post (including the quoted part) because I want to underline the context I answer to. For example, from:

Yes, me too!

On Wednesday, April 30, 2014 6:34, Jack wrote:
> I agree.
>
> On Tue, Apr 29, 2014 at 1:05 PM, John wrote:
> > Should we make a party?

To:

On Wednesday, April 30, 2014 6:34, Jack wrote:
> On Tue, Apr 29, 2014 at 1:05 PM, John wrote:
> > Should we make a party?
>
> I agree.

Yes, me too!

Is it possible to do this kind of reformatting automatically?

I'm using Icedove (Thunderbird) currently, but am willing to consider other tools as well.

Best Answer

You've picked a basic example; however, it may very well have been this advanced example:

On Wednesday, April 30, 2014 6:34, Jack wrote:

No idea, just make sure we have non-alcoholic and alcoholic beverages.

Op dinsdag 29 April 2015 om 13:05, schreef John:

What will the drinks be?

I agree.

Should we make a party?

Okay, let's do this!

When writing mails like these; people use different languages, quoting characters / styles, e-mail clients and so on. You may even get a mixture of top and bottom posts in a single discussion, with some quote references cut out as they would be repetitive when splitting up the post to quote certain sentences or paragraphs. On top of that, the quote reference may be put between two empty lines by some people...

If you were to write a script for this; you would first need to write something that identifies the quote references generated by various e-mail clients in various languages. As well as the way quotes are generated. Merge them together into a quote block object and identify if there is text before or after; if there's only text before it, you can place it after it. Recursively repeat this, which yields some success.

This still leaves some exceptions; as in the example above with split quotes and perhaps additional blank lines and so on, both identification and producting the end result will become slightly harder. In this case you could spot that under the bottom quote "Should we make a party?" of the split quotes there is no text, which then allows you to reverse the order of all the text and quote blocks in that quote level.

Writing something like this which works most of the times takes quite a bit of effort. This is why a lot of people just prefer to making rules on how they communicate with each other. These rules are then communicated to new people. But if all else fails...

Posting Style Enforcer by Connor Behan

Automatically converts top-posted messages to use bottom-positng or vice versa. Interleaved posts are left alone. Detects automatically added text and supports a per-contact list of exceptions.

If all goes well, you will never again have to know that an email was not formatted to your liking. When viewing or quoting a message, this rearranges the HTML so that bottom-posting or top-posting is enforced. This may be a nasty surprise to the person at the other end!

  • Supports moving "Foo wrote:" headings.
  • Attempts to remove quoted signatures.
  • Changes ">" symbols and gmail blockquotes to mozilla blockquotes.
  • Allows blacklisting and whitelisting certain contacts.
  • Does not work for Hotmail.

... should be a good start to deal with the most common styles; as warned, your recipient may not like it.

Related Question