Although PHP reports the mail properly delivered, the following code doesn't result in the recipient recieving the mail:

<?php 
$sendit=mail("fluffCCC@websighted.com","first test","this is a test","From: [email]jxx@mindspring.com[/email]\n\rX-Sender: [email]jxx@mindspring.com[/email]\n\rReturn-Path: [email]jxx@mindspring.com[/email]\n\r");
echo "sendit=".$sendit;?>

I'm using Mandrake Linux with Postfix. When I check the mail log, it has an entry that says

status=bounced (host mail.mindspring.com[207.69.200.243] said: 550 rejected: cannot route to sender <apache@linux.intranet.com>)

In the php.ini file, I have the following entry:

[mail function]
SMTP = localhost ;for win32 only
sendmail_from = me@localhost.com ;for win32 only
sendmail_path = /usr/sbin/sendmail -t -f jxx@mindspring.com

Any suggestions on how to fix this?

Thanks. --Jeff

    Newlines in SMTP mail are in CRLF format, not LF followed by CR. That could be your problem. Maybe not.

    Why do you have a sendmail path specified in php.ini? Have you been editing that file?

    Where is "apache@linux.intranet.com" coming from? Is that string in any other file, or in any of your tests?

    Are you able to send mail using any other software and the Postfix installation on your computer?

    It appears that you are doing this from a dialup account on Mindspring. Are you explicitly relaying mail to Mindspring's SMTP server?

      Thanks for replying.

      I did edit the php.ini file to add the -t -f 'cause it wasn't working without them. (Of course, adding them doesn't seem to have helped!).

      I have not been able to send mail external to the Linux box using other software, but I have been able to send to another local user. For a time, I was able to send using mail() in PHP, but it suddenly stopped working. I don't think I changed anything, but it's possible. I suppose it's also possible that MindSpring changed the rules for sending the mail on.

      The apache@linux.intranet.com I guess is coming from my Linux box. The fully qualified name of the Linux box is linux.intranet.com and I'm running Apache webserver.

      I have a Mindspring dsl account, not dial-up. My postfix conf file has mail.mindspring.com specified as the "Send outgoing mail via host " (instead of "send directly").

      --Jeff

        I don't know how Mindspring has configured its email software, but it sounds as if your machine is announcing itself improperly. You say linux.intranet.com is the "fully qualified domain name" of your box ... but unless you work for IntraNet.com, that can't be.

        If you're using DHCP to get your address, Mindspring should be handing you a legal FQDN as part of the conversation, and Postfix should inherit it automatically from the gethostname() system call. Comment out any lines that explicitly set "myhostname" in your main Postfix config file, and do "postfix reload."

        Then try again, with your CR-LF problem fixed.

          Still not working. I fixed the cf/lf problem and looked again at the main.cf file; myhostname is already commented out there.

          Not sure how much of the following is useful, but maybe the background will help:

          I have a small home network with a Windows box and a Linux box. Both are connected to a Mindspring DSL line through an SMC router. I manually assigned (non-routeable) IP addresses to all three devices (2 boxes + the router). The router connects to Mindspring via some sort of built-in PPPoE. When I set up Mandrake Linux, it asked me to supply an FQDN for the Linux box so I made up one (linux.intranet.com).

          I'm still learning about Linux, so it's very possible that I've misconfigured something pretty basic. Thanks for helping!

          --Jeff

            Looks like I may have fixed it. First, I changed the FQDN name of my machine to linux.mindspring.com. Then, I changed the postfix main.cf by telling it to use domainname, not hostname, for the domain to use in outbound mail (myorigin).

              Write a Reply...