I am using mailx command to send mails. I want to send some important files to team members and wud like to know if the team member has recd my email or not.
How can I achieve this ?
Currently my piece of code is
Can anyone help please....????
Also is their any simpler alternative to this issue ?
I read the sendmail manual...and understand that it provides an EXIT_STATUS.
How to handle this EXIT STATUS ? What is -N DNS option ? Can someone explain? But then with SendMail I cannot include the Subject ??? It is importtant that I have a subject line ..for me the Subject Line will conatin some important info....
Please help.....
This is from my sendmail manual, although yours might be different:
Email is actually sent as text, so the subject field is just a line in the email header that starts with:
"Subject: "
I don't know that it's possible to tell if a message has actually been delivered or not. The receiving system would somehow have to communicate to your system that it did ( or did not ) receive the message.
Please post in an appropriate technical forum, the "Post Here to Contact Site Administrators and Moderators" is for account problems and similar topics.
I am moving the thread to a more appropriate forum.
Is there any method where I can understand if the mail was sent succesfully or not ? This is becoz if the mail has not reached the user in first attempt I have to resend the email after 2 days ? Hence I need something like a log...
ALSO ...when I was going thru the Manual for sendmail ...I came across this info..hence wanted to know how to put it to use ?
-----------------------------Extracted from man Sendmail
The sendmail command returns exit status values. These exit values are defined
in the /usr/include/sysexits.h file. The following table summarizes the meanings
of these return values:
EX_CANTCREAT The sendmail command cannot create a file that the user specified.
EX_CONFIG An error was found in the format of the configuration file.
EX_DATAERR The input data was incorrect in some way.
EX_IOERR An error occurred during I/O.
EX_NOHOST The sendmail command could not recognize the specified host name.
EX_NOINPUT An input file (not a system file) did not exist or was not readable.
EX_NOPERM The user does not have permission to perform the requested operation.
EX_NOUSER The sendmail command could not recognize a specified user ID.
EX_OK The sendmail command successfully completed.
-----------------------------
Something like holding the return values ..in C..?? To create my own error log?
If I can in some way create an ErrorLog for Sent Emails...then my issue is solved....Can u guide me???
And yes ur right...
The sendmail command is not intended as a user interface routine; other commands provide user-friendly interfaces. Use the sendmail command only to deliver preformatted messages.
You cannot use sendmail to determine if the user received the email. You can determine if the sendmail command completed successfully. The return values, for example, EX_CANTCREAT, are integer values. These are defined in /usr/include/sysexits.h.
So when you run sendmail, capture the exit code. ( "$?" is the shell variable for the exit code ). Map the numeric error code to the textual description.
As far as the error log resolving your issue, I wouldn't depend on it. Maybe the users you are trying to reach have a machine that is down, or the mail delivery agent is broken on that machine. You have no way of knowing if it was delivered.
If you do want to create an error log, I recommend a shell script. Right after your "sendmail" command, capture the return code and log it.
Thanks a lot....Atleast at this point just creating an Error File using the EXIT STATUS wud be great and sufficient.
I have tried some of the EXIT_STATUS and will now enhance the code to check for more return codes.
BTW, I am a C Programmer...but have to work a lot in Unix at this new work place due to the existing environment.
Can u suggest me a book or URL ....sort of tutorial to learn how to Shell Script. Like getting return codes, or conditional programming etc...something for a beginner ?
Thanks a lot Nathan.
Hi all,
I am trying to grasp the concept between the 3 entity above.
I understand that mailx - MUA
I also understand that sendmail = MTA
1) If I have a centralized mail server (which might not be sendmail), can I just set mailhost in "/etc/hosts" to point to that mailserver and use... (7 Replies)
Hi All,
I am trying to create a zip file with all the txt files(these are in large number) in the current directory. I am able to do this operation sucessfully.
After this i want to get the status of the tar command executed and do accordingly. When i am trying with the below code, the status... (3 Replies)
I have a shell script (#!/bin/sh) that interacts with Appworx and Banner Admin. In my script I want to check the exit status of awrun before continuing. awrun can run for 10 seconds or it can run for over a minute. So my question is, will it go through my if statement before awrun may even be... (2 Replies)
Hello Guys,
I have created function which is as follow:
My function is working, but it's waiting after executing mailx command. If user will press Ctrl+d then only it is executing subsequent lines. I treid couple of options such as quit, exit, ., ETO, but it's not working. Is any one can help me?... (2 Replies)
hi,
I would like to configure mailx or sendmail to send out some mails to some users. I tried searching online for the configuration but it was kinda confusing. I thought that posting here might get someone to work with me step by step
I tried sending out mail but i did not receive in my... (4 Replies)
We require e-mails to come from one of our Solaris 10 boxes ASAP and have found that when using such things as Sendmail and Mailx all the mail goes to a Q that only fires every 15 minutes. We have tried everything we could think of to adjust this to force the Q to go every 1 minute but so far no... (3 Replies)
I'm preparing for exam and one of exams is to write own test command...
I wonder if in unix is a command which just returns exit code you specify..
I know I can easily write a function like this:
exStatus() {
return $1
}
-> my question is rather theoretical
thank you! (9 Replies)
Hi all,
I'm running a program which return 1 upon success.
But when encounters problem shell return 's '1' .
How to differentiate between them the shell return value and script return value.
Ex. function fn return '1' if executed successfully and '0' if failed. But when if shell encounters... (1 Reply)
i downloaded a text file from metalab.unc.edu called sh.txt and in this reference manual it refers to shell scripting exit status .. at the end of one of the examples that author gave an exit status of 127..
to what does a 127 exit status refer too and what is its purpose in the code.
moxxx68 (1 Reply)