Hello,

I am trying to automate the injection of emails into my intranet from a remote zimbra server to a local one. If the email are valid it works flawlessly.

If I have a configuration error and say, the email does not exist on the server anymore, 1 time over 3-5 tries zmlmtpinject will hang without returning. Even if I kill the zmlmtpinject pid, the process never comes back because it seems I cannot kill the Java sub-process thread that zmlmtpinject spans.

Normaly my script goes like that:

[zimbra@agora]# /usr/local/bin/getmail_inject_zimbra.py -d /var/spool/getmail/Maildir/new -r test@mydomain.net -s test@mydomain.net
file to process: 1137616914.M524569P9377Q1R8c449952ba23ef8b.agora
Exit-Status: 1
Data: [] INFO: connections=1 host=localhost port=7025
[] WARN: Delivery failed for 1137616914.M524569P9377Q1R8c449952ba23ef8b.agora:
com.zimbra.cs.lmtpserver.LmtpProtocolException: 503 5.5.1 No recipients
at com.zimbra.cs.lmtpserver.utils.LmtpClient.sendMess age(LmtpClient.java:168)
at com.zimbra.cs.lmtpserver.utils.LmtpInject$NamedLmt pClient.sendMessage(LmtpInject.java:591)
at com.zimbra.cs.lmtpserver.utils.LmtpInject$LmtpInje ctTask.run(LmtpInject.java:497)
at com.zimbra.cs.util.ThreadPool$CountedTask.run(Thre adPool.java:302)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Wo rker.run(Unknown Source)
at java.lang.Thread.run(Thread.java:595)

LmtpInject Finished
submitted=0 failed=1
maximum concurrent active connections: 1
0.017s, 0.0ms/msg, 0.0mps
average message size = 0.0KB
[zimbra@agora]#

When the process hangs it does something like that:

[zimbra@agora .getmail]# /usr/local/bin/getmail_inject_zimbra.py -d /var/spool/getmail/Maildir/new -r test@mydomain.net -s test@mydomain.net
file to process: 1137616914.M524569P9377Q1R8c449952ba23ef8b.agora
PID: 1563
Timeout Encountered!
Exit-Status: None
Data: [] INFO: connections=1 host=localhost port=7025
[] WARN: Delivery failed for 1137616914.M524569P9377Q1R8c449952ba23ef8b.agora:
com.zimbra.cs.lmtpserver.LmtpProtocolException: 503 5.5.1 No recipients
at com.zimbra.cs.lmtpserver.utils.LmtpClient.sendMess age(LmtpClient.java:168)
at com.zimbra.cs.lmtpserver.utils.LmtpInject$NamedLmt pClient.sendMessage(LmtpInject.java:591)
at com.zimbra.cs.lmtpserver.utils.LmtpInject$LmtpInje ctTask.run(LmtpInject.java:497)
at com.zimbra.cs.util.ThreadPool$CountedTask.run(Thre adPool.java:302)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Wo rker.run(Unknown Source)
at java.lang.Thread.run(Thread.java:595)

..and it nevers come back to the prompt. It just hangs there.

In these cases, my script cannot complete its cleanup and therefor it becomes impossible to automate the task in question.

I hope there would be a way to be sure that zmlmtpinject in itself terminates properly in all cases, but I'm surely scared that it's more like a Sun's JDK thread hanging problem.

One way to make-it work would be to insure that the account exists beforehand, obviously. But I wanted to ask the experts before having to code-around this since I'm worried that zmlmtpinject may hang for other reasons and then I would be cooked!

Thanks much for replying.

Keep-up the good work.

-jeff