Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
I am attempting to have a php page generate an email using it's mail() function. When I do this, I do not receive any php errors (meaning that the function ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2004
    Posts
    39

    sendmail problem, I think


    I am attempting to have a php page generate an email using it's mail() function. When I do this, I do not receive any php errors (meaning that the function executed and returned true), but the email is still not sent.

    I'm guessing I have sendmail misconfigured somehow.

    I don't know a ton about it so I'll give you the info I have and hope someone can point me in the right direction.

    I checked to see if sendmail is running.

    # ps -ef | grep exim produces

    dpassud 2809 2668 0 21:04 pts/2 00:00:00 grep exim


    When I kill it and restart using

    # sendmail -bd -q20m


    The following appears in the syslog

    Nov 30 20:53:01 stampy /USR/SBIN/CRON[2789]: (mail) CMD ( if [ -x /usr/sbin/exim -a -f /etc/exim/exim.conf ]; then /usr/sbin/exim -q ; fi)

    When I looked at the /var/log/mail.log, it shows activity from today, but I can't figure out what I did to create the entries. At any rate it looks like this:
    Nov 30 15:13:36 stampy sendmail[2119]: My unqualified host name (stampy) unk
    nown; sleeping for retry
    Nov 30 15:14:36 stampy sendmail[2119]: unable to qualify my own domain name (b
    allsack) -- using short name
    Nov 30 15:14:36 stampy sendmail[2119]: iAUMEaQN002119: from=www-data, size=49,
    class=0, nrcpts=1, msgid=<200411302214.iAUMEaQN002119@stampy>, relay=www-data
    @localhost
    Nov 30 15:14:36 stampy sm-mta[2122]: iAUMEajV002122: ruleset=check_mail, arg1=
    <www-data@stampy>, relay=stampy [127.0.0.1], reject=553 5.1.8 <www-data@ball
    sack>... Domain of sender address www-data@stampy does not exist
    Nov 30 15:14:36 stampy sendmail[2119]: iAUMEaQN002119: to=dave@budonk.com, ctl
    addr=www-data (33/33), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30039,
    relay=[127.0.0.1] [127.0.0.1], dsn=5.6.0, stat=Data format error
    Nov 30 15:14:36 stampy sendmail[2119]: iAUMEaQN002119: iAUMEaQO002119: DSN: Da
    ta format error
    Nov 30 15:14:36 stampy sm-mta[2122]: iAUMEajV002122: from=<www-data@stampy>,
    size=49, class=0, nrcpts=0, proto=ESMTP, daemon=MSA, relay=stampy [127.0.0.1]

    Nov 30 15:14:37 stampy sm-mta[2122]: iAUMEajW002122: from=<>, size=1965, class
    =0, nrcpts=1, msgid=<200411302214.iAUMEaQO002119@stampy>, proto=ESMTP, daemon=
    MSA, relay=stampy [127.0.0.1]
    Nov 30 15:14:37 stampy sendmail[2119]: iAUMEaQO002119: to=www-data, delay=00:0
    0:01, xdelay=00:00:01, mailer=relay, pri=31073, relay=[127.0.0.1], dsn=2.0.0, st
    at=Sent (iAUMEajW002122 Message accepted for delivery)
    Nov 30 15:14:37 stampy sm-mta[2123]: iAUMEajW002122: to=dpassudetti, delay=00:
    00:01, xdelay=00:00:00, mailer=local, pri=32146, dsn=2.0.0, stat=Sent

    /var/log/exim/paniclog contains
    2004-11-30 21:17:37 socket bind() to port 25 for address (any IPv4) failed: Address already in use: daemon abandoned

    when I execute my script, /var/log/exim/mainlog shows:
    2004-11-30 21:21:19 1CZLzT-0000kP-00 <= www-data@stampy U=wwwdata P=local S=3
    98
    2004-11-30 21:21:21 1CZLzT-0000kP-00 == dave@ample.com T=remote_smtp defer (-4
    4): retry time not reached for any host
    2004-11-30 21:21:29 1CZLzT-0000kP-00 ** dave@budonk.com R=lookuphost T=remote_sm
    tp: SMTP error from remote mailer after MAIL FROM:<www-data@stampy> SIZE=1434:
    host mailhost.budonk.com [216.219.254.203]: 553 5.1.8 <www-data@stampy>... Do
    main of sender address www-data@stampy does not ist
    2004-11-30 21:21:29 1CZLzd-0000kU-00 <= <> R=1CZLzT-0000kP-00 U=mail P=local S=1
    356
    2004-11-30 21:21:29 1CZLzT-0000kP-00 Error message sent to www-data@stampy
    2004-11-30 21:21:30 1CZLzd-0000kU-00 => dpassudetti <www-data@stampy> D=localu
    ser T=local_delivery
    2004-11-30 21:21:30 1CZLzd-0000kU-00 Completed
    and just now, the same log spit out a bunch of
    2004-11-30 21:23:01 Start queue run: pid=2889
    2004-11-30 21:23:02 1CZLqb-0000jp-00 == dave@example.com T=remote_smtp defer (-4
    4): retry time not reached for any host
    2004-11-30 21:23:03 1CZLot-0000jf-00 == dave@example.com T=remote_smtp defer (-4
    4): retry time not reached for any host
    2004-11-30 21:23:04 1CZL6n-0000iA-00 == dave@example.com T=remote_smtp defer (-4
    4): retry time not reached for any host
    2004-11-30 21:23:05 1CZL6P-0000i0-00 == dave@example.com T=remote_smtp defer (-4
    4): retry time not reached for any host
    2004-11-30 21:23:06 1CZKeq-0000gn-00 == dave@example.com T=remote_smtp defer (-4
    4): retry time not reached for any host
    2004-11-30 21:23:07 1CZHqx-0000e8-00 == dave@example.com T=remote_smtp defer (-4
    4): retry time not reached for any host
    2004-11-30 21:23:08 1CZHt3-0000eF-00 == dave@example.com T=remote_smtp defer (-4
    4): retry time not reached for any host
    2004-11-30 21:23:09 1CZKkd-0000h5-00 == dave@example.com T=remote_smtp defer (-4
    4): retry time not reached for any host
    2004-11-30 21:23:10 1CZL7R-0000iL-00 == dave@example.com T=remote_smtp defer (-4
    4): retry time not reached for any host
    2004-11-30 21:23:11 1CZLvn-0000kD-00 == dave@example.com T=remote_smtp defer (-4
    4): retry time not reached for any host
    2004-11-30 21:23:12 1CZLzT-0000kP-00 == dave@example.com T=remote_smtp defer (-4
    4): retry time not reached for any host
    2004-11-30 21:23:12 End queue run: pid=2889

    Found 1 more clue. This message sent to my user on the linux box.
    From MAILER-DAEMON Tue Nov 30 22:06:09 2004
    Return-path: <>
    Envelope-to: www-data@stampy
    Received: from mail by stampy with local (Exim 3.35 #1 (Debian))
    id 1CZMgr-0000n0-00
    for <www-data@stampy>; Tue, 30 Nov 2004 22:06:09 -0700
    X-Failed-Recipients: dave@budonk.com
    From: Mail Delivery System <Mailer-Daemon@stampy>
    To: www-data@stampy
    Subject: Mail delivery failed: returning message to sender
    Message-Id: <E1CZMgr-0000n0-00@stampy>
    Date: Tue, 30 Nov 2004 22:06:09 -0700

    This message was created automatically by mail delivery software (Exim).

    A message that you sent could not be delivered to one or more of its
    recipients. This is a permanent error. The following address(es) failed:

    dave@budonk.com
    SMTP error from remote mailer after MAIL FROM:<www-data@stampy> SIZE=1406:
    host mailhost.budonk.com [216.219.254.203]: 553 5.1.8 <www-data@stampy>...
    Domain of sender address www-data@stampy does not exist

    ------ This is a copy of the message, including all the headers. ------

    Return-path: <www-data@stampy>
    Received: from www-data by stampy with local (Exim 3.35 #1 (Debian))
    id 1CZMgo-0000ms-00; Tue, 30 Nov 2004 22:06:06 -0700
    To: dave@budonk.com
    Subject: php mail
    To: dave@budonk.com^M
    From: jbiggs@budonk.com^M
    Reply-To: jbiggs@budonk.com^M
    Message-Id: <E1CZMgo-0000ms-00@stampy>
    Sender: www-data <www-data@stampy>
    Date: Tue, 30 Nov 2004 22:06:06 -0700


    it worked man

    All any of this means to me is that something isn't configured right. Any ideas as to what?

    When I ran eximcinfig and sendmailconfig, I pretty much accepted all the defaults.

  2. #2
    Linux Enthusiast
    Join Date
    Jun 2002
    Location
    San Antonio
    Posts
    621
    It looks like your hostname is not configured correctly. If you look at the headers it reads:

    Return-path: <www-data@stampy>

    Since I am not positive on the OS, you will want to find out how and where to change your hostname, so that the command:
    Code:
    hostname
    returns a valid domain name like 'stampy.com'.

    I hope this points you in the right direction. Also, thank you for posting lots of output. It really helps in figuring out what is wrong

    Best,

    Samuel
    I respectfully decline the invitation to join your delusion.

  3. #3
    Just Joined!
    Join Date
    Nov 2004
    Posts
    39
    Thanks!
    I'm afraid I'm still at a bit of a loss.

    My distro is Debian 3.

    Would hostname be something like an environment variable that is set at the OS level or somewhere in the sendmail/exim config?

  4. #4
    Linux Enthusiast
    Join Date
    Jun 2002
    Location
    San Antonio
    Posts
    621
    It is set at the system level. Since I am not fluent in debian, all I can say is it is almost definately in /etc somewhere. You may be able to just run 'hostname stampy.com' to set it to stampy.com, but this will not hold if/when you reboot your machine. It is set at boot time by one of the scripts in /etc/rc.d/ so if you run 'grep -Ri hostname /etc/rc.d/*' you should be able to find a good starting point on where to set the variable.

    Best,

    Samuel
    I respectfully decline the invitation to join your delusion.

  5. #5
    Just Joined!
    Join Date
    Nov 2004
    Posts
    39
    ok. that got me a little further. now the email i get from the system is
    From MAILER-DAEMON Wed Dec 01 00:20:12 2004
    Return-path: <>
    Envelope-to: www-data@budonk.com
    Received: from mail by budonk.com with local (Exim 3.35 #1 (Debian))
    id 1CZOma-00006G-00
    for <www-data@budonk.com>; Wed, 01 Dec 2004 00:20:12 -0700
    X-Failed-Recipients: dave@budonk.com
    From: Mail Delivery System <Mailer-Daemon@budonk.com>
    To: www-data@budonk.com
    Subject: Mail delivery failed: returning message to sender
    Message-Id: <E1CZOma-00006G-00@budonk.com>
    Date: Wed, 01 Dec 2004 00:20:12 -0700

    This message was created automatically by mail delivery software (Exim).

    A message that you sent could not be delivered to one or more of its
    recipients. This is a permanent error. The following address(es) failed:

    dave@budonk.com
    unknown local-part "dave" in domain "budonk.com"

    ------ This is a copy of the message, including all the headers. ------

    Return-path: <www-data@budonk.com>
    Received: from www-data by budonk.com with local (Exim 3.35 #1 (Debian))
    id 1CZOma-00006C-00; Wed, 01 Dec 2004 00:20:12 -0700
    To: dave@budonk.com
    Subject: php mail
    To: dave@budonk.com
    From: jbiggs@budonk.com
    Reply-To: jbiggs@budonk.com
    Message-Id: <E1CZOma-00006C-00@budonk.com>
    Sender: www-data <www-data@budonk.com>
    Date: Wed, 01 Dec 2004 00:20:12 -0700


    it worked man
    I haven't checked the other logs. Time for sleep. Will check in the a.m. to see if anything different surfaces.

    Thanks for the help thus far

  6. #6
    Linux Enthusiast
    Join Date
    Jun 2002
    Location
    San Antonio
    Posts
    621
    It looks like you set your hostname to budonk.com, but I am not sure if that is correct. This will make exim think that anything bound for $USER@budonk.com will be delivered locally. This means it will try to forward the email into /var/spool/mail/dave (or wherever exim puts the local mail spool). If you want it to deliver externally, you have to make your hostname something different like 'laptop.budonk.com'.

    Best,

    Samuel
    I respectfully decline the invitation to join your delusion.

  7. #7
    Just Joined!
    Join Date
    Nov 2004
    Posts
    39
    Shoot, that seems to have brought back the old problem of the domain "laptop.budonk.com" not existing.

    Here's the email sent to my user on the box:
    From MAILER-DAEMON Wed Dec 01 09:34:29 2004
    Return-path: <>
    Envelope-to: www-data@laptop.budonk.com
    Received: from mail by stampy with local (Exim 3.35 #1 (Debian))
    id 1CZXQz-00004r-00
    for <www-data@laptop.budonk.com>; Wed, 01 Dec 2004 09:34:29 -0700
    X-Failed-Recipients: dave@budonk.com
    From: Mail Delivery System <Mailer-Daemon@laptop.budonk.com>
    To: www-data@laptop.budonk.com
    Subject: Mail delivery failed: returning message to sender
    Message-Id: <E1CZXQz-00004r-00@stampy>
    Date: Wed, 01 Dec 2004 09:34:29 -0700

    This message was created automatically by mail delivery software (Exim).

    A message that you sent could not be delivered to one or more of its
    recipients. This is a permanent error. The following address(es) failed:

    dave@budonk.com
    SMTP error from remote mailer after MAIL FROM:<www-data@laptop.budonk.com>
    SIZE=1417:
    host mailhost.budonk.com [216.219.254.203]: 553 5.1.8 <www-data@stampy.bud
    onk.com>... Domain of sender address www-data@laptop.budonk.com does not exist

    ------ This is a copy of the message, including all the headers. ------

    Return-path: <www-data@laptop.budonk.com>
    Received: from www-data by stampy with local (Exim 3.35 #1 (Debian))
    id 1CZXQo-00004b-00; Wed, 01 Dec 2004 09:34:18 -0700
    To: dave@budonk.com
    Subject: php mail
    To: dave@budonk.com
    From: jbiggs@budonk.com
    Reply-To: jbiggs@budonk.com
    Message-Id: <E1CZXQo-00004b-00@stampy>
    Sender: www-data <www-data@laptop.budonk.com>
    Date: Wed, 01 Dec 2004 09:34:18 -0700


    it worked man

    I did catch a line in the boot secquence that reads:
    /usr/share/sendmail/sendmail not found/executable, aborting.
    To me it sounds like it is looking for a sym link to the sendmail executable in the wrong place? Exim is starting up though. . . would it be worth it to create a sym link at /usr/share/sendmail/sendmail to /usr/sbin/sendmail?


    Also got this again from /var/log/exim/mainlog when executing the script:
    2004-12-01 09:50:19 1CZXgJ-00005R-00 <= www-data@laptop.budonk.com U=www-data
    P=local S=381
    2004-12-01 09:50:23 1CZXgJ-00005R-00 ** dave@budonk.com R=lookuphost T=remote_sm
    tp: SMTP error from remote mailer after MAIL FROM:<www-data@laptop.budonk.com>
    SIZE=1417: host mailhost.budonk.com [216.219.254.203]: 553 5.1.8 <www-data@sta
    mpy.budonk.com>... Domain of sender address www-data@laptop.budonk.com does n
    ot exist
    2004-12-01 09:50:24 1CZXgO-00005W-00 <= <> R=1CZXgJ-00005R-00 U=mail P=local S=1
    416
    2004-12-01 09:50:24 1CZXgJ-00005R-00 Error message sent to www-data@laptop.bud
    onk.com
    2004-12-01 09:50:24 1CZXgJ-00005R-00 Completed
    2004-12-01 09:50:24 1CZXgO-00005W-00 => dpassudetti <www-data@laptop.budonk.co
    m> D=localuser T=local_delivery
    2004-12-01 09:50:24 1CZXgO-00005W-00 Completed

  8. #8
    Linux Enthusiast
    Join Date
    Jun 2002
    Location
    San Antonio
    Posts
    621
    This is an error that could be fixed with masquerading in sendmail. However, with exim I am less knowledgeable. Someone else, or google, should be able to help further. Search for 'exim domain masquerading'.

    Best,

    Samuel
    I respectfully decline the invitation to join your delusion.

  9. #9
    Just Joined!
    Join Date
    Nov 2004
    Posts
    39

    thanks!!

    ok, will do.

    Thanks for getting me this far - much appreciated.

    -dave

  10. #10
    Just Joined!
    Join Date
    Nov 2004
    Posts
    39

    figured it out

    Got it to work. In case any is interested:

    It seems as though my web host's incoming mail server was rejecting the message because the header stated that the message was coming from the domain "budonk.com" (I set this when I ran eximconfig), when in fact the message was really being sent from my ISP. So I ran eximconfig again, set it so that the header would say my ISP's domain (comcast.net) and it worked like a charm.

Page 1 of 2 1 2 LastLast

Posting Permissions

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