Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to
LinuxQuestions.org , a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free.
Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please
contact us . If you need to reset your password,
click here .
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
12-11-2006, 09:10 PM
#1
LQ Newbie
Registered: Jun 2006
Posts: 8
Rep:
my sendmail suddenly stop working..
Hi, below is my sendmail script. It will run throught my cronjob.
Code:
<?
$link = mysql_connect("127.0.0.1", "mysql") or die("Could not connect: " . mysql_error());
mysql_select_db("ttmodule", $link) or die("Unable to select database: . mysql_error()");
$selectSqlOne= "SELECT * FROM indexpri ORDER BY indexPriNo ASC ";
$resultOne = mysql_query($selectSqlOne, $link);
if(!$resultOne) die("Invalid Query: " .mysql_error() ."<br>" .$selectSqlOne);
while($row1 = mysql_fetch_array($resultOne))
{
$secondaryTbl = $row1["indexSecTbl"];
$selectSqlTwo= "SELECT * FROM $secondaryTbl ORDER BY indexSecNo ASC ";
$resultTwo = mysql_query($selectSqlTwo, $link);
if(!$resultTwo) die("Invalid Query: " .mysql_error() ."<br>" .$selectSqlTwo);
while($row2 = mysql_fetch_array($resultTwo))
{
$mainTbl = $row2["mainTbl"];
$selectSqlThree = "SELECT ttNo, ttCompany, ttStatus, ttEngrAsgn, ttNewTime FROM $mainTbl where ttStatus!='Closed' ORDER BY ttNo";
$resultThree = mysql_query($selectSqlThree, $link);
if(!$resultThree) die("Invalid Query: " .mysql_error() ."<br>" .$selectSqlThree);
while($row3=mysql_fetch_array($resultThree))
{
$no=$row3["ttNo"];
$comp=$row3["ttCompany"];
$stat=$row3["ttStatus"];
$engr=$row3["ttEngrAsgn"];
$time=$row3["ttNewTime"];
$to = "tester<test@hotmail.com>";
$subject = "List Of Unclosed Tickets";
$message = "";
$message .= "Ticket Number:"."\n".$no."<br></br>"."Company:"."\n".$comp."<br></br>"."Status:"."\n".$stat."<br></br>"."Raised Date:"."\n".$time."<br></br>"."Engineer Assigned:"."\n".$engr."<br></br>"."\n------------------------------------"."<br></br>";
$headers = "From: TTM\r\n" .
'X-Mailer: PHP/' . phpversion() . "\r\n" .
"MIME-Version: 1.0\r\n" .
"Content-Type: text/html; charset=utf-8\r\n" .
"Content-Transfer-Encoding: 8bit\r\n\r\n";
}
}
}
mail($to, $subject, $message, $headers);
?>
when i do a tail -f /var/log/maillog/, it shows the following..
Code:
[root@localhost ~]# tail -f /var/log/maillog
Dec 12 11:07:19 localhost sendmail[31638]: kBBN020B029378: kBC352qo031638: sender notify: Warning: could not send message for past 4 hours
Dec 12 11:07:19 localhost sendmail[31638]: kBC352qo031638: to=<root@localhost.localdomain>, delay=00:00:00, mailer=local, pri=31870, stat=queued
Dec 12 11:07:20 localhost sendmail[31638]: kBBMj2jF029257: kBC352qp031638: sender notify: Warning: could not send message for past 4 hours
Dec 12 11:07:20 localhost sendmail[31638]: kBC352qp031638: to=<root@localhost.localdomain>, delay=00:00:00, mailer=local, pri=31870, stat=queued
Dec 12 11:07:20 localhost sendmail[31638]: kBBMe2M4029216: kBC352qq031638: sender notify: Warning: could not send message for past 4 hours
Dec 12 11:07:20 localhost sendmail[31638]: kBC352qq031638: to=<root@localhost.localdomain>, delay=00:00:00, mailer=local, pri=32318, stat=queued
Dec 12 11:07:20 localhost sendmail[31638]: kBBN028C029376: kBC352qr031638: sender notify: Warning: could not send message for past 4 hours
Dec 12 11:07:20 localhost sendmail[31638]: kBC352qr031638: to=<root@localhost.localdomain>, delay=00:00:00, mailer=local, pri=32318, stat=queued
Dec 12 11:07:20 localhost sendmail[31638]: kBBMt1j0029338: kBC352qs0
31638: sender notify: Warning: could not send message for past 4 hours
Dec 12 11:07:20 localhost sendmail[31638]: kBC352qs031638: to=<root@localhost.localdomain>, delay=00:00:00, mailer=local, pri=32318, stat=queued
Dec 12 11:07:20 localhost sendmail[31638]: kBBMo1F6029298: kBC352qt031638: sender notify: Warning: could not send message for past 4 hours
Dec 12 11:07:20 localhost sendmail[31638]: kBC352qt031638: to=<root@localhost.localdomain>, delay=00:00:00, mailer=local, pri=32318, stat=queued
Dec 12 11:07:21 localhost sendmail[31638]: kBBN52Yv029421: kBC352qu031638: sender notify: Warning: could not send message for past 4 hours
Dec 12 11:07:21 localhost sendmail[31638]: kBC352qu031638: to=<root@localhost.localdomain>, delay=00:00:00, mailer=local, pri=32318, stat=queued
Dec 12 11:07:21 localhost sendmail[31638]: kBBMj2Kv029258: kBC352qv031638: sender notify: Warning: could not send message for past 4 hours
Dec 12 11:07:21 localhost sendmail[31638]: kBC352qv031638: to=<root@localhost.localdomain>, delay=00:00:00, mailer=local, pri=32318, stat=queued
Dec 12 11:08:01 localhost sendmail[31683]: kBC361pK031683: from=root, size=384, class=0, nrcpts=1, msgid=<200612120306.kBC361pK031683@localhost.localdomain>, relay=root@localhost
Dec 12 11:08:01 localhost sendmail[31683]: kBC361pK031683: to=awhanwei<aw_hanwei@hotmail.com>, delay=00:02:00, mailer=esmtp, pri=30384, dsn=4.4.3, stat=queued
Dec 12 11:08:01 localhost sendmail[31681]: kBC361Bd031681: from=root, size=328, class=0, nrcpts=1, msgid=<200612120306.kBC361Bd031681@localhost.localdomain>, relay=root@localhost
Dec 12 11:08:01 localhost sendmail[31695]: kBC381R7031695: SYSERR(root): hash map "Alias0": missing map file /etc/mail/aliases.db: No such file or directory
Dec 12 11:08:01 localhost sendmail[31695]: kBC381R7031695: from=<root@localhost.localdomain>, size=607, class=0, nrcpts=1, msgid=<200612120306.kBC361Bd031681@localhost.localdomain>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Dec 12 11:08:01 localhost sendmail[31695]: kBC381R7031695: to=<root@localhost.localdomain>, delay=00:00:00, mailer=local, pri=30607, stat=queued
Dec 12 11:08:01 localhost sendmail[31681]: kBC361Bd031681: to=root, ctladdr=root (0/0), delay=00:02:00, xdelay=00:00:00, mailer=relay, pri=30328, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (kBC381R7031695 Message accepted for delivery)
my sendmail suddenly stop working.. can anyone troubleshoot for me??
thanks...
01-11-2007, 11:50 PM
#2
Member
Registered: Dec 2005
Location: New York
Distribution: Debian/GNU
Posts: 235
Rep:
I'm not sure what the source code you posted has to do with the question. It looks like a script to send out an email containing some information. I don't see how its relevant.
I think the problem is whatever's making up the domain name localhost.localdomain . I think that's going to be parsed as a FQDN, and the resolver will try and turn it into an IP address. But that's just a guess.
01-12-2007, 02:06 AM
#3
Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep:
It certainly looks like you are missing an alias file you have referenced. I use postfix, so can't tell you the db build command. Try man aliases - it should give you the sendmail command to create the aliases db from the aliases file (in postfix is postalias filename)
Thread Tools
Search this Thread
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
All times are GMT -5. The time now is 09:02 AM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News