Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Senior Coder crmpicco's Avatar
    Join Date
    Jan 2005
    Location
    Mauchline, Scotland
    Posts
    1,093
    Thanks
    15
    Thanked 1 Time in 1 Post

    emails not sending from CentOS 5.6 VM on Win7 via PHP

    I am experiencing an issue where my CentOS 5.6 (Final) VM running on Windows 7 has stopped sending emails from my PHP code.

    I'm confident this isn't a coding issue as I have the exact same code running in my office and emails send correctly from there, hence why I believe this to be a networking/configuration issue.

    In my /etc/hosts/ file on my VM I have the following:

    Code:
    127.0.0.1 localhost.localdomain localhost
    192.168.0.9 crmpicco.co.uk m.crmpicco.co.uk dev53.localdomain
    When I run setup on my VM the DNS configuration is set to dev53.localdomain and my Primary DNS is 192.168.0.1.

    In My /var/log/maillog files I see a lot of this sort of thing:

    Code:
    Nov 19 14:36:58 dev53 sendmail[21696]: qAJEawI7021696: from=<client.care@crmpicco.co.uk>, size=12858, class=0, nrcpts=1, msgid=<1353335817.9103820024efb30b451d006dc4ab3370@PHPMAILSERVER>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
    Nov 19 14:36:58 dev53 sendmail[21693]: qAJEawvd021693: to=newbie@fletcher.co.uk, ctladdr=client.care@crmpicco.co.uk (48/48), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=42681, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (qAJEawI7021696 Message accepted for delivery)
    Nov 19 14:36:59 dev53 sendmail[21698]: qAJEawI7021696: to=<newbie@fletcher.co.uk>, delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=132858, relay=mailserver.fletcher.co.uk. [213.171.216.114], dsn=5.0.0, stat=Service unavailable
    Is this likely to be a configuration issue?

  • #2
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,281
    Thanks
    57
    Thanked 523 Times in 510 Posts
    Blog Entries
    5
    Given the semi complex nature of your setup and the fact you've not told us if you're using sendmail, fakesendmail, SMTP etc, there isn't going to be a great deal that we can do to advise you here.

    As for the coding issue, while the code may work perfectly well on one machine, it's quite possible for it not to run on another. Just silly things like one machine having a slightly different PHP version can cause problems. I worked on a project a while back that I developed using PHP 5.3 and when I uiploaded it to the server (running 5.0) all hell broke loose. Nothing really worked, the use of the date() function seemed to be knackered and I spent many hours debugging it to keep my rather worried client happy (and traced it down to something really silly to do with a 5.0 and 5.3 difference using the date() function iirc).

    Now, your log shows one email accepted for delivery and another saying the service is unavailable. That could indicate thatr you're having spam problems outside of your network - EG your IP is blocked, maybe even port 25 or worse, your IP is on a spam blacklist. There are many reasons. I think you're going to have to run a local mail server and see if you can at least send mail @localhost just to be sure that it is actually sending and then try sending to a mailserver on another machine (or even your VM host) before trying to send mail out of the network again. It's a gradual process of trial and error to determine where the fault in the process is.
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  • #3
    Senior Coder crmpicco's Avatar
    Join Date
    Jan 2005
    Location
    Mauchline, Scotland
    Posts
    1,093
    Thanks
    15
    Thanked 1 Time in 1 Post
    Quote Originally Posted by tangoforce View Post
    Given the semi complex nature of your setup and the fact you've not told us if you're using sendmail, fakesendmail, SMTP etc, there isn't going to be a great deal that we can do to advise you here.

    As for the coding issue, while the code may work perfectly well on one machine, it's quite possible for it not to run on another. Just silly things like one machine having a slightly different PHP version can cause problems. I worked on a project a while back that I developed using PHP 5.3 and when I uiploaded it to the server (running 5.0) all hell broke loose. Nothing really worked, the use of the date() function seemed to be knackered and I spent many hours debugging it to keep my rather worried client happy (and traced it down to something really silly to do with a 5.0 and 5.3 difference using the date() function iirc).

    Now, your log shows one email accepted for delivery and another saying the service is unavailable. That could indicate thatr you're having spam problems outside of your network - EG your IP is blocked, maybe even port 25 or worse, your IP is on a spam blacklist. There are many reasons. I think you're going to have to run a local mail server and see if you can at least send mail @localhost just to be sure that it is actually sending and then try sending to a mailserver on another machine (or even your VM host) before trying to send mail out of the network again. It's a gradual process of trial and error to determine where the fault in the process is.
    I'm using sendmail on my VM. Really, considering it's only a development environment I only need to send an email to myself.

    When you say I could be having SPAM problems - can you elaborate? How could I determine this?

  • #4
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,281
    Thanks
    57
    Thanked 523 Times in 510 Posts
    Blog Entries
    5
    I have elaborated. You need to use google a bit more and check out IP blacklists, port 25 testing etc. As I've said, you need to look at the logic flow here and work out which part of the chain is failing. You're a Zend Certified Engineer, you should know this!

    Sendmail is an SMTP client. That means it will connect to a SMTP Server at the recipients domain and pass the email straight to it (in theory) OR it will be configured to use an SMTP relay. Now, it may be that your SMTP is not working because your ISP has blocked port 25 (maybe they've had a report of you spamming?). It maybe that your sendmail config has changed (eg, rolled back with a system restore) or maybe your IP is on a spammers IP blacklist. Again there is no definite answer I can give you because its a process of elimination.

    You say you only need to send mail to yourself locally yet your log shows you're clearly trying to send to fletcher.co.uk which is not in your hosts file (so its out there on the web) so I'm not quite sure that I follow when you say you only need to send to yourself?
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •