Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2024-04-23 23:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found