Subject: | SMTP timeout kills client |
Hi!
I can use Net-Async-SMTP to send messages, but I cannot figure out how to disconnect from the server. It seems that the server sends a timeout after some time, which kills the client:
Here some of the output when using PERL_SMTP_DEBUG=1
...
Writing some email
Writing .
Received line: 250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 9B7155D93A
Applying line [2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 9B7155D93A] for multi-line task
If I then keep the process running for some time, I get:
Received line: 421 4.4.2 mail.quikit.at Error: timeout exceeded
Use of uninitialized value in numeric eq (==) at Protocol/SMTP/Client.pm line 440.
Use of uninitialized value in concatenation (.) or string at Protocol/SMTP/Client.pm line 444.
We had an unexpected code - 421 instead of
Use of uninitialized value in concatenation (.) or string at Protocol/SMTP/Client.pm line 445.
run died with Can't call method "fail" on an undefined value at Protocol/SMTP/Client.pm line 445.
I added 'if $task->[1]' to Protocol::SMTP::Client line 445:
+ $task->[1]->fail($code => $remainder, 'expected ' . $task->[0]) if $task->[1];
This fixes the first call, but now all further calls seem to be blocked (not sure if Net-Async-SMTP is out of step, or if the server is not ready to accept new connections.
Or am I using the module totally wrong? Do I have to create a new smtp-object for each message I want to send? I'm currently creating one smtp-object at the start of the programm, add it to the loop and assume that I can reuse it.
Greetings,
domm