NAME

App::Smarkmail - pipemailer that changes plaintext to multi/alt with Markdown

VERSION

version 0.006

DESCRIPTION

This module implements logic used by the smarkdown command, which accepts an email message on standard input, tries to convert it from a plaintext message to multipart alternative, and then sends it via sendmail

All of this is really sketchy and probably has secret mail-damaging or mail-losing bugs. -- rjbs, 2008-02-24

PERL VERSION

This module should work on any version of perl still receiving updates from the Perl 5 Porters. This means it should work on any version of perl released in the last two to three years. (That is, if the most recently released version is v5.40, then this module should work on both v5.40 and v5.38.)

Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl.

METHODS

markdown_email

my $email = App::Smarkmail->markdown_email($message, \%arg);

This method accepts an email message, either as an Email::MIME object or as a string or a reference to a string, and returns an Email::MIME object. If the method is passed an object, the object will be altered in place.

If the message is a single part plaintext message, or a multipart/mixed or multipart/related message in which the first part is plaintext, then the plaintext part will be replaced with a multipart/alternative part. The multi/alt part will have two alternatives, text and HTML. The HTML part will be generated by running the plaintext part through Text::Markdown.

If the text message ends in a signature -- that is, a line containing only "--\x20" followed by no more than five lines -- the signature will be excluded from Markdown processing and will be appended to the HTML part wrapped in pre and code tags.

Note that the HTML alternative is listed second, even though it is less true to the original composition than the first. This is because the assumption is that you want the recipient to see the HTML part, if possible. Multipart/alternative messages with HTML parts listed before plaintext parts seem to tickle some bugs in some popular MUAs.

AUTHOR

Ricardo SIGNES <cpan@semiotic.systems>

CONTRIBUTOR

Ricardo Signes <rjbs@semiotic.systems>

COPYRIGHT AND LICENSE

This software is copyright (c) 2008 by Ricardo SIGNES.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.