• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

PHP function mail() not working outside server ?

J

JoaoCorreia

Guest
Mail problem !! (MX other servers, Plesk Ignores!)

Hello,

I have a page script with a mail() function that sends an email to my gmail account.
The problem is I dont receive the email. If I put a local mail account I can receive it.

Any ideas ?

Thanks
Joao Correia
 
Can your server properly resolve hostnames? What does your maillog say? Are you sure it's not delivered to the Junk box?
 
Mail ?

Originally posted by breun
Can your server properly resolve hostnames? What does your maillog say? Are you sure it's not delivered to the Junk box?

Hello,

Yes it can properly resolve , maillog doesnt show anything.
I looked in the Junk box.

Now what ?

Thanks
Joao Correia
 
Maillog should show either succes or failure. Are you saying you're logs are really empty? You might be looking at the wrong file. On our systems it's /usr/local/psa/var/log/maillog.
 
Maillog

Hello

This is what I get when I email an account in the server:

May 11 14:12:05 ns1 qmail: 1178889125.300551 new msg 242483
May 11 14:12:05 ns1 qmail: 1178889125.300732 info msg 242483: bytes 385 from <[email protected]> qp 21900 uid 48
May 11 14:12:05 ns1 qmail: 1178889125.333095 starting delivery 912190: msg 242483 to local [email protected]
May 11 14:12:05 ns1 qmail: 1178889125.333416 status: local 1/10 remote 20/20
May 11 14:12:05 ns1 qmail: 1178889125.366449 delivery 912190: success: did_1+0+1/
May 11 14:12:05 ns1 qmail: 1178889125.366627 status: local 0/10 remote 20/20
May 11 14:12:05 ns1 qmail: 1178889125.366724 end msg 242483


Outside mail (GMAIL) I get this:
May 11 14:22:02 ns1 qmail: 1178889722.051321 new msg 242553
May 11 14:22:02 ns1 qmail: 1178889722.051510 info msg 242553: bytes 382 from <[email protected]> qp 24288 uid 48


Outside mail (GMAIL APPS domain)

May 11 14:26:55 ns1 qmail: 1178890015.263810 new msg 236118
May 11 14:26:55 ns1 qmail: 1178890015.264061 info msg 236118: bytes 376 from <[email protected]> qp 25771 uid 48
May 11 14:26:55 ns1 qmail: 1178890015.298814 starting delivery 213: msg 236118 to local [email protected]
May 11 14:26:55 ns1 qmail: 1178890015.299014 status: local 1/10 remote 20/20
May 11 14:26:55 ns1 qmail: 1178890015.320734 delivery 213: failure: This_address_no_longer_accepts_mail./
May 11 14:26:55 ns1 qmail: 1178890015.320921 status: local 0/10 remote 20/20
May 11 14:26:55 ns1 qmail: 1178890015.399161 bounce msg 236118 qp 25774
May 11 14:26:55 ns1 qmail: 1178890015.399380 end msg 236118
May 11 14:26:55 ns1 qmail: 1178890015.399444 new msg 236315
May 11 14:26:55 ns1 qmail: 1178890015.399508 info msg 236315: bytes 922 from <> qp 25774 uid 2522
May 11 14:26:56 ns1 qmail: 1178890016.391938 delivery 171: failure: Sorry,_I_wasn't_able_to_establish_an_SMTP_connection._(#4.4.1)/I'm_not_going_to_try_again;_this_message_has_been_in_the_queue_too_long./


Stupid Plesk thinks the email is still on localhost and MX records are on GMAIL servers ....




But I dont get messages on my Gmail, not even in Spam folder.

I do have greylisting but it should interfere right ? I looked in the log


Thanks
Joao Correia
 
You'll have to disable mail for the local domain that has mail hosted externally or indeed you'll get these errors. That still doesn't explain why mail to a gmail.com address is not delivered though.
 
Agrrrr

This is so stupid .. I DISABLED mail service for the domain.
While a user I try to mail an email address on a domain with MX Records (ALL) hosted on GMAIL (Google Apps)


