I am having an issue where my application spends 5-10s between Step 2 and 3 occasionally (Every few days) for 100-200 requests. It is processing about 100
requests per second.
Step 1: S: 220 <SMTP server info>
Step 2: TCP Ack for 220
Step 3: EHLO <Client host name>
I was using Java Mail 1.4.5
and now moved to 1.6.1
but having the same issue.
I am setting these properties while creating the session:
props.setProperty("mail.transport.protocol", "smtp");
props.put("mail.smtp.host", <HOST>);
props.put("mail.smtp.port", <PORT>);
props.put("mail.from", <EMAIL_SENDER>);
props.put("mail.smtp.timeout", <READ_TIMEOUT>);
props.put("mail.smtp.writetimeout", <WRITE_TIMEOUT>);
props.put("mail.smtp.connectiontimeout", <CONN_TIMEOUT>);
I have enabled TCP dump and do not see a DNS resolution going on between step 2 and 3. I know that before sending EHLO, java mail will try to resolve the host name on the client side. The correct host name is getting set on the EHLO.
I am not setting mail.smtp.localhost
or mail.smtp.localaddress
properties right now.
Any suggestion on what might be going on?