1833847 Members
2348 Online
110063 Solutions
New Discussion

uuencode decoding.

 
SOLVED
Go to solution
Belinda Dermody
Super Advisor

uuencode decoding.

Couldnt do a search on the subject kept on telling page not found when I clicked search. So I have to ask the question 1st.
I am using the uuencode option pipe to mailx for file attachment within mail. I receive the file on my microsoft exchange as an attachment, but at my yahoo address and another other person using Lotus Notes the mail it comes in still uuencoded as part of the text

# If the input file is available do a uuencode for attachments and process
if [ -r $MFILE ];then
SUBJ=`cat $SUBF`
/usr/bin/ux2dos $MFILE > ${MFILE}.txt
uuencode ${MFILE}.txt ${MFILE}.txt | mailx -s "$SUBJ" "$MRCEP"

The above 2 lines are one it wrapped. The SUBJ and MRCEP are set earlie
10 REPLIES 10
harry d brown jr
Honored Contributor

Re: uuencode decoding.

James,

Try adding the "-m" option to mailx:

uuencode ${MFILE}.txt ${MFILE}.txt | mailx -m -s "$SUBJ" "$MRCEP"

live free or die
harry
Live Free or Die
Dave La Mar
Honored Contributor

Re: uuencode decoding.

Harry is correct with the -m option. "Been there, got burned, am healing."
dl
"I'm not dumb. I just have a command of thoroughly useless information."
Belinda Dermody
Super Advisor

Re: uuencode decoding.

I know about the -m option on the HP side of the house and it works. The big problem is that the HP systems are inside the firewall and I am scp copying files to the other side of the firewall to a Sun box and building the mail msg there and sending it out. The Sun mailx does not have the -m option, so I had to download and install elm there and use the
"[include ${MFILE}.txt text/plain base64]" function that Rita has been pushing.
Darrell Allen
Honored Contributor

Re: uuencode decoding.

Hi James,

I just went through some pain setting up elm using an include file. For some reason, using text/plain did not work for Notes. Using application/octet-stream did.

Just in case you run into the same issue.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Belinda Dermody
Super Advisor

Re: uuencode decoding.

Darrell, I had no problem with the text files, I did a unix to dos conversion first then the elm. My only complaint is that with elm it puts txt of the msg in the body of the mail also as an attachment and I haven't been able to get around it. That is why mailx -m is the way to go, but good ole Sun is behind times.
Darrell Allen
Honored Contributor
Solution

Re: uuencode decoding.

I'm sorry, James. I was interrupted by "work" before completing my thought and sent the reply without finishing.

To complete my thought, the text was sent to Notes even when I used text/plain but it was in the message body (even though Notes indicated an attachment). My requirement was for it to be an attachment. Using application/octet-stream worked well to both Notes and my personal Outlook client.

And as you did, I used ux2dos before sending.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Belinda Dermody
Super Advisor

Re: uuencode decoding.

Sorry Darrell, I jumped the gun also, now after your explanation. How did you set up the include file to look like. Did you replace the text/plain with application/octet-stream
By the way, I posted a question on the Sun Forum site a day ago and still haven't heard one word, very seldom do I get responses. The HP forums is just so great.
Belinda Dermody
Super Advisor

Re: uuencode decoding.

Darrell, I jumped the gun again, should have tested it first. Your response does work, but it gives me two attachments. 1. ascii.text and ATT5927.txt. But it is better than the message in the body. Some of the files might be quite large.
Darrell Allen
Honored Contributor

Re: uuencode decoding.

My include file contains:
[include file.txt application/octet-stream base64]

My script contains:
ux2dos infile >file.txt
elm -s "Subject" someone@somewhere.com
By the way, I did this on HP-UX 11.0, not Solaris. I didn't mean to give you that impression. I simply thought you might run into the same thing.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Belinda Dermody
Super Advisor

Re: uuencode decoding.

Final reply and then I am putting this too sleep. with the [include testfile.txt application/octet-stream base64] it works 99% on the Solaris 2.7 system. The only thing is that I get a double attachment, but we can live with that. The big thing this corrected the problem of having the text of the msg in the body of the mail. So thanks a lot and have a good weekend. I have 3 HP systems and about 24 sun servers and this was the first time that I really had any xplatform issues.