System Administration

not able to see the content of mail using sendmail

 
laiju.c.babu
Regular Advisor

not able to see the content of mail using sendmail

Hi Team,

 

My server is running on RHEL5.7 . I had configured sendmail on this server . But when i am sending mail i am not able to see the content of . I used the below command for sending the mail

 

 

sendmail -v <mymail id ></etc/passwd 

 

 

But on the mail which i am receiving i didnt get the content of /etc/passwd file. Could you please have a look on this.

While one of my collegue is getting the mail.

 

Regards

 

Laiju.C.Babu
3 REPLIES 3
Matti_Kurkela
Honored Contributor

Re: not able to see the content of mail using sendmail

Was the <mymail id> a local user account on the RHEL 5.7 server, or was it a remote mail account located somewhere else?

 

What was the output of the sendmail command? (If the sendmail command was successful, there might have been a problem in delivering the mail to the remote mail server or to your local inbox file.)

 

If the <mymail id> was local, the complete output might look like this:

$ /usr/sbin/sendmail -v username </etc/passwd
username... Connecting to local...
username... Sent
$

 

But if the mailbox file of the <mymail id> is on some other server, there should have been much more output. In that case, a typical indication of a successful send operation is a line like this:

$ sendmail -v <mymail id> </etc/passwd
<mymail id>... Connecting to <mailserver> via relay...
[... many lines of SMTP protocol messages skipped...]
250 2.0.0 qA29eOux018178 Message accepted for delivery
<mymail id>... Sent (qA29eOux018178 Message accepted for delivery)
Closing connection to <mailserver>.
>>> QUIT
221 2.0.0 <mailserver> closing connection

 The "qA29eOux018178" is the queue ID of the remote mail server which is unique for each message, and the "Message accepted for delivery" may be worded differently or translated depending on whether the remote server is running Sendmail or some other mail server software. But the important part is the result codes "250 2.0.0": it indicates the message was successfully sent on its way.

 

If there is no "250 2.0.0" on any line of output, there should be an error message somewhere in the output, prefixed with a 4xx or 5xx number. 4xx means a temporary error (server busy/mailbox full etc.) and sendmail will try sending the mail again later, 5xx errors are permanent errors which will cause sendmail to give up and generate a bounce message for the original sender.

 

Without seeing the error messages and/or the mail logs (usually located in /var/log/mail.log), it is impossible to help very much.

MK
redhat7012
Advisor

Re: not able to see the content of mail using sendmail

How to configure Sendmail on Linux 5.4 servers ?

 

Can anybody help me..please......

 

When i tried to send the mails using mailx command or sendmail command, mails are not going.

 

what could be the reason ?

 

 

Matti_Kurkela
Honored Contributor

Re: not able to see the content of mail using sendmail

> How to configure Sendmail on Linux 5.4 servers ?

 

Some simple things can be done by editing /etc/sendmail.cf directly, but it is not the recommended way: your changes can be overwritten when sendmail is updated, as the edited sendmail.cf may be replaced with an updated version.

 

If you need a non-default configuration, the best procedure is to install the sendmail-cf RPM, add your modifications to /etc/mail/sendmail.mc file, and run "make" in directory /etc/mail. This will automatically generate a new sendmail.cf, with your changes built-in. When sendmail is updated, the same process is automatically repeated and your modifications will be embedded in new sendmail.cf versions too.

 

"But what to put in the configuration files?"

The complete Sendmail documentation is in the book titled Sendmail, published by O'Reilly (www.oreilly.com). It has about 1300 pages, so it's kind of difficult to reproduce it here. If you run Sendmail in any significant capacity, you should buy that book. (Don't be afraid of the number of pages: most of it is reference documentation of the file formats and configuration options of Sendmail. In most cases, you should only need to read the introductory chapters, then use the rest of the book to check the syntax, requirements & limitations of any non-default options you might need.)

 

> When i tried to send the mails using mailx command or sendmail command, mails are not going.

> what could be the reason ?

 

Either the mail cannot leave the origin server and gets stuck in the mail queue, or the recipient server does something unexpected with the mail.

 

When troubleshooting mail issues, the two most important sources of troubleshooting information are:

  • the mail log (normally /var/log/maillog in RHEL 5.x)
  • the bounce message (if generated by the mail server).

Unfortunately, neither of those were attached in your post.

My magical crystal ball cannot quite focus sharply enough to read them directly from your computer, so I'm afraid I cannot help unless you can provide the troubleshooting information for analysis.

 

If you want a blind guess, it might be because the recipient server sees your server does not have appropriate DNS records and/or is not included in its list of allowed mail senders. Or if your server does not have DNS access, Sendmail might be unable to get MX records from DNS and therefore unable to find any mail servers.

MK