Hello Monks,

My time in the forest alone writing poetry about nature has been long, but a curious question has crossed my path, and I find myself again in this bustling city.

A user of mine is sending emails that are received with broken URLs. Dots are removed. I suspect a broken sendmail implementation, that's not doing its job dot stuffing, when it finds a dot as the first character of a line, for example:

#!/usr/bin/perl use MIME::Entity; my $str = 'filler text to get the first char of line 2 to be a dot____ +__ http://google.com'; print MIME::Entity->build( Data => $str, Type => 'text/plain', Encoding => 'quoted-printable', )->as_string;
Returns,
Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) filler text to get the first char of line 2 to be a dot______ http://g +oogle= .com=

To me, this seems correct.

One option for me as the app owner is to do this dot stuffing myself, which I am very much against, as I feel it's a hack to a broken system upstream. And I'll probably do it wrong - or at least do it badly. I'll have users now with broken links - but only because there's now too many dots!

Another option is to encode this myself so, "." turns into, "=2E". But, I don't see any way to do this through the tool chain. Looking at the docs for MIME::QuotedPrint, there is no option to encode dots, nor are there any similar options in MIME::Entity, nor is the issue brought up in Net::SMTP. This makes me think that all the authors of all these modules in the tool chain understand this problem better than I, and there was a concerted effort to not do this, "newline starts with a dot encoding".

The only thing similar to this that I have found is that lines that only have a single dot are encoded, stopping the SMTP server from truncating a message, like so:

perl -MMIME::Entity -e 'print MIME::Entity->build(Encoding => "quoted- +printable", Data => "some text\n.\nmore text")->as_string;'

prints,

Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) some text =2E more text=

So, am I missing something obvious? are there solutions that anyone else has come to, to appease broken SMTP clients without needing to post filtering output from MIME::Entity?

-skazat

In reply to Double Dot Stuffing by skazat

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.