1

Topic: Reconnecting on every email i send

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.3
- Linux/BSD distribution name and version: FreeBSD 10.2
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- Related log if you're reporting an issue: maillog
====

Hi

I have a new server working with iRedMail, and when i send newsletters, the log (/var/log/maillog) shows for every sent email:

Jan 25 16:52:06 mail postfix/smtpd[25755]: disconnect from xx.xx.xx.xx
Jan 25 16:52:06 mail postfix/smtpd[25755]: connect from xx.xx.xx.xx
.... (connect and send the email)
Jan 25 16:52:07 mail postfix/smtpd[25755]: disconnect from xx.xx.xx.xx
Jan 25 16:52:07 mail postfix/smtpd[25755]: connect from xx.xx.xx.xx
... (etc..)

The top command reveals:

  PID USERNAME    THR PRI NICE   SIZE    RES STATE   C   TIME    WCPU COMMAND
73920 root          1  93    0 37508K  4296K CPU5    5 258:22  68.07% auth
23122 root          1  25    0 37508K  4512K kqread  6   0:38   2.98% auth
24099 root          1  25    0 37508K  4556K kqread  0   0:14   2.88% auth
24100 root          1  25    0 37508K  4552K kqread  1   0:11   2.88% auth

The problem is that the server is closing and opening a new session for every email sent. This happens on 25 and on 587 ports, and the newsletter software is connecting only once and iterating on send function only. The previous server (not postfix) took only half the time in sending the same newsletter, connecting only once and sending all emails without reconnecting.

How could i send the newsletters connecting only at the beginning?

Thank you, best regards

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Reconnecting on every email i send

With iRedMail-0.9.3 and later releases, you can send email through only port 587, if you don't want to scan outgoing emails for spam/virus checking, please follow our tutorial below:
http://www.iredmail.org/docs/disable.sp … mails.html

3

Re: Reconnecting on every email i send

Hi ZhangHuangbin

Thank you for your reply, but i already don't check spam/virus/headers for my own users (amavis only sign with Dkim). The problem is that for every email that my script sends, the iRedmail server disconnect and connects again, doing the auth again

How could i solve this? Thank you


ZhangHuangbin wrote:

With iRedMail-0.9.3 and later releases, you can send email through only port 587, if you don't want to scan outgoing emails for spam/virus checking, please follow our tutorial below:
http://www.iredmail.org/docs/disable.sp … mails.html

4

Re: Reconnecting on every email i send

*) Does your email contain only one recipient? or several/many recipients?
*) You may want to add your IP address to Postfix parameter 'mynetworks =' in /etc/postfix/main.cf.

5

Re: Reconnecting on every email i send

*) Does your email contain only one recipient? or several/many recipients?

Each email has only 1 recipient. That's because it's a personalized newsletter

*) You may want to add your IP address to Postfix parameter 'mynetworks =' in /etc/postfix/main.cf.

Now i have added my ips to mynetworks but it continues doing connects/disconnects after every email sent, doing a delay in every email sent because it needs to re-auth.

6

Re: Reconnecting on every email i send

How did you send your email? do you configure your program to perform smtp authentication?
With IP address in Postfix 'mynetworks=', smtp authentication is optional.

7

Re: Reconnecting on every email i send

Finally i solved it with a SMTPKeepAlive = true in the phpmailer configuration. I don't know why the previous server by default did it and new server by default close connection.

I hope this help to other people

Thank you Zhang for your tips