I am having issues with sending emails from my Redhat6 linux server. Each type of mailing command sendmail/mailx creates a dead.letter in the users home directory.

Examples of how I am sending things:

mailx -s "backup complete - cron bla" test@example.com

echo "Subject: hello" | sendmail test@example.com

(In a bash script)

page /usr/log/example.log | mailx -s "example - cron example" test@example.com

Dead Letter Message:

Date: Wed, 9 Jan 2019 07:20:32 -0500 From: bob Message-Id: <201901091220.x09CKWMG009291@myserver> Subject: hello

closed as too broad by roaima, user34720, Mr Shunz, Shadur, Christopher Jan 10 at 13:34

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • What is result of using date | mailx -v -s TEST test@example.com (I'm particularly interested in what the MTA splits out as a consequence of the -v flag). Also, what is in the mail logs (see /var/log)? – roaima Jan 9 at 14:25
  • Your second example is wrong. If you're going to pipe to sendmail you should have a properly formatted email. – roaima Jan 9 at 14:29
  • [tstog@serveraddress ~]$ date | mailx -v -s TEST email@example.com email@example.com... Connecting to [IPAddress] via relay... 220 ServerAddressName ESMTP Sendmail 8.14.4/8.14.4; Wed, 9 Jan 2019 09:26:34 -0500 >>> EHLO ServerAddressName 250-ServerAddressName Hello localhost [IPAddress], pleased to meet you 250 ENHANCEDSTATUSCODES >>> MAIL From:<tstog@serveraddress> 550 5.0.0 Access denied /home/tstog/dead.letter... Saved message in /home/tstog/dead.letter Closing connection to [IPAddress] >>> QUIT 221 2.0.0 ServerAddressName closing connection – TheAirborneranger Jan 9 at 14:31
  • I just put a random email in this example. Also in the above I replaced some server names and ipaddress for security reasons. – TheAirborneranger Jan 9 at 14:34
  • The second example echo "Subject: hello" | sendmail test@example.com works find with a valid email. That is just a random address I put so I don't put my own email address. – TheAirborneranger Jan 9 at 14:36

The file dead.letter is created when the mta fails when it tries to send a mail. Check all the configurations related with the mail server (credentials, mail server...) and also that you can reach the mail server, otherwise you will have that problem.

  • Also check your MTA logs to see why the message failed to send while you're checking your configs, it'll be useful to see why it actually failed to deliver, and that won't be shared to you in your mailx command. – Thomas Ward Jan 9 at 14:37
  • I'll take a look. I'll have to do some exploring to find all the config file. – TheAirborneranger Jan 9 at 15:04

Not the answer you're looking for? Browse other questions tagged or ask your own question.