Hi,

I'm not sure if this q is better asked here or in the Cpanel forum, so I'll try both.
Hi,

I've been using CPanel as a member on a shared host without the slightest problem up until about two months ago, and now I'm having major email trouble. Our server was upgraded to PHP5 right about the same time I had formatted my drive, and somewhere in that commotion I ran into problems trying to get Outlook re-installed and connect to my outbound smtp server. It failed connecting to "mail.mydomain.com", although the Auto-confgure reg keys listed it as both in and outbound smtp server. I went through several configurations trying to resolve the problem and then somewhere along the line it showed a test email's path was actually using our shared-host provider's outbound smtp server. Setting Outlook to use that server instead and then checking "requires authentication" got my email up and running again through Outlook.

However, I am still unable to send mail outside of my domain using PHP. I can send to me@mydomain.com fine, and PHP will claim messages are sent to others OK, but it never reaches me@anyotherdomain. Is there any way of getting a more "in-depth" log of what happened while sending the mail using PHP? I've read about examining exim.conf for clues but am unable to find it on my server. I know that I have an insecure PHP contact form on the site that needs dealing with, is it possible that a spammer has used it to somehow hi-jack my outbound smtp server completely?

I'm sure that this is the type of thing that I should be bothering my host with, but to make a long story short,..that's much harder than it sounds. I don't have direct access to php.ini or WHM, but am able to access my entire domain using FTP and CPanel. I'm just wondering if there are any local settings that I might have missed or toggled in Cpanel which could trigger this to happen, or if I am missing a required configuration for php5 vs php4, or if the issue could possibly be resolved by using php's ini_set to override global email settings.

If it helps,..phpinfo says:
sendmail_from no value no value
sendmail_path /usr/sbin/sendmail -t -i /usr/sbin/sendmail -t -i
SMTP localhost localhost
smtp_port 25 25
..and I now have all CPanel Spam-fighters disabled for testing.

Thanks a lot for any assistance on the matter.

    1. Are you using mail() to send mail or something else? If it's something else, then you're probably in trouble.
    2. Have you looked at your MTA logs?

    You really need to consult your MTA logs to try to resolve mail sending problems. Usually the issue is that you're trying to send mail with a dodgy return-path domain (typically the name of the server), which is then refused by other mail servers on the grounds that it's unresolvable.

    There are lots of other possible issues too.

    Another useful debug tool is to be able to receive bounces from the web app. Do you have access to the root / postmaster mailbox so you can look at any doublebounces generated?

    Your message above is somewhat confusing, as it seems you're talking about using Outlook on a Windows box, but also having problems with your (Linux?) shared host.

    If the server is managed by someone else, you might need to get them to look at the MTA logs.

    Mark

      Thanks Mark,

      I really appreciate you trying to sort through my jibberish.

      To clarify, my site's domain is hosted on a shared FreeBSD server "somewhere on the net", and I access my email for this domain locally via Outlook on Windows. The bulk of the site's automated mailing for notifications and the such are using PHP Mailer, although a few are standard mail() sends. I've also lost functionality in my phpBB board's ability to send outside of the domain with it's default settings. Nothing has changed with these scripts and they worked flawlessly up until the php5 upgrade. I've attempted using mail(), sendmail(), and Swift Mailer, but to no avail.

      Can you please tell me how to access MTA logs and the "bounce-checker"? My root has folders for mail, etc, tmp, cpdatastore, and the various webmail clients equipped with Cpanel. I've been through them all but still am not quite sure what to look for.

      Is the syntax of mail() in php4 and php5 unchanged?

      BTW, I also checked to make sure that neither my domain or the host's has been blacklisted.

      Thanks again, your response is my first sign of hope in a week.

        If it helps, my completely un-educated guess is that somehow anything attempting to use mail.mydomain.com as outbound smtp is automatically denied and then relayed to main.myhost'sdomain.com. Is that possible? ...or common?

        Would that account for me still being able to send to my own domain fine, because it is "allowed" in the host's configuration?

          I know little about CPANEL, I personally think it is a useless piece of junk.

          You should log on as root and examine the log files created by your MTA. You may wish to reconfigure it to send bounces somewhere useful. Alternatively, the bounces may have been directed into a system mailbox (e.g. root's).

          Without knowing what MTA you're using and a lot more about the configuration, I can't help.

          If your server is hosted "Somewhere on the net", this hopefully means it's relaying directly, not via your provider's SMTP relay (Which is not intended for use by something "Somewhere on the net" and will refuse to relay for it).

          Mark

            Hi Mark,

            Well after googling for the definition of MTA, my best guess is that Cpanel uses Exim, but I'm not sure if it's logs are available to each individual domain on our shared server, I couldn't find an exim file or folder. I came here partially hoping to find a PHP function that provided similar info to what the MTA might have to say, but apparently I'm dreaming again. I won't trouble y'all with any more server stuff, but I'd be grateful if someone could enlighten me on any of the following questions:

            1. Does "sendmail_from no value no value " raise a flag at all? I read somewhere about checking to enable or disable sending from "nobody@mydomain.com".

            2. Does using a FROM address in the headers negate the above issue?

            3. Is it possible to set the sendmail_from value using ini_set?

            4. If the sendmail_path were to change, would it require that you alter anything in your current mail scripts? Is there any section in my scripts that I should be "telling it" the sendmail_path?

            5. Should a script working just fine in php4 also work fine in php5 with no alterations?

            Mark, I feel guilty taking up any more of your time with my cryptic newb-ese, so feel free to ignore this post and carry on as you were. I thank you kindly for helping me as you did. It's much appreciated.

              Dolemite50 wrote:

              1. Does "sendmail_from no value no value " raise a flag at all? I read somewhere about checking to enable or disable sending from "nobody@mydomain.com".

              It's not a problem. You can supply your own From: header. or the MTA will probably add one if you don't.

              2. Does using a FROM address in the headers negate the above issue?

              Yes.

              3. Is it possible to set the sendmail_from value using ini_set?

              Yes.

              4. If the sendmail_path were to change, would it require that you alter anything in your current mail scripts? Is there any section in my scripts that I should be "telling it" the sendmail_path?

              sendmail_path should be set right. Changing it should not be necessary. If it's wrong, mail() will fail and a warning will be produced (You did take my advice and set error_reporting to E_ALL, didn't you?)

              5. Should a script working just fine in php4 also work fine in php5 with no alterations?

              Absolutely not, many things have changed. Some might work but others will not. The mail() function isn't any different though.

              Mark

                Thanks again, Mark. You da man. That info will help me rule out a lot of possibilities. If I'm left with any questions when I'm through, I'll just eat them because obviously you're going to keep helping a brother out 'til the cows come home and I haven't got the heart. I'm sure by then I'll have it narrowed down to changes only my host could make anyway.

                Hat's off to ya, sir.

                  Write a Reply...