- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Sending documents as attachments that may be in bi...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2002 10:15 AM
07-14-2002 10:15 AM
I am trying to figure out a way to send files as attachments by using mailx or sendmail withouth having those embeded in the body of the message. What I want to be able to send are image files, MS Word documents, spreadsheets, etc. from my HP-UX (11.0) to Outlook email accounts or any other email accounts with the original file format and I do not want the file embbeded in the body of the message. I have tried the uuencode and that did not not give me positive results, i.e.:
uuencode file.gif file.gif | mailx -m -s "Test" email@address.com
Thanks,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2002 10:41 AM
07-14-2002 10:41 AM
Re: Sending documents as attachments that may be in binary mode with mailx
When you say it doesn't give you positive results, what do you mean?
does the, as in your example, gif file become unreadable?
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2002 10:43 AM
07-14-2002 10:43 AM
Re: Sending documents as attachments that may be in binary mode with mailx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2002 10:50 AM
07-14-2002 10:50 AM
Re: Sending documents as attachments that may be in binary mode with mailx
Maybe something like metamail:
http://www.shelldorado.com/articles/mailattachments.html#mime
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2002 10:52 AM
07-14-2002 10:52 AM
Re: Sending documents as attachments that may be in binary mode with mailx
Also, try dropping the "-m", someone in this thread say's it produces "mime" type :
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x0e6b7e990647d4118fee0090279cd0f9,00.html
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2002 10:57 AM
07-14-2002 10:57 AM
Re: Sending documents as attachments that may be in binary mode with mailx
Did u try with some other files? If no, try it out. I'm using the mailx with the syntaxt (Used by you) for last 2 years. I don't have any isues.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2002 11:00 AM
07-14-2002 11:00 AM
Re: Sending documents as attachments that may be in binary mode with mailx
I also tried without the -m (yes, the -m seems to produce mime) and although I do get a chance to read the text information from my "MS word" document, I still get the document itself embedded in the body of the email. In other words, I am NOT getting an attachment, I am getting the document as body of the email. This is my syntax:
uuencode /tmp/swagent_log.doc /tmp/swagent_log.doc | mailx -s "This is a test" email@address.com
File gets embedded in body of message when received in my outlook email account.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2002 11:05 AM
07-14-2002 11:05 AM
Re: Sending documents as attachments that may be in binary mode with mailx
I just tried a "jpg" file with this syntax and all I got was garbage in the body of the message:
uuencode /tmp/friend.jpg /tmp/friend.jpg | mailx -s "This is a test" email@address.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2002 11:49 AM
07-14-2002 11:49 AM
Re: Sending documents as attachments that may be in binary mode with mailx
Here's a scripting example:
Simply include the following syntax in your mail textfile (e.g) my_message
-----------------
This is some sample text.
[include myfile1 application/octet-stream]
This is some more stuff.
[include myfile2 application/octet-stream]
That's all folks
------------------
Then, elm -s "Sample Subject" daffy@looneytoons.com < my_message
The above will generate 2 separate attachments.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2002 12:09 PM
07-14-2002 12:09 PM
Re: Sending documents as attachments that may be in binary mode with mailx
Contents of my text file (elmtst.txt)
[include /tmp/swagent_log.doc application/octet-stream]
[include /tmp/friend.jpg application/octet-stream]
My command line synstax:
elm -s "Test message" email@address.com < /tmp/elmtst.txt
Result, output:
Include file has BINARY data.
Include file has BINARY data.
Include file has BINARY data.
Include file has BINARY data.
Sending mail...
Mail sent!
I got no email. The mailx was sending the files embedded as body of the email.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-14-2002 12:53 PM
07-14-2002 12:53 PM
Re: Sending documents as attachments that may be in binary mode with mailx
My trick is to use a script calling mailx. There are a lot of perl-scripts, containing lines like:
$to="somebody@somewhere.com"
$subject="sometalking"
$cc=""
$bcc=""
$body="..."
but...
$attachements exists as well:
for this you need to have installed the perlmodule MIME:Base64
I used it to sent attachements trough a webinterface:
function mail_attachement_html($to , $sujet , $message , $fichier , $typemime , $nom , $reply , $from){
function mail_attachement_html($to , $sujet , $message , $fichier ,
$typemime , $nom , $reply , $from){
$limite = "_parties_".md5(uniqid (rand()));
$mail_mime = "Date: ".date("l j F Y, G:i")."\n";
$mail_mime .= "MIME-Version: 1.0\n";
$mail_mime .= "Content-Type: multipart/mixed;\n";
$mail_mime .= " boundary=\"----=$limite\"\n\n";
$limite2 = "_parties_".md5 (uniqid (rand()));
//Le message en texte simple pour les navigateurs qui n'acceptent pas le
HTML
$texte_simple .= "This is a multi-part message in MIME format.\n\n";
$texte_simple .= "------=$limite\n";
$texte_simple .= "Content-Type: multipart/alternative;\n";
$texte_simple .= "\tboundary=\"----=$limite2\"\n\n";
$texte_simple .= "------=$limite2\n";
$texte_simple .= "Content-Type: text/plain; \tcharset=\"US-ASCII\"\n";
$texte_simple .= "Content-Transfer-Encoding: quoted-printable\n\n";
$texte_simple .= strip_tags(eregi_replace("
", "\n",
$message));
$texte_simple .= "\n\n";
//le message en html original
$texte_html = "------=$limite2\n";
$texte_html .= "Content-Type: text/html;
charset=\"US-ASCII\"\n";
$texte_html .= "Content-Transfer-Encoding: quoted-printeble\n\n";
$texte_html .= $message;
$texte_html .= "\n\n\n------=$limite2--\n";
//le fichier
$attachement = "------=$limite\n";
$attachement .= "Content-Type: $typemime; name=\"$nom\"\n";
$attachement .= "Content-Transfer-Encoding: base64\n";
$attachement .= "Content-Disposition: attachment;
filename=\"$nom\"\n\n";
$fd = fopen( $fichier, "r" );
$contenu = fread( $fd, filesize( $fichier ) );
fclose( $fd );
$attachement .= chunk_split(base64_encode($contenu));
$attachement .= "\n\n\n------=$limite\n";
return mail($to, $sujet, $texte_simple.$texte_html.$attachement,
"Reply-to:
$reply\nFrom:
$from\n".$mail_mime);
}
So no uuencode but using base64.
Regards,
Ceesjan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2002 03:19 AM
07-15-2002 03:19 AM
Re: Sending documents as attachments that may be in binary mode with mailx
I've been using mailx and sendmail with uuencode and neither one works to send to Outlook email accounts. I am currently going to check on mpack but not sure.
Any other tips?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2002 04:45 AM
07-15-2002 04:45 AM
Re: Sending documents as attachments that may be in binary mode with mailx
Content-Type: application/octet-stream;
name="..."
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="..."
mailx generates *some* MIME headers, like
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
but that does not signify an *attachment*.
I.e. like other posters have mentioned, you need something like metamail or a new version of elm (that does/handles attachments).
If you do not get a solution here, it is probably best to re-ask the question in the messaging Forum.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2002 05:03 AM
07-15-2002 05:03 AM
Re: Sending documents as attachments that may be in binary mode with mailx
Earlier, I did not check that because that seemed the wrong way to do it, leaving *off* the MIME headers, but I just tried it 'for fun', and for *me* that works, i.e.
uuencode /etc/passwd /etc/passwd | mailx -m -s "Test" my_address@hp.com franks
gives me a correct attachment in Outlook (2000, Corporate or Workgroup version, i.e. *non*-'Internet' version).
The UNIX copy (to franks) has *no* MIME headers. Apparently this is the trigger for Outlook to be 'smart' and do the right thing when seeing
begin 444 /etc/passwd
M....
.....
M....
end
I don't know why it doesn't work for you, but it works for me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2002 05:28 AM
07-15-2002 05:28 AM
Re: Sending documents as attachments that may be in binary mode with mailx
Sorry I didn't get back to you earlier yesterday. What is the mail program on the receiving end? It has to be able to identify the attachment, otherwise it will just show the uuencode page data.
What I mean is that if you attempt to send a M$ word document, say a Word 2000 document, and the receiver only has M$ 98, when they are going to see just the uuencode data.
I just tested a M$ W2K word document, and a GIF file without any issues using:
uuencode image028.gif image028.gif | mailx -m -s "image stuff" username@place.com
Your Receiver MUST have a VIEWER that can handle the mime type.
live free or die
harry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2002 06:17 AM
07-15-2002 06:17 AM
SolutionTry "mpack". Download it from hp porting site.
http://hpux.cs.utah.edu/hppd/hpux/Users/mpack-1.5/
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2002 06:55 AM
07-15-2002 06:55 AM
Re: Sending documents as attachments that may be in binary mode with mailx
*Don't* use /etc/passwd as I did in my example. Doing so might trigger a (false) detection of the "Unix Penguin" trojan horse. For details see for example:
http://securityresponse.symantec.com/avcenter/venc/data/unix.penguin.html
In my case, a (MS-) *Windows* copy of my HP-UX .sh_history file was flagged as possibly containing the trojan horse.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2002 07:45 AM
07-15-2002 07:45 AM
Re: Sending documents as attachments that may be in binary mode with mailx
1. On the receiving end I tested with MS Outlook 98 and 2000 Corporate or Workgroup editions.
2. The solution that A. Clay provided yesterday sort of worked (weird, when I ran the test yesterday, I did not get anything, but got the emails this morning -- Maybe something wrong with the relay server at the time)
3. With A. Clay's suggestion:
=========================================
Contents of my text file (elmtst.txt)
[include /tmp/swagent_log.doc application/octet-stream]
[include /tmp/friend.jpg application/octet-stream]
My command line synstax:
elm -s "Test message" email@address.com < /tmp/elmtst.txt
Result, output:
Include file has BINARY data.
Include file has BINARY data.
Include file has BINARY data.
Include file has BINARY data.
Sending mail...
Mail sent!
=========================================
I got the two attached documents with the example shown above, but the word document was not readable (the document was created in the same system where I tried to open it) and the jpg image was distorted (you could kind of make up what it was but I came up different than the original)
The uuencode is not working, I have not tried mpack yet but just downloaded it from the depot this morning (thanks Sanjay).
Any clues?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2002 07:50 AM
07-15-2002 07:50 AM
Re: Sending documents as attachments that may be in binary mode with mailx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2002 07:52 AM
07-15-2002 07:52 AM
Re: Sending documents as attachments that may be in binary mode with mailx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2002 08:21 AM
07-15-2002 08:21 AM
Re: Sending documents as attachments that may be in binary mode with mailx
I've got your problem trying in my system, the problem is when you transfer the gif file from windows environment to UNIX environment you transfer the file as an ascii file, then when you send it by mail obtain a corrupted file.
Try to ftp the gif file to the unix box as a binary transfer method and then send it by mail with your original instruction:
uuencode file.gif file.gif | mailx -m -s "Test" email@address.com
This must works perfect, I'd checked.
Regards,
Justo.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2002 12:12 PM
07-15-2002 12:12 PM
Re: Sending documents as attachments that may be in binary mode with mailx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2002 04:49 AM
07-16-2002 04:49 AM
Re: Sending documents as attachments that may be in binary mode with mailx
Many tools to solve your pb.
On my side I'm using nail, you can download at the porting center :
http://hpux.cs.utah.edu/hppd/hpux/Networking/Mail/nail-9.30/
This tools is easy to use, And I have no pb, with any kind of attachments.
Check the file mime.type in the etc directory of this produvt after installation.
hth
Benoit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-21-2002 06:14 AM
07-21-2002 06:14 AM
Re: Sending documents as attachments that may be in binary mode with mailx
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xdf44c4c76f92d611abdb0090277a778c,00.html