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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |