Women in Technology

Hear us Roar



Article:
  Configuring sendmail on Jaguar
Subject:   sendmail for PHP
Date:   2002-09-25 21:12:22
From:   griffitts
All I really need is to be able to send an e-mail outside my router via a PHP page. I don't need or want to receive mail via my mail server. I don't have a domain name. I've tried following the steps as best I could but my mail.log keeps saying: Sep 25 23:06:39 G4 sendmail[997]: gethostbyaddr(192.168.1.2) failed: 3
Sep 25 23:06:39 G4 sendmail[1013]: starting daemon (8.12.2): SMTP+queueing@01:00:00
Sep 25 23:06:53 G4 sendmail[1015]: gethostbyaddr(192.168.1.2) failed: 3
Sep 25 23:06:53 G4 sendmail[1015]: g8Q46rcX001015: from=www, size=176, class=0, nrcpts=2, msgid=<200209260406.g8Q46rcX001015@g4.earthlink.net>, relay=localhost
Sep 25 23:08:08 G4 sendmail[1017]: g8Q46rcX001015: to=my_valid_address@mac.com, ctladdr=www (70/70), delay=00:01:15, xdelay=00:01:15, mailer=esmtp, pri=60097, relay=smtp-mx.mac.com. [204.179.120.49], dsn=4.0.0, stat=Deferred: Operation timed out with smtp-mx.mac.com.
Full Threads Oldest First

Showing messages 1 through 3 of 3.

  • Configuring PHP on Jaguar with mac.com
    2002-10-31 19:57:14  edwardd20 [View]

    Configuring sendmail on Jaguar with mac.com (smtp.mac.com)

    For those who wish to pursue sendmail on Mac OS X 10.2 (Jaguar) (do Europeans refer to it as 10,2?), here is what I did:

    I finally got sendmail working but not with PHP which was my real goal. I’m not sure all of this was necessary but it is what I had at the end.

    I don’t have a domain registered at my home. I was simply trying to use PHP for outgoing mail.

    Ignore all of the angle brackets and simply put in the proper values.

    I ended up working the the following command in the terminal:
    sendmail -v -f<from email address@mac.com> <to email address@xxx.com> < ~<homedir>/message

    This sent a message from <from email address@mac.com> to <to email address@xxx.com>.

    In my /etc/mail/authinfo file:
    authinfo:smtp.mac.com “U:<userid>” “P=<password>” “R:smtp.mac.com” “M:PLAIN LOGIN”

    In my /etc/mail/access file:
    192.168.0 RELAY
    192.168.1 RELAY
    dsl-1-1-1-1.networkprovider.net RELAY

    I didn’t end up using the alias file but I created one anyway that was empty.

    I added to the ./update file mentioned in the article to add the following to the end:

    if [ /etc/mail/authinfo -nt /etc/mail/authinfo.db ]
    then
    echo Updating authinfo
    makemap hash /etc/mail/authinfo < /etc/mail/authinfo
    fi

    For those of you, like me, who are prone to making typo’s, watch for the word “then” in the if/fi structure. I left it out and it took me 15 minutes to figure it out.

    In the /etc/mail/config.mc file, there are 2 different single quote characters. The one that starts parameters is the wierd one to the left of the one (1) key on my keyboard. The normal single quote key is what ends parameters. Also, you can’t use the # symbol to mark a line as a comment. The M4 processor ignores it and processes the line anyway. In my final config.mc file, I ended up removing the `LUSER_RELAY’ line. My `confDOMAIN_NAME’ had the value of `smtp.mac.com’. No SMART_HOST was necessary for me (thank you WideOpenWest). I added one other line before the mailer(SMTP) line. FEATURE(`authinfo’)dnl

    With all of these changes made, I got sendmail working with smtp.mac.com but sadly PHP’s mail() function still didn’t work even after I create my /usr/local/lib/php.ini file as:
    [mail function]
    sendmail_path = /usr/sbin/sendmail
    sendmail_from = <email address@mac.com>
    SMTP = smtp.mac.com

    PHP would always die with a gethostbyaddr(192.168.0.2) failed: 3 messge. I never did figure out what that really means or how to fix it. Once again, visit Visit http://www.phpguru.org/smtp.html for an alternative to PHP’s mail() function that actually works with Jaguar and smtp.mac.com.

    Ed
    EdwardD20 at mac dot com
  • sendmail for PHP
    2002-10-27 17:55:26  edwardd20 [View]

    It's to bad a month has gone by and no answer to this question. It is the same (or pretty close) to the issues I am having.

    I don't have a domain, or want one at this time. I would simply like to be able to use the PHP mail() function.

    I'm afraid by no answer this can't be done.

    I'm getting the following in my /var/log/mail.log file:
    Oct 27 23:06:53 G4 sendmail[531]: gethostbyaddr(192.168.0.116) failed: 3
    Oct 27 23:06:53 G4 sendmail[531]: g8Q46rcX001015: from=www, size=113, class=0, nrcpts=0, msgid=<2002102772325.g8Q46rcX001015@mulan.nodomain.com>, relay=localhost

    I do know 192.168.0.116 is my IP address behind my router. "nodomain.com" is the made up domain name I used in my config.mc file. I'm not getting the third message from the original post. Does this mean I'm not getting as far as griffitts or an I gett farther?

    How does one go about actually figuring out what these messages mean? Is it because I don't have a domain? Is there a problem in my sendmail configuration? Is the problem in my very simply PHP mail() reqest.

    I looked at the sendmail.org pages and I didn't find a documentation section. (That doesn't mean it isn't there, I just didn't find it.)

    Thanks,

    Ed
    • sendmail for PHP
      2002-10-31 19:20:30  edwardd20 [View]

      I've spent the past 2-3 weeks trying to resolve this issue without any real luck. I'm partially giving up but... I have found a replacement solution. Visit http://www.phpguru.org/smtp.html and there is a PHP CLASS file that writes directly to a SMTP mail server. This script works fine with smtp.mac.com. I'm going to recommend it to anybody who needs to use PHP mail (not the mail() function) with smtp.mac.com. Like I said, it works great.

      Back to my partially giving up. I'll keep my eye open for a real solution to using PHP's mail() function with sendmail built into OS X. Perhaps it will be in OS X 10.3.