LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 11-02-2005, 07:03 AM   #1
Thinking
Member
 
Registered: Oct 2003
Posts: 249

Rep: Reputation: 30
sendmail: what does it mean if there is no queue file?


hiho@ll

what i want:

a php class which can send mails with attachements through sendmail and can check the status of the mail (queued, sent,...)

how do i do this:
i use phpmailer and add some simple code

what i have:
the mail ID
and the files which need to get checked to know the status

the problem:
i have to few knowledge of sendmail to do it 100% correctly

what i want to know:
if i send a mail with sendmail and the mail gets queued what does the following mean:
the mailqueue file isn't where it should be (does this mean, the mail has been sent or was there an error?)
how do i know if there was an error (and which error?) and how do i know if it has successfully sent? (which entry in the mail logs mean what and what if the file is not there, has it been sent or not?)

what i think:
1. i send the mail
2. the mail gets queued
3. the mail should be sent
3.1 there was an error --> the mailqueue file gets deleted (correct?) and an error log is done (which?)
3.2 the mail has been sent --> the mail file gets deleted (correct?) and an mail log entry is done (which?)
3.3 the mail has not been sent and there was a temporary error --> the mail is still there (correct?) and there is a log entry which says that the server was currently unavailable (for example, correct?)

thx@ll
 
Old 11-03-2005, 04:48 AM   #2
vireshwali
Member
 
Registered: Sep 2005
Posts: 67

Rep: Reputation: 15
1. i send the mail
2. the mail gets queued -> the mail is queued in the file /var/log/mail
3. the mail should be sent -> the status of mail is listed in the queue in the file /var/log/mail
3.1 there was an error --> the mailqueue file gets deleted (correct?) the mail queue never gets deleted. The status of the request for mail is listed in the itself and an error log is done (which?)
3.2 the mail has been sent --> the mail file gets deleted (correct?)the mail queue never gets deleted. The status of the request for mail is listed in the itself and an mail log entry is done (which?)
3.3 the mail has not been sent and there was a temporary error --> the mail is still there (correct?)the mail queue never gets deleted. The status of the request for mail is listed in the itself and there is a log entry which says that the server was currently unavailable (for example, correct?)

hope this helps.
 
Old 11-04-2005, 04:10 AM   #3
Thinking
Member
 
Registered: Oct 2003
Posts: 249

Original Poster
Rep: Reputation: 30
hiho vireshwali

i'm not sure if i understand this

Quote:
the status of mail is listed in the queue in the file /var/log/mail
this i understand
i had a look at /var/log/mail and its simply a log file (well it's in /var/log ;-) )

Quote:
the mail is queued in the file /var/log/mail
Quote:
the mail queue never gets deleted.
this i don't understand because:
if the file is queued in /var/log/mail
Q1. what do you mean with queued?
Q2. what is /var/spool/mqueue good for?
Q3. why are the mail header and body saved in /var/spool/mqueue (but i think i have a wrong understanding of the mail queue and that the mail must be saved temporary so the mail queue can work)
Q4. if the mail queue never gets deleted why i can't see a mail (if the mail has been sent) if i use the command "mailq" (which i think checks the mail queue if a mail is queued, not?)

----------------

another question i have:
Q1. is it possible to know that a mail is 100% sent if the mail gets relayed on my local network?
i'm not the sendmail professional (as you see), so i explain, what Q1 should mean:
for testing is sent a mail from host1 using sendmail command to the adress none@lkasdjfsafjdflfsdjklfsdjkldfsfjklfsdjkl.com
this domain doesn't exist, so it can't be delivered
the problem: /var/log/mail says this:
Code:
             mail:Nov  2 19:58:40 host1 sendmail[31301]: jA2IweBG031299: to=<none@lkasdjfsafjdflfsdjklfsdjkldfsfjklfsdjkl.com>, ctladdr=<root@host1> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=121032, relay=relay.host2. [[RELAYIP]], dsn=2.0.0, stat=Sent ( <74ce16e8f204698883e7a9c726a7f2e2@localhost.localdomain> Queued mail for delivery)
this means, /var/log/mail says that the mail has been sent
1. i understand why the logfile thinks the mail has been sent (the mail gets relayed and host1 can't know if the mail is realy sent)
so my question: is there a way without much programming work to let host1 know that the mail couldn't be delivered?
(if not, it's also ok, i think i can do it another way, but would be cool if it works)
Q2. if i do the mailq command i get the mails which are queued and the sendmail id
i have the sendmail id so i can search for the mail if it is still queued
now my problem is: mailq uses some status texts (not a status ID or a simple status word, its a text)
e.g.
jA48gJLa025668 5049 Fri Nov 4 09:42 <test@none.com>
8BITMIME (Deferred: Connection timed out with mx1.mail.testhost.com.)
<testemail@anotherhost.com>

so the status is: Connection timed out with mx1.mail.testhost.com
NOW this is a little hard to parse and check for the mail status
Q2.1 is it possible to tell mailq it should only display some simple status?
Q2.2 how can i use the mailq command to check the status for only one sendmail id (i get a bunch of mailids and i have to parse for the right one (btw.: i searched the man page, but i didn't really understood ;-( ))
Q2.3 is there another way to check the mail status other than mailq or parsing /var/log/mail? (or /var/log/mail.err, /var/log/mail.info, /var/log/mail.warn)

thx@ll
 
  


Reply


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
Slow SendMail Mail Queue hotstyle765 Linux - Software 0 11-03-2005 11:22 AM
SendMail Queue Problem dunmarie Linux - Software 0 06-28-2005 08:34 AM
Qmail queue and sendmail hassels Vossy Linux - Software 8 02-25-2005 06:20 PM
sendmail queue visuelz Linux - Software 0 07-17-2003 12:39 PM
Flushing the Sendmail queue DarkSTech Linux - Networking 1 02-19-2003 08:34 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:34 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration