The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
mailx is not working outside e-mails raosurya Shell Programming and Scripting 3 08-18-2007 12:32 AM
Delete all mails using mailx or mail ninjanesto Shell Programming and Scripting 2 11-07-2006 09:16 AM
cannot send any mails using mailx ccc Debian 11 09-14-2006 08:35 AM
mailx error message : mailx: NUL changed to @ BG_JrAdmin UNIX for Dummies Questions & Answers 2 12-01-2005 10:27 AM
how to send mails to users on exchange server from sendmail/solaris(mailx) ganeshh SUN Solaris 5 11-18-2005 12:51 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-04-2006
munira_johar munira_johar is offline
Registered User
  
 

Join Date: May 2006
Posts: 4
Does Mailx store the mails sent

Hi,

I use mailx in a shell script to mail a message to the users. i wanted to know if mailx stores the mail that it sends? for eg in microsoft outlook all mails sent get stored in the outbox. is there such a facility with mailx?

if not how i can do this so that for every mail sent, a backup of that mail is left behind.

i require this as this mail is sent to the cilents and at times do not reach them. if i have the proof that the mail was sent then i can ask them to check their mail server or the receiver's mailbox as the problem is not with the mailx facility.

We use Sun OS 5.8
Please help.
  #2 (permalink)  
Old 05-04-2006
RTM's Avatar
RTM RTM is offline Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
Mailx doesn't 'store' sent mail. Check your /etc/syslog.conf to see if you are collecting mail related messages (and where they are going). Look for 'mail.info', 'mail.*', or *.* and the associated file.

If you are getting mail related messages, check for the times/sender/receipent in the logs - get the associated msg and the status.

Your mailx may have a -F option to record the message after the first receipent but it doesn't provide much info (as far as the info you need to 'track' the status). Plus, you may have an issue with disk space after a while as the file keeps building.

Check email queue with mailq command - that will show if mail is getting hung up for some reason - check your sendmail configuration with
/usr/lib/sendmail -d0.1 -bt < /dev/null
Fix any errors it finds.

Last edited by RTM; 05-04-2006 at 09:30 AM..
  #3 (permalink)  
Old 05-05-2006
munira_johar munira_johar is offline
Registered User
  
 

Join Date: May 2006
Posts: 4
Hi,

Thanks for your help. i did find a file named maillog in /var/adm which contains all the mails sent by the unix server for a day.

The maillog has records like this-
May 5 08:30:41 nus220 sendmail[29817]: k44MUbM29801: to=miamikool@otherplace.com, ctladdr=kndsep (40105/40025), delay=00:00:04, xdelay=00:00:03, mailer=relay, pri=121651, relay=cdn-mail.somewhere.com.au. [10.10.138.138], dsn=2.0.0, stat=Sent (IAA03690 Message accepted for delivery)

Does the last part stat=Sent (IAA03690 Message accepted for delivery) mean that the msg has gone successfully?

Also i tried the command /usr/lib/sendmail -d0.1 -bt < /dev/null as suggested and got the following output:
-------------------------------------------------------------------
Version 8.11.6+Sun
Compiled with: LDAPMAP MAP_REGEX LOG MATCHGECOS MIME7TO8 MIME8TO7
NAMED_BIND NDBM NETINET NETINET6 NETUNIX NEWDB NIS NISPLUS
QUEUE SCANF SMTP USERDB XDEBUG

============ SYSTEM IDENTITY (after readcf) ============
(short domain name) $w = nus220
(canonical domain name) $j = nus220.in.somewhere.com.au
(subdomain name) $m = somewhere.com.au
(node name) $k = nus220
========================================================

ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
----------------------------------------------------------------------

i dont really understand what it means? could you help me with this?

Also i would like to know how does mailx work internally? as in does it store the mails in a buffer before sending it? and what happens if the mail is not sent? where does that mail go if it was not sent successfully?

Thanks for the help in advance.

Last edited by RTM; 05-05-2006 at 07:33 AM..
  #4 (permalink)  
Old 05-05-2006
RTM's Avatar
RTM RTM is offline Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
First off, when posting info about an issue, you should change anything that is a possible way for others to 'attack' your system - you can see I changed your IP to a generic one, and any actual domain names to generic. This is for your own protection since anyone can read these forums.

