Operating System - HP-UX
1752580 Members
5028 Online
108788 Solutions
New Discussion юеВ

External Mail Attachment Shows as Inline Text Versus Attachment

 
SOLVED
Go to solution
ES UNIX Team
Advisor

External Mail Attachment Shows as Inline Text Versus Attachment

I have been poking around a few threads and have not found anything that works for my situation. We are trying to send a postscript file as an attachment with mail. Everything is OK for internal mail, but once it tries to go outside of our organization it only shows as inline text. Here's part of the script that is relevant to the issue:

uuencode ${psfile} < ${psfile} > temp_file
mailx -r email@yahoo.com < temp_file

When I check the yahoo account this is what I see:

begin 644 /homea/root/00091.ps
M)2%04RU!9&]B92TS+C`-"B4E5&ET;&4Z(`T*)25#M+F1L;"!697)S:6]N(#4N,`T*)25#M-3HQ.C(-"B4E1F]R.B!G;6EL;&EG86X-"B4E0F]U;F1I;F=";W@Z("AA=&5N
M9"D-"B4E4&%G97,Z("AA=&5N9"D-"B4E3W)I96YT871I;VXZ(%!OM#0HE)5!A9V5/MM871E;F0I#0HE)41O8W5M96YT1&%T83H@0VQE86XW0FET#0HE)51A
I have also tried the -m for the mailx with no avail. Any suggestions appreciated and will be awarded points.
10 REPLIES 10
Mel Burslan
Honored Contributor

Re: External Mail Attachment Shows as Inline Text Versus Attachment

This method that you used, was working up until few months ago. I used to be able to send email attachments as follows:

uuencode filename filename | mailx -s "see attachment" user@domain.com

I know I have not changed any settings on my end as far as sendmail/mail goes. The relay server of my organization however, is a microsoft exchange server and gets patched and updated regularly. If you are in the same situation as well, contact your mail administrators to find a solution like they treat uuencoded text as attachments or they can give you some header strings to inject at the begiining of your uuenceded text.

I personally did not have time to do this myself. It is on my list but too low on the totem pole for the time being
________________________________
UNIX because I majored in cryptology...
Mel Burslan
Honored Contributor

Re: External Mail Attachment Shows as Inline Text Versus Attachment

If you can sacrifice to reply to and subject fields for the simplicity for the time being, I think sendmail is your answer

uuencode myfile.jpg myfile.jpg > tempfile
cat tempfile | sendmail user@yahoo.com

is working for me. I am receiving it as an attachment instead of uuencoded garble.

the subject line can also be inserted before the uuencoded text but requires a little finess as follows:

echo "Subject: Hello attached world" > newtempfile
echo "Reply-to: mel@somedomain.com" >> newtempfile
echo " " >> newtempfile # this is header separator
cat tempfile >> newtempfile

cat newtempfile | sendmail user@yahoo.com

Hope this helps
________________________________
UNIX because I majored in cryptology...
ES UNIX Team
Advisor

Re: External Mail Attachment Shows as Inline Text Versus Attachment

Mel,

Thanks for your help. I tried both of these and still no dice. I am fairly certain that this has something to do with the Lotus Notes box that is relaying out to the Internet. No word from the admins that own the box in question.

I will keep posting with further updates on my end.
Mel Burslan
Honored Contributor

Re: External Mail Attachment Shows as Inline Text Versus Attachment

Oh, I see. Your shop is one of the last defenders of lotus/domino suite. Ours is caught up with the times and downgraded to MS Exchange in the past :)
________________________________
UNIX because I majored in cryptology...
Alan Meyer_4
Respected Contributor

Re: External Mail Attachment Shows as Inline Text Versus Attachment

Hey, it could be worse, they could be on GroupWise...
" I may not be certified, but I am certifiable... "
Bejoy C Alias
Respected Contributor

Re: External Mail Attachment Shows as Inline Text Versus Attachment

Hi,
When u send mails using uuencode and mailx , it will not add any mime headers in ur mail regarding the attachment . But the sent mails will be readable in some mail clients like outlook , but not readable in yahoo , rediff etc. So for sending mails with mime attachments u need to have a mail sending program which should be mime compliant like 'mutt'. So install mutt and send attachments using mutt instead of mailx.
Be Always Joy ......
ES UNIX Team
Advisor

Re: External Mail Attachment Shows as Inline Text Versus Attachment

Would it make a difference if I used sendmail instead of mailx? I would be open to that as well if it proves to be a quicker fix versus installing additional software. If I do go the software route, I am looking at installing on 120+ production boxes and it is not worth the political red tape effort.

Also is there a way where I could just inject my own MIME header into the document to make it more email friendly?

Thanks again to everybody for the assistance.
Mel Burslan
Honored Contributor

Re: External Mail Attachment Shows as Inline Text Versus Attachment

As yo may already know, email handling systems are very dumb. They do not understand and/or relay ascii characters which are not readible by you or me. Email's main purpose is to transfer written document, not attachments etc. So, every piece of binary attachment first needs to go thru a text conversion process. The process of attaching a binary document to email message is actually converting it to human readible form (let this be via uuencode or some other way) then telling the system, via MIME headers that text stops here and attachment starts. So, you sure can inject your own mime headers. For a detailed explanation of email headers, especially MIME, visit this page :

http://mailformat.dan.info/headers/mime.html

or for all email headers:

http://mailformat.dan.info/headers

hope this helps.
________________________________
UNIX because I majored in cryptology...
Rita C Workman
Honored Contributor
Solution

Re: External Mail Attachment Shows as Inline Text Versus Attachment

Well, it's a thread that is a bit old, but maybe applicable.
As was mentioned you need to look at how the mail is handling with respect to MIME.
We send mail & all sorts of types of attachements and find using the [include] method works well (and cheaply) for us, since it required no further costs.
You can purchase 'mutt' or another third party software to handle this if you like or just.
Here is but one of the threads I recommend reading:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=198775

There are more..just search for MIME attachments

Rgrds,
Rita