Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Mail::Sender hangs on one machine but not another

by kcott (Archbishop)
on Apr 30, 2014 at 07:12 UTC ( [id://1084443]=note: print w/replies, xml ) Need Help??


in reply to Mail::Sender hangs on one machine but not another

G'day godsham,

The first thing I'd try is either removing "timeout => 2," or setting it to its default value of 120. The very short timeout you currently have may be the problem. Note that this timeout value is only stored by the Mail::Sender constructor; it's actually used (later on) by the IO::Socket::INET constructor in Mail::Sender's Connect() method.

The next thing I'd check is the various values (e.g. auth*, smtp, etc.) you have. Do these need to be different on the machines you're running your script from? When you've tested this manually, are (some of) these automatically entered for you? Try removing stored values accessed by the email client and entering them yourself for the manual tests. Compare the full header details from your manual tests: how do they differ? do any differences need to be reflected in your script?

Other places to check include: the FAQ, WARNING and GOTCHAS sections of the Mail::Sender documentation; instances of "Outlook" in that documentation; and Active bugs for Mail-Sender. Some of those might not be immediately relevant but, once you get over the current hurdle, may be useful.

Here's some additional information based on what you've reported. (I've emboldened your quotes to differentiate from documentation quotes.)

"I have tried capturing the debug output in a file but the debug file is always blank."

The Mail::Sender constructor documentation says:

"Prepares a sender. This doesn't start any connection to the server. You have to use $Sender-Open or $Sender-OpenMultipart to start talking to the server."

and a bit further down under the debug parameter:

"All the conversation with the server will be logged to that file or handle."

So, as there's no connection yet, no conversation with the server will occur: this explains the empty debug file.

"If I step through the code using a debugger it hangs at file named eval(3758). ... sub READLINE {...}"

That's not a "file named eval"; it's the code compiled by a call to eval.

Checking through the Mail::Sender (v0.8.22) source code: Open() calls Connect() which calls __Debug() which has:

eval $debug_code;

You'll find $debug_code defined with a heredoc which includes the same "sub READLINE {...}" you've reported.

-- Ken

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1084443]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-03-29 04:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found