Hmm. I kind of ignored the 'no data', as I HAD PROPER data/mails and no errors as soon as I had your scrap working with the bits you omitted.

below is postfix' impression of 2 runs of your code

Sep 29 17:39:15 anuurn postfix/smtpd[18818]: connect from localhost[12 +7.0.0.1] Sep 29 17:39:15 anuurn postfix/smtpd[18818]: 5B1D9404F6: client=localh +ost[127.0.0.1] Sep 29 17:39:15 anuurn postfix/smtpd[18818]: lost connection after DAT +A (506 bytes) from localhost[127.0.0.1] Sep 29 17:39:15 anuurn postfix/smtpd[18818]: disconnect from localhost +[127.0.0.1] Sep 29 17:39:15 anuurn postfix/cleanup[18821]: 5B1D9404F6: message-id= +<20090929153915.5B1D9404F6@anuurn.compact> Sep 29 17:39:53 anuurn postfix/smtpd[18818]: connect from localhost[12 +7.0.0.1] Sep 29 17:39:53 anuurn postfix/smtpd[18818]: A5E45404F6: client=localh +ost[127.0.0.1] Sep 29 17:39:53 anuurn postfix/smtpd[18818]: lost connection after DAT +A (506 bytes) from localhost[127.0.0.1] Sep 29 17:39:53 anuurn postfix/smtpd[18818]: disconnect from localhost +[127.0.0.1] Sep 29 17:39:53 anuurn postfix/cleanup[18821]: A5E45404F6: message-id= +<20090929153953.A5E45404F6@anuurn.compact>

update META: keeping this one in <pre> intentionally; or is the line-broken version really preferrable even for non-code illustration not intended for use/reuse?? -> there's a nice profile setting to not wrap code lines on viewing. Less pain for me. (And you, if you've similar profile settings).

Actually this doesn't happen, if you comment out the attachment block: it sends a proper email.

With the attachement code, you see some debug output and the 'no data' at the very point my postfix reports loss of connection. What happens is that ::Lite happily emits a mail header, blank line and possibly the text and html variable content as mime parts (you did set them, right?). Which are the first 500 or so bytes of the partial message.

However, ::Lite doesn't check in advance that it can create a proper email and it is NOW ::Lite aborts IF THE ATTACHEMENT FILE doesn't exist(?) or is undef(your scrap!). Which is what postfix is unhappy about and thus postfix rejects the already received partial mail as well.

So with the variables being undef, I of course did never see a mail nor the exact problem scenario you have. With the missing bits added all I see is proper mails and no problems at all.

Summary: use strict; use warnings; use diagnostics; would have pinpointed the trouble for both of us: the undefined (or not found?) $upload_file among others, which lead to your 'no data' observation. Also testing the rc of the send operation would have made the issue more obvious.

needless to say, I also did the mistake to test the code w/o the use strict; ...


In reply to Re^3: MIME::Lite and Multipart by jakobi
in thread MIME::Lite and Multipart by Analog

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.