1 (edited by saband.sap 2017-02-11 13:42:05)

Topic: iRedMail blocks emails sent using PHP

Hi!

I have a problem.
I have server with iRedMail and another one where placed my sites. And when I send emails using PHP (from the second server) to any address on my iRedMail server they don't come. When I send emails using PHP to gmail.com everything is OK. So I think the problem is on the iRedMail side.

Can you help me?
Thanks.

Required information:
I use 0.9.6 OPENLDAP edition on Ubuntu 16.04.1. LDAP, Nginx. I don't use iRedAdmin-Pro.

----

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

2

Re: iRedMail blocks emails sent using PHP

Please check Postfix log file to figure out what happened to this email. We cannot help without related log.

FYI: log file location:
http://www.iredmail.org/docs/file.locations.html

3 (edited by saband.sap 2017-02-13 01:52:28)

Re: iRedMail blocks emails sent using PHP

Thanks for the reply.
Well, I've configured sending mail server to make sure that the problem is not with it. Now I have correct headers and can be sure of that. And now I understand more.
Problem exists in one case only. For example, on my sites server I have domains mydomain1.com, mydomain2.com, mydomain3.com. All these domains have A-record to the sites server and MX-record to the mail server (for example, mail.mymaildomain.com). Hostname of the sites server is mydomain1.com and PTR-record is the same. I'm sure that postfix on sites server doesn't send emails locally because I have another site (for example myotherdomain.com) with google MX, and it works. But if I send email from the sites server to any address at @mydomain1.com or @mydomain2.com or @mydomain3.com it is blocked by iRedMail. Why do I think so? Because:

Feb 12 07:30:32 mail postfix/postscreen[5989]: CONNECT from [SITES_SERVER_IP]:52287 to [MAIL_SERVER_IP]:25
Feb 12 07:30:32 mail postfix/postscreen[5989]: PASS OLD [SITES_SERVER_IP]:52287
Feb 12 07:30:32 mail postfix/smtpd[5992]: connect from mydomain1.com[SITES_SERVER_IP]
Feb 12 07:30:32 mail postfix/smtpd[5992]: NOQUEUE: reject: RCPT from mydomain1.com[SITES_SERVER_IP]: 554 5.7.1 <info@mydomain2.com>: Recipient address rejected: Policy rejection not logged in; from=<www-data@mydomain1.com> to=<info@mydomain2.com> proto=ESMTP helo=<mydomain1.com>
Feb 12 07:30:32 mail postfix/smtpd[5992]: disconnect from mydomain1.com[SITES_SERVER_IP] ehlo=1 mail=1 rcpt=0/1 data=0/1 rset=1 quit=1 commands=4/6

And this log is even more intresting (because mymaildomain.com is not placed at the sites server):

Feb 12 08:32:12 mail postfix/postscreen[6691]: CONNECT from [SITES_SERVER_IP]:52544 to [MAIL_SERVER_IP]:25
Feb 12 08:32:12 mail postfix/postscreen[6691]: PASS OLD [SITES_SERVER_IP]:52544
Feb 12 08:32:12 mail postfix/smtpd[6694]: connect from mydomain1.com[SITES_SERVER_IP]
Feb 12 08:32:12 mail postfix/smtpd[6694]: NOQUEUE: reject: RCPT from mydomain1.com[SITES_SERVER_IP]: 554 5.7.1 <me@mymaildomain.com>: Recipient address rejected: Policy rejection not logged in; from=<www-data@mydomain1.com> to=<me@mymaildomain.com> proto=ESMTP helo=<mydomain1.com>
Feb 12 08:32:12 mail postfix/smtpd[6694]: disconnect from mydomain1.com[SITES_SERVER_IP] ehlo=1 mail=1 rcpt=0/1 data=0/1 rset=1 quit=1 commands=4/6

It seems that iRedMail blocks emails because they are sent from mydomain1.com and does it because the domain mydomain1.com is used in iRedMail. Can you help me to fix it?

4

Re: iRedMail blocks emails sent using PHP

iRedMail blocks email because it doesn't perform SMTP AUTH to send email. Please configure your PHP program to perform smtp auth to send email. (port 587 with TLS for secure connection)