[root@ns1 var]# dig @localhost helivision.pt MX

; <<>> DiG 9.2.4 <<>> @localhost helivision.pt MX
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 48317
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 7, AUTHORITY: 2, ADDITIONAL: 2

;; QUESTION SECTION:
;helivision.pt. IN MX

;; ANSWER SECTION:
helivision.pt. 86400 IN MX 5 ALT2.ASPMX.L.GOOGLE.COM.
helivision.pt. 86400 IN MX 10 ASPMX2.GOOGLEMAIL.COM.
helivision.pt. 86400 IN MX 10 ASPMX3.GOOGLEMAIL.COM.
helivision.pt. 86400 IN MX 10 ASPMX4.GOOGLEMAIL.COM.
helivision.pt. 86400 IN MX 10 ASPMX5.GOOGLEMAIL.COM.
helivision.pt. 86400 IN MX 0 ASPMX.L.GOOGLE.COM.
helivision.pt. 86400 IN MX 5 ALT1.ASPMX.L.GOOGLE.COM.

;; AUTHORITY SECTION:


....


[root@ns1 ~]# mail [email protected]
Subject: OLA
OLA
.
Cc:
[root@ns1 ~]#


On maillog I get this:


May 11 14:40:51 ns1 qmail: 1178890851.526855 new msg 238612
May 11 14:40:51 ns1 qmail: 1178890851.526958 info msg 238612: bytes 237 from <[email protected]> qp 29877 uid 0
May 11 14:40:51 ns1 qmail: 1178890851.562368 starting delivery 87: msg 238612 to local [email protected]
May 11 14:40:51 ns1 qmail: 1178890851.562677 status: local 1/10 remote 20/20
May 11 14:40:51 ns1 qmail: 1178890851.571455 delivery 87: failure: This_address_no_longer_accepts_mail./
May 11 14:40:51 ns1 qmail: 1178890851.581741 status: local 0/10 remote 20/20
May 11 14:40:51 ns1 qmail: 1178890851.605209 bounce msg 238612 qp 29880
May 11 14:40:51 ns1 qmail: 1178890851.605401 end msg 238612
May 11 14:40:51 ns1 qmail: 1178890851.606654 new msg 1753726


Why Plesk still thinks the domain email is hosted locally ? I cant understand.

Any tips ?


Thanks for your help

Joao Correia
 
Hello Falk's,

I'm having the same trouble under plesk, I'm having a domain setup under plesk : flm.fr, the DNS server are setup with my registrar, and at my registrar dns admin desk I've setup the DNS to use a MX different that where my domain name A entry is pointing.

So on my plesk server I only wants to use it for http, email are arriving on another server, it works fine except for example if I use the php mail function to send an email to [email protected], it never arrives, I guess the server thinks that it is his own MX ... I've tried to turn of DNS services in plesk but it is the same, I've tried also to setup the DNS zone for the MX in plesk (even if I don't have any domain pointing to the DNS server of my plesk). I've but :

flm.fr.<domain>. MX (10) ASPMX2.GOOGLEMAIL.COM.
flm.fr.<domain>. MX (5) ALT2.ASPMX.L.GOOGLE.COM.
flm.fr.<domain>. MX (10) ASPMX3.GOOGLEMAIL.COM.
flm.fr.<domain>. MX (10) ASPMX4.GOOGLEMAIL.COM.
flm.fr.<domain>. MX (10) ASPMX5.GOOGLEMAIL.COM.
flm.fr.<domain>. MX (5) ALT1.ASPMX.L.GOOGLE.COM.

But it is the same :-(

How can I do to make it realize that MX is not operated by itself !

Thank you for your help,

regards,

sebM
 
Don't disable DNS, but disable mail for the domain. Domains -> [select domain] -> Mail -> Disable.
 
That was sounding good, but I have still no mail on Gmail :(

the maillog says :

[CUT and CLOSE]
 
I've found the solution I had to put in the DNS of the domain the MX entry for gmail ! Even if we are not using DNS on the server ... now it works ;)

thanks for help :)
 
Back
Top