Thursday, 11. May 2006 13:20.I would like to have Lino or TIM generate complex e-mails into a text file and then invoke the user's e-mail client to load this file into its editor where the user can edit it and finally click the «Send» button.
The articles kb.mozillazine.org/Thunderbird_Command_Line_Arguments, kb.mozillazine.org/Command_line_arguments and www.mozilla.org/docs/command-line-args.html describe Thunderbird's command-line syntax, but this approach is not usable if the message body has a certain length and/or complexity.
What they don't mention is that with a recent version of Thunderbird it is now possible to invoke Thunderbird from a command line with a file's name as argument. This file must then be in RFC850 format.
So I can generate a file tmp.eml with the following content:
Date: Wed, 03 May 2006 11:23:17 +0200 From: firstname.lastname@example.org To: email@example.com Subject: Ping Content-Type: text/plain; charset=ISO-8859-1
However with the above example, Thunderbird displays the message, but the user cannot hit Ctrl-E ("Edit as new") in order to edit and send it. I discovered that the Message-ID header field is required if I want this to be possible.
Date: Wed, 03 May 2006 11:23:17 +0200 From: firstname.lastname@example.org To: email@example.com Subject: Ping Message-ID: <firstname.lastname@example.org> Content-Type: text/plain; charset=ISO-8859-1
I observed that if my generated file contains an error, for example if I specify an invalid date in my tmp.eml file...
Date: invalid date! From: email@example.com To: firstname.lastname@example.org Subject: Ping Message-ID: <email@example.com> Content-Type: text/plain; charset=ISO-8859-1
... then Thunderbird just doesn't display the message, without letting me know about the error.
Another Thunderbird bug is that if I invoke Thunderbird with a first message, then generate another message with the same filename and invoke Thunderbird again, then Thunderbird seems to have cached my previous file and does not read the new version of it.
And another strange behaviour: the file's name must end with ".eml", not with ".EML"!