PDA

View Full Version : Linux FIX: An e-mail delivered to gmail has "noname" attachment instead of text



Fli
05-27-2017, 10:20 AM
How to fix the issue where you send an e-mail from within Linux, it is delivered to Gmail with "noname" attachment and contains no text.

I want the message to be text, not an "noname" file.

I found solution here (https://stackoverflow.com/questions/10343106/linux-mail-file-log-has-content-type-application-octet-stream-a-noname-attac).

turn:

cat somefile | mail -s "subject" [email protected]

into:

cat -v somefile | mail -s "subject" [email protected]


-v, --show-nonprinting
use ^ and M- notation, except for LFD and TAB

but what if i do not use cat?

This worked to get rid of noname attachment and show the output as e-mail text:

/bin/sh /path/to/script | tr -d \\r | mail -s "subject" [email protected]