Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

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

Interesting observation, but it appears that passing a string returns the same output as passing an array ref. Passing a string as the value of the paramater is even used in the source of the MIME::Entity module itself for its own internal methods (see, add_sig() ).

The docs actually state the value for the Data param should be,

Single-part entities only. Optional. An alternative to Path (q.v.): the actual data, either as a scalar or an array reference (whose elements are joined together to make the actual scalar).

So both are right. I'm very pleased with how MIME::Entity is encoding the message - one line that I feed it splitting into two lines when encoded is what I expect. Decoding things back works just as well. (I'm not reporting a bug in MIME::Entity.)

 
#!/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'; 

MIME::Entity->build(
	Data     => $str, 
	Type     => 'text/plain',
	Encoding => 'quoted-printable',
)->bodyhandle->print; 
Prints back,
filler text to get the first char of line 2 to be a dot______ http://google.com

The broken URL isn't happening in my app, but upstream.

The problem is in the SMTP client not double-dotting a line that starts with a dot. Lines that start with a dot could happen because of my example (wrapping a URL onto multiple lines during encode). I'm asking what it is I should do (if anything) to deal with a broken SMTP client? I'm leaning on, "nothing", but is this instead a universal problem, with a known solution? Googling this problem specifically for Perl examples leads to no results, although other languages/libraries say to encode the dot. If I were to encode the dot, what's the least hackiest way to do so? I can make a one-line regex to handle this, but then I fear I'll then have two problems.

-skazat

In reply to Re^2: Double Dot Stuffing by skazat
in thread 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 perusing the Monastery: (3)
As of 2024-04-20 00:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found