I am in the process of trying to run a script which usually sits on an AIX machine on its new host Linux node.
The code I am running looks like this:
(uuencode $path/info.dat info.csv; uuencode $RESULTS results.log) | mail -s "Info" $MAIL_RECIPIENTS
So normally what this does is take the .dat file and standard outs it in a csv format - and sends the mail with no body but just the info.csv and results.log attached.
What is actually happening is the encoded output that uuencode produces (if you were to just run it independently) is being sent in the message body and there are no attachments.
The email body looks like this:
begin 775 info.csv
M+3`U+C`S+C4S+C(Q-#`W."(L(D%55$]314Y$("`B+")!551/4T5.1"`@(BPB
etc..
etc...
end
begin 775 results.log
M+3`U+C`S+C4S+C(Q-#`W."(L(D%55$]314Y$("`B+")!551/4T5.1"`@(BPB
etc...
etc...
end
The version of uuencode on the new machine:
uuencode (GNU sharutils) 4.7
Copyright (C) 1994, 1995, 1996, 2002, 2005, 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
mail
to put into message body whateveruuencode
produces. If it doesn't contain the right headers, it will become plaintext mail body. – peterph Jan 18 '15 at 17:30