3

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"
  • What would count as "sent successfully"? That the email leaves the system and is accepted by the forwaring host? That it is delivered to a local user account? That it is received and correctly stored (enough disc space) at a remote system? – Anthon Jan 15 '15 at 7:55
  • That it is delivered to the concerned user is the most ideal case. But even the acceptance from forwarding host will be enough. Actually, since the data sent is confidential, and thus if, by any mean email leaves the system and doesn't reach the concerned user, it rises the probability of de-routing/mis-routing to some other path, which at the least need to be informed to security personals. – Sachin Jan 15 '15 at 9:01
7

Email was designed back when computers did not have a permanent, fast network connection to each other, on the model of postal mail. When you send an email, it gets sent to a server, which sends it to another server, and so on until the email reaches its destination. The oldest mail systems had local delivery, then there were systems where the email had to specify the list of relays until the destination, and nowadays the emails are routed automatically over networks where pretty much all computers can reach each other most of the time. Still, email remains a mail service, not an instant message service. If email is delayed on the way, for example because of a temporary network outage, the intermediate server will keep the email in reserve until the link is restored.

Due to this design, email is asynchronous. All the mailx command does is to transmit the email to a local MTA. A return code from mailx indicating success indicates that the local MTA has accepted the job of delivering the email. At that point, the email has been sent successfully. After that, it's the MTA's job to send the email to its destination. If the MTA is unable to make good on its promise to deliver, it is supposed to send a bounce message to the user who sent the email.

You cannot know for sure whether the email has been delivered to the recipient's inbox, and even that isn't useful (for example, what if the email is successfully delivered, then the computer where the inbox is stored burns in a fire?). If you need to know whether the recipient received the email, the only sure-fire way is to include human-readable instructions to acknowledge the email. (There are ways to automatically send a receipt when the email is opened in certain software, but they only work in compatible software, and they aren't reliable either, e.g. if the recipient's computer crashed immediately after opening the email.)

Knowing whether the email has been delivered doesn't tell you anything about whether other people have been able to read it. Unlike physical objects, electronic messages don't really “deviate”: they are copied, and if there are extra copies around, this cannot be detected. If the email needs to be confidential, encrypt it.

0

Surprised there is not more discussion on this.

Gilles is correct, tracking email read-by-human/received-by-server/opened-by-client-software/downloaded-by-client-software is difficult.

https://blog.filippo.io/how-the-new-gmail-image-proxy-works-and-what-this-means-for-you/

seems a few have used google analytics, not sure if this is optimistic in its ability to provide a useful result, probably useful for tracking most users of common web based services, less accurate for customised tech savvy users avoiding tracking.

https://developers.google.com/analytics/devguides/collection/protocol/v1/email

https://dyn.com/blog/tracking-email-opens-via-google-analytics/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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