LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   AIX (https://www.linuxquestions.org/questions/aix-43/)
-   -   AIX java sendmail inconsistent sending of email (https://www.linuxquestions.org/questions/aix-43/aix-java-sendmail-inconsistent-sending-of-email-4175505211/)

ilesterg 05-16-2014 08:49 AM

AIX java sendmail inconsistent sending of email
 
Hello,

I really need everyone's help on this case which is driving me crazy for about a month now.

We have a process which send out emails, by 2 loops, one after the other:

Code:

MAILTO="email1@server.com email2@server.com"
for i in $MAILTO
do
java utils.SendMail $i /var/somefile /var/somelogfile -subject:"some subject"
done
for i in $MAILTO
do
java utils.SendMail $i /var/somefile /var/somelogfile -subject:"some subject"
done

When you add about 33 valid email addresses to the variable MAILTO, "some" emails are sent out, say for example, 32 recipients in the first loop, errors out on the 33rd, then errors out on ALL on the next loop.

Then I had the idea to let sendmail rest for some time, he might just be exhausted:

Code:

MAILTO="email1@server.com email2@server.com"
for i in $MAILTO
do
java utils.SendMail $i /var/somefile /var/somelogfile -subject:"some subject"
sleep 5
done

and wola, everything is sent out, no matter how many email addresses I add in the MAILTO variable.

The problem is, I am not that familiar with Java and Sendmail.

So, I have the following questions:
1. How can I possibly check the email sending rate limit for my user?
2. How does java know which user to use as the email sender?
3. Where should I look at the class file of util.SendMail

Thanks!

dijetlo 05-18-2014 05:54 PM

I know beans about java...;)

However I ran an email server around the turn of the century that used sendmail on VAX, before I fled for happier hunting grounds like a bat outta hell.
Quote:

errors out on the 33rd, then errors out on ALL on the next loop.
Could you post those errors?

Quote:

1. How can I possibly check the email sending rate limit for my user?
Edit: The following is just a guess, please post the errors

Sendmail just dumps them into an outbound cue for processing and delivery, the problem you may have is the cue has a size limit (the could correspond roughly to, say...33 emails). Once you blow up that cue, all the mail get's routed to /DEV/NULL cause sendmail has no place else to put it.
What's probably happening is the first email hits the servers outbound cue and it takes it a couple of seconds to initiate the push out, by which time your java program blew the back off the cue and sendmail can only process the first 33.
Have only the first email wait 5 seconds before the second and see if you don't end up sending more emails as a result, though the fix is figure out what the maximum number of emails your java program is going to generate and adjust the outbound cue capacity a little above that.


Quote:

Then I had the idea to let sendmail rest for some time, he might just be exhausted:
Seriously? As many times as I called that sendmail server a cross-eyed biaaaaatch and now you tell me it's a dude? No wonder it didn't like me....

NevemTeve 05-19-2014 04:21 AM

Where this utils.SendMail is coming from?


All times are GMT -5. The time now is 12:37 AM.