LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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

Reply
 
Search this Thread
Old 12-11-2006, 09:10 PM   #1
uthinkicare
LQ Newbie
 
Registered: Jun 2006
Posts: 8

Rep: Reputation: 0
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...
 
Old 01-11-2007, 11:50 PM   #2
dombrowsky
Member
 
Registered: Dec 2005
Location: New York
Distribution: Debian/GNU
Posts: 235

Rep: Reputation: 31
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.
 
Old 01-12-2007, 02:06 AM   #3
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
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)
 
  


Reply

Tags
sendmail, sourcecode


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ATI fglrx drivers suddenly stop working NosLycn Debian 1 08-10-2006 07:28 PM
Sendmail port suddenly not accepting zuckerj Linux - Networking 1 09-27-2004 03:12 AM
Sendmail port suddenly not accepting zuckerj Linux - General 3 09-26-2004 10:23 PM
keyboard and mouse suddenly stop working TexasDex Linux - Hardware 2 06-04-2004 11:26 PM
Keyboard and mouse suddenly stop working (SuSE 9.0) tygernoot Linux - Hardware 1 05-13-2004 05:48 PM


All times are GMT -5. The time now is 05:14 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration