2

When I send an e-mail in console, like:

echo "Body of the message" | mail -s "Some clever subject" my.address@myisp.com

I would like to check the headers of the e-mail once it is sent.

They do not show up in /var/log/maillog and when I check the mailbox (using mail), there's no "Sent" folder, I can only see received e-mails.

Is there any place where the sent e-mails are stored, that would allow to check their headers? (Or do I need to setup such a place? How?)

sendmail's configuration is quite the default one (only added an alias).

zezollo
  • 390
  • 1
  • 3
  • 10

1 Answers1

3

Copying messages to a Sent folder is normally done by the Mail User Agent. I am not aware of a switch to mail that would do this. However, you could add you userid to the list of addresses on the command line to get a copy of the message. There should be a switch to deliver the copy as a blind carbon-copy.

The copy will contain a subset of the headers that exist on the message when it is finally delivered. It will contain the key headers such as To:, From:, Subject:, Message-id: and Date:. Other headers get added as the message is passed from server to server for delivery.

BillThor
  • 27,354
  • 3
  • 35
  • 69
  • Well this is at least a workaround. The switch is `-b`, it can be used like this for instance to send a blind copy to root: `echo "Body of the message" | mail -s "Some clever subject" -b root my.address@myisp.com` – zezollo Mar 22 '17 at 07:05