0

I need to send the generated CSV files on regular intervals using script. I am using UUENCODE and mailx for the same.

But i need to know that is there any method/way to know that email sent successfully? Any kind of acknowledgement or feedback or something???

It is likely to report for any error. Also the file is confidential and is not intended to deviate to some foreign path.

Edit: Code being used for mailing.

subject="Something happened"
to="na734@company.com"
body="Attachment Test"
attachment=/home/iv315/timelog_file_150111.csv

(cat test_msg.txt; uuencode $attachment somefile.csv) | mailx -s "$subject" "$to"
Sachin
  • 963
  • 11
  • 31
  • AFAIK there is no secure way to acknowledge receipt of a mail, it always involves goodwill from the client. Also there is no technical way to track outgoing mails from the point they leave your server. An alternative to secure/confidential delivery of mails to an addressee is that they come and fetch the information from a secured (web-, file-) server. There you can effectively control access and authorization. – geert3 Jan 15 '15 at 07:52

1 Answers1

1

If you are using mailx and e.g. nail from the commandline you can always use the sendwait option, which is according to the fine manual:

sendwait

When sending a message, wait until the mail transfer agent 
exits before accepting further commands.     
If the mail transfer agent returns a non-zero exit status, 
the exit status of mailx will also be non-zero.

And you can also add your mail to the To: field so if you got the message there is a chance that at least the sending process was successful.

Zsolt Botykai
  • 50,406
  • 14
  • 85
  • 110
  • Could you please tell a bit further with code too. I just started with Shell and yet not that much comfortable with the same. Updated the Code i am using for sending email in question description. – Sachin Jan 15 '15 at 09:09
  • Correct me if I'm wrong, but this guarantees only that the outgoing mail was delivered to (e.g. your ISP's) outgoing mail server, not to the final destination. Also this is no solution for the confidentiality issue. My suggestion is that mail is no good match for either guarantee of delivery or guarantee of confidentiality. – geert3 Jan 15 '15 at 12:57