in reply to Mail::Sender hangs once in a while

You seem to do a lot of logging but present no information what that tells you. What module parameters bring it to hang? Or is it independent of the parameters? Does it run in an endless loop or in a wait state?

Check with a network sniffer if it tries to contact the SMTP server. Check with strace if it hangs in a system call. Check with the perl debugger, if and where it hangs in the perl code

Replies are listed 'Best First'.
Re^2: Mail::Sender hangs once in a while
by MichaelMeyer (Novice) on Oct 20, 2009 at 13:08 UTC

    OK, you're right, I missed the logging information. Well, it tells me, that the script, WHEN it hangs, it hangs always between $Log->debug("attaching file..."); and $Log->debug("sending mail to $to ($task_id)");

    The whole thing runs in an endless loop. And I don't know howto debug this issue through the perl debugger or strace, as it only occurs once in a while

      You use
      filename="Fax '.scalar localtime ($task_info->{'task_ctime'}).'.pdf"; +type="PDF Document"', file => $attach_file
      Consider putting that concatenated value into a variable, checking for it's existence before you try to attach it, and displaying the filename in your $Log->debug("attaching file..."); statement.

      For that matter, what is the value of $attach_file, and how do the file and filename values interact?

        I believe filename is the name that is put into the email as the hypothetical filename of the attachement. $attach_file seems to me more interesting as it is the name of the actual file on disc that is attached. And $attach_file is printed into the logfile a bit earlier in this line: $Log->debug("found attach_file $attach_file");

        MichaelMeyer, apart from following apls advice you might check whether in the case that the script hangs the attach_file exists and is readable and the filename doesn't have some strangeness (i.e. is an empty string, begins with '..', '-' or has spaces in it).