problem between php and sendmail

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bouboul
Forum Commoner
Posts: 28
Joined: Sat Oct 25, 2003 4:08 am

problem between php and sendmail

Post by bouboul »

Hi, I have been trying to get PHP to send out using my Sendmail configuration and it's not happening., while in my php.ini i can see that php is configured in such a way that it should work with sendmail (sendmail_path = /usr/sbin/sendmail -t -i)

in maillog i'm getting :


Dec 28 11:54:08 dyn-10-213 sendmail[1633]: hBS9s8GJ001633: from=apache, size=62, class=0, nrcpts=1, msgid=<200312280954.hBS9s8GJ001633@dyn-10-213.nur.local>, relay=apache@localhost
Dec 28 11:54:08 dyn-10-213 sendmail[1635]: hBS9s8r7001635: SYSERR(root): hash map "Alias0": unsafe map file /etc/aliases.db:
Permission denied
Dec 28 11:54:08 dyn-10-213 sendmail[1635]: hBS9s8r7001635: from=<apache@dyn-10-213.nur.local>, size=340, class=0, nrcpts=1, msgid=<200312280954.hBS9s8GJ001633@dyn-10-213.nur.local>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Dec 28 11:54:08 dyn-10-213 sendmail[1633]: hBS9s8GJ001633: to=root@dyn-10-213.nur.local, ctladdr=apache (48/48), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30044, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (hBS9s8r7001635 Message accepted for delivery)
Dec 28 11:54:08 dyn-10-213 sendmail[1636]: hBS9s8r7001635: SYSERR(root): hash map "Alias0": unsafe map file /etc/aliases.db:
Permission denied
Dec 28 11:54:08 dyn-10-213 sendmail[1636]: hBS9s8r7001635: to=<root@dyn-10-213.nur.local>, ctladdr=<apache@dyn-10-213.nur.local> (48/48), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30576, dsn=5.3.0, stat=unknown mailer error 1
Dec 28 11:54:08 dyn-10-213 sendmail[1636]: hBS9s8r7001635: hBS9s8r7001636: DSN: unknown mailer error 1
Dec 28 11:54:08 dyn-10-213 sendmail[1636]: hBS9s8r7001636: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31600, dsn=5.3.0, stat=unknown mailer error 1
Dec 28 11:54:08 dyn-10-213 sendmail[1636]: hBS9s8r7001636: hBS9s8r8001636: return to sender: unknown mailer error 1
Dec 28 11:54:08 dyn-10-213 sendmail[1636]: hBS9s8r8001636: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=32624, dsn=5.3.0, stat=unknown mailer error 1
Dec 28 11:54:08 dyn-10-213 sendmail[1636]: hBS9s8r7001636: Losing ./qfhBS9s8r7001636: savemail panic
Dec 28 11:54:08 dyn-10-213 sendmail[1636]: hBS9s8r7001636: SYSERR(root): savemail: cannot save rejected email anywhere




here are the code i've writtten :

<?php
$to = "root@dyn-10-213.nur.local";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body))
{
echo("<p>Message sent!</p>");
}
else
{
echo("<p>Message delivery failed...</p>");
}
?>

how can i solve this problem ?
User avatar
Derfel Cadarn
Forum Contributor
Posts: 193
Joined: Thu Jul 17, 2003 12:02 pm
Location: Berlin, Germany

Post by Derfel Cadarn »

Have you tried it using an existing e-mail-adress instead of that root@dyn-10-213.nur.local address?
Or have you tried it from an external server (I mean: not being your own pc)?

And do you promise you're not developing a spam-script? :D
Post Reply