Quote:
May 5 08:30:41 nus220 sendmail[29817]: k44MUbM29801: to=miamikool@otherplace.com, ctladdr=kndsep (40105/40025), delay=00:00:04, xdelay=00:00:03, mailer=relay, pri=121651, relay=cdn-mail.somewhere.com.au. [10.10.138.138], dsn=2.0.0, stat=Sent (IAA03690 Message accepted for delivery)

Does the last part stat=Sent (IAA03690 Message accepted for delivery) mean that the msg has gone successfully?
Yes, the message was accepted by the cdn-mail relay - that is probably still part of your network but it did leave your system. You should check with the person who runs cdn-mail.somewhere.com.au and see if they can verify the message was forwarded on to the receipent.


Version 8.11.6+Sun<---version of sendmail you are running
Compiled with: LDAPMAP MAP_REGEX LOG MATCHGECOS MIME7TO8 MIME8TO7
NAMED_BIND NDBM NETINET NETINET6 NETUNIX NEWDB NIS NISPLUS
QUEUE SCANF SMTP USERDB XDEBUG<-----sendmail was compiled with support for these - looks normal

============ SYSTEM IDENTITY (after readcf) ============
(short domain name) $w = nus220
(canonical domain name) $j = nus220.in.somewhere.com.au
(subdomain name) $m = somewhere.com.au
(node name) $k = nus220
========================================================
this looks correct also - there are times when DNS isn't set up correctly that these would be wrong, possibly being an issue with slow mail service or no mail service
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
----------------------------------------------------------------------
No errors in output - looks okay

Quote:
Also i would like to know how does mailx work internally? as in does it store the mails in a buffer before sending it? and what happens if the mail is not sent? where does that mail go if it was not sent successfully?
Mail will be sent to /var/spool/mqueue - it will be attempted to be sent every XX minutes (see next note). If it doesn't go, it will be attempted again every XX minutes (see next note) until XX hours. After XX hours, if the message is still not sent, the sender should recieve an email that the email still hasn't gone and is still trying. After a final attempt, the sender should get an email that it hasn't gone (for whatever reason) and sendmail has stopped trying (this is when the email would be deleted).

All the XX minute/hour stuff should be in your /etc/mail/sendmail.cf file - I believe the default is that sendmail attempts every 15 minutes to send all email in the queue. After 4 hours, it will notify the sender if it hasn't gone. After 8 hours it will notify the sender it has given up. The reason it does this is that the mail relay to the final receipent may be down - this allows email to be sent later when whatever the issue is to be resolved. These times I put may not be correct - it's been awhile since I've looked/changed them so it may just be what my server has as 'default'

Read more at www.sendmail.org
  #5 (permalink)  
Old 05-08-2006
munira_johar munira_johar is offline
Registered User
  
 

Join Date: May 2006
Posts: 4
Thank you for all your help. it has helped in understanding a lot.

i checked with the file /etc/mail/sendmail.cf file and found these entries -
# timeouts (many of these)
#O Timeout.initial=5m
#O Timeout.connect=5m
#O Timeout.iconnect=5m
#O Timeout.helo=5m
#O Timeout.mail=10m
#O Timeout.rcpt=1h
#O Timeout.datainit=5m
#O Timeout.datablock=1h
#O Timeout.datafinal=1h
#O Timeout.rset=5m
#O Timeout.quit=2m
#O Timeout.misc=2m
#O Timeout.command=1h
#O Timeout.ident=30s
#O Timeout.fileopen=60s
O Timeout.queuereturn=5d
#O Timeout.queuereturn.normal=5d
#O Timeout.queuereturn.urgent=2d
#O Timeout.queuereturn.non-urgent=7d
O Timeout.queuewarn=4h
#O Timeout.queuewarn.normal=4h
#O Timeout.queuewarn.urgent=1h
#O Timeout.queuewarn.non-urgent=12h
#O Timeout.hoststatus=30m

are these what i shd look at to find out XX mins and XX hours? Most of them are commented so does that mean that the default values (15 mins, 4 hrs and 8 hrs) will be used?

Thanks for all the help in advance.

Munira.
  #6 (permalink)  
Old 05-08-2006
RTM's Avatar
RTM RTM is offline Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
O Timeout.queuereturn=5d
O Timeout.queuewarn=4h

You would get a warning email message back to the sender after 4 hours if the email had not been sent yet. Sendmail would keep trying for 5 days before giving up and sending the original sender an email that it has stopped trying to send the original email.
Closed Thread

Bookmarks

Tags
sendmail

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate 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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:12 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0