3

This question already has an answer here:

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.

marked as duplicate by Anthon, jimmij, peterph, John WH Smith, Michael Homer Jan 18 '15 at 20:17

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • What you are doing is asking mail to put into message body whatever uuencode produces. If it doesn't contain the right headers, it will become plaintext mail body. – peterph Jan 18 '15 at 17:30
0

Are you perhaps facing the issue I did?
mailx attachment behaviour between ....
and need to use the "-a" option?

Pete

  • Hey. I actually tried adding the -a option but it still gave me the same problem. I eventually just rewrote this without using uuencode. – mixiul__ Jun 20 '14 at 13:39

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