We are using javamail to deliver mail for our applications. The mail function runs in a loop to deliver around 100 to 200 mails depending on the range we use.
However, it taking more than an hour to send around 100 mails.
All the mails are send with an attachment (pdf file) of size 14KB.
The mail function is as follows:
sendMailWithAttachment("email@example.com", "password", "192.168.2.160", "25", "false", "false", true, "false", to, subject, body);
We are using
sendmail for mail server and it runs on the same network of the application. So, the latency from application server to mail server is very low.
# sendmail -d0.1 Version 8.13.8
If I run
mailq on the server, it always shows two or three mails pending at a time.
# mailq /var/spool/mqueue (3 requests) Total requests: 3
Load average on the mail server is very low.
$w 14:13:45 up 8 days, 59 min, 1 user, load average: 0.03, 0.03, 0.00
Where is the issue?