Unix Technical Forum

sending email attachment via command line on HPUX11 to an external address

This is a discussion on sending email attachment via command line on HPUX11 to an external address within the HP-UX Operating System forums, part of the Unix Operating Systems category; --> Hello I am having trouble with sending an email attachment from the command line to an external email address(one ...


Go Back   Unix Technical Forum > Unix Operating Systems > HP-UX Operating System

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-16-2008, 07:42 PM
stevan.popovic@orange.net
 
Posts: n/a
Default sending email attachment via command line on HPUX11 to an external address

Hello

I am having trouble with sending an email attachment from the command
line to an external email address(one which is not work related). When
the email is sent the external recipient gets it but the attachment is
in the main body of the email. Yet when the email is sent to an
internal company address the attachment is in the correct place.

This is what I have used

ux2dos report.csv | uuencode report_a.csv | mailx -m -s "report info"
external@company.outthere

Any ideas?

Regards

Stevan

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-16-2008, 07:42 PM
Pavel Kucera
 
Posts: n/a
Default Re: sending email attachment via command line on HPUX11 to an external address

I send email attachment this way...

/usr2/baanIV/script/cstocs il2 1250 /netbackup/nakup/file > /tmp/file
uuencode /tmp/file file | mailx -s 'Subject' username@neco.cz
rm /tmp/file


--

Pavel K.

<stevan.popovic@orange.net> píse v diskusním príspevku
news:1137582298.639156.296780@z14g2000cwz.googlegr oups.com...
> Hello
>
> I am having trouble with sending an email attachment from the command
> line to an external email address(one which is not work related). When
> the email is sent the external recipient gets it but the attachment is
> in the main body of the email. Yet when the email is sent to an
> internal company address the attachment is in the correct place.
>
> This is what I have used
>
> ux2dos report.csv | uuencode report_a.csv | mailx -m -s "report info"
> external@company.outthere
>
> Any ideas?
>
> Regards
>
> Stevan
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-16-2008, 07:42 PM
Mikko Nahkola
 
Posts: n/a
Default Re: sending email attachment via command line on HPUX11 to an external address

stevan.popovic@orange.net wrote:

> I am having trouble with sending an email attachment from the command
> line to an external email address(one which is not work related). When
> the email is sent the external recipient gets it but the attachment is
> in the main body of the email. Yet when the email is sent to an
> internal company address the attachment is in the correct place.


So is your border mail gateway doing something funny to the mail then?
A virus scanner that disassembles the message, scans the attachments and
then tries to reassemble it, maybe?

Besides ... are you using similar client applications for reading the
mail? They'll often behave very differently ...

> This is what I have used
> ux2dos report.csv | uuencode report_a.csv | mailx -m -s "report info"
> external@company.outthere
> Any ideas?


Some, although that command line does look just fine and it _should_
work.

One, I would say that such an uuencoded attachment _is_ in the main body
of the message, if things are working corretly, but the mail client may
be found to display it otherwise anyway. What are you using there?

Two, I have seen uuencoded attachments treated _really_ oddly in
scanners that expect MIME format. All too many tools only know how to
handle one of the formats. Too bad that there's no MIME-aware
equivalent to mailx in HP-UX by default ...




--
Mikko Nahkola <mnahkola@trein.ntc.nokia.com>
#include <disclaimer.h>
#Not speaking for my employer. No warranty. YMMV.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-16-2008, 07:43 PM
Paul Seyfried
 
Posts: n/a
Default Re: sending email attachment via command line on HPUX11 to an externaladdress

Mikko Nahkola schrieb:
> stevan.popovic@orange.net wrote:
>
>
>> This is what I have used
>> ux2dos report.csv | uuencode report_a.csv | mailx -m -s "report info"
>> external@company.outthere
>> Any ideas?

>
> Some, although that command line does look just fine and it _should_
> work.
>

Maybe it will work if it doesn't just look fine, but has a second
parameter for uuencode (uuencode xx xx) as in Pavels example ?


Paul
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 01-16-2008, 07:43 PM
Mikko Nahkola
 
Posts: n/a
Default Re: sending email attachment via command line on HPUX11 to an external address

Paul Seyfried wrote:
> Mikko Nahkola schrieb:
>> stevan.popovic@orange.net wrote:
>>
>>
>>> This is what I have used
>>> ux2dos report.csv | uuencode report_a.csv | mailx -m -s "report info"
>>> external@company.outthere
>>> Any ideas?

>>
>> Some, although that command line does look just fine and it _should_
>> work.
>>

> Maybe it will work if it doesn't just look fine, but has a second
> parameter for uuencode (uuencode xx xx) as in Pavels example ?


He also had the uuencode read it from a temporary file, not STDIN,
didn't he? If there's only one argument, it reads from STDIN, if two, it
reads from a file specified in the first argument:


SYNOPSIS
uuencode [source] remotedest

uudecode [file]

DESCRIPTION
uuencode and uudecode can be used to send a binary file to another
machine by means of such services as elm(1), mailx(1), or uucp(1) (see
elm(1), mailx(1), and uucp(1)).

uuencode takes the named source file (default standard input) and
produces an encoded version on the standard output. The encoding uses
only printing ASCII characters, includes the original mode of the
input file, and preserves the value of the remotedest argument which
is the intended name for the file when it is restored later on the
remote system.


Heh, the BSD-descended uuencode man page (on some Linuxes and such) has
one example and it reads from STDIN (pipe); the one on HP-UX has one
example and it reads from a file.


--
Mikko Nahkola <mnahkola@trein.ntc.nokia.com>
#include <disclaimer.h>
#Not speaking for my employer. No warranty. YMMV.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 01-16-2008, 07:43 PM
Crveni
 
Posts: n/a
Default Re: sending email attachment via command line on HPUX11 to an external address

Hello

I tried Pavels method of sending the attachment to an external address.
But the same thing happens attachment is in body of the message. When
it is sent to an internal address then the attachment displays
perfectly fine.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 01-16-2008, 07:43 PM
Florian Anwander
 
Posts: n/a
Default Re: sending email attachment via command line on HPUX11 to an externaladdress

Hi Crveni

> I tried Pavels method of sending the attachment to an external address.
> But the same thing happens attachment is in body of the message. When
> it is sent to an internal address then the attachment displays
> perfectly fine.


Perhaps the mailreader of the external adress does not understand
uuencoding.
You may try mimencode (its not HPUX, but was available in the
portingcenter). There was also mpack and mimekit.

Florian
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 01-16-2008, 07:43 PM
Michael
 
Posts: n/a
Default Re: sending email attachment via command line on HPUX11 to an external address


try

ux2dos report.csv | uuencode report_a.csv report_a.xxx | mailx -m -s
"report info" exter...@company.outthere
if this resolves the problem , then delete 'csv' extention from windows
registers or edit it.

thanks
Michael

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 01-16-2008, 07:45 PM
Ulrich Windl
 
Posts: n/a
Default Re: sending email attachment via command line on HPUX11 to an external address

"Michael" <mxayahoo@gmail.com> writes:

> try
>
> ux2dos report.csv | uuencode report_a.csv report_a.xxx | mailx -m -s
> "report info" exter...@company.outthere
> if this resolves the problem , then delete 'csv' extention from windows
> registers or edit it.


hi!

Actually that doesn't send an attachment, but an enclosure. While this still
works in a UNIX environment, it's considered obsolete in the MIME world. For
Linux there's a "uuenview" that builds proper MIME attachments. I've also
written a primitive program that will build messages with attached files.

Regards,
Ulrich


>
> thanks
> Michael

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:52 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com