Sponsored Content
Operating Systems HP-UX Email Using uuenview w/ Multiple Attachments Post 303005646 by jgt on Friday 20th of October 2017 03:23:19 PM
Old 10-20-2017
Quote:
Originally Posted by bubba77
HP-UX mbhp7640 B.11.31 U ia64 4294967295 unlimited-user license

Our database builds a MIME compliant html email, then cats that to sendmail - no problem.


Due to horrible issues with the native uuencode, we long ago began using uuenview to encode our attachments - no problem. An example is the following:
Code:
(cat Email_msg_332.html ; /usr/local/bin/uuenview -b /home/israejr/Open_POs.xls) | sendmail -t -n -v

I now need to have 2 attachments and can't figure out the syntax (I know enough to be dangerous but am not a UNIX guru). I have added both file names to the MIME at the bottom of my email:
Code:
--_boundarystring
Content-Type: application/Octet-Stream
Content-Transfer-Encoding: Base64
Content-Disposition: attachment; filename="Open_POs.xls"
Content-Type: application/Octet-Stream
Content-Transfer-Encoding: Base64
Content-Disposition: attachment; filename="Stuck_POs.xls"
--_boundarystring--

I have studied the uuenview man pages and it can handle multiple attachments and send email itself, but that is with an empty (non-html) email and we would loose all of our standard look and feel in the email.

I have tried all the following syntax:
Code:
!(cat Email_msg_332.html ; /usr/local/bin/uuenview -b /home/israejr/Open_POs.xls ; /home/israejr/Stuck_POs.xls ) | sendmail -t -n -v
!(cat Email_msg_332.html ; /usr/local/bin/uuenview -b /home/israejr/Open_POs.xls /home/israejr/Stuck_POs.xls Stuck_POs.xls) | sendmail -t -n -v
!(cat Email_msg_332.html ; /usr/local/bin/uuenview -b /home/israejr/Open_POs.xls ; /usr/local/bin/uuenview -b /home/israejr/Stuck_POs.xls ) | sendmail -t -n -v
!(cat Email_msg_332.html ; /usr/local/bin/uuenview -b /home/israejr/Open_POs.xls Open_POs.xls ; /home/israejr/Stuck_POs.xls Stuck_POs.xls) | sendmail -t -n -v

Surely there is a way to do this.

Thoughts?
i posted a script to do this a month or so ago. search delvmime.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Blocking email attachments

Dear Friends, Is there any way to block incoming emails with attachments or move them in specified directory on. Can anybody help? Yours kam (10 Replies)
Discussion started by: kamlakar
10 Replies

2. UNIX for Dummies Questions & Answers

Email Attachments

I use metasend to send an attachment to an email. The attached file has a .csv extension however when the email is received the extension is changed to .att. Does anyone know why ? I need the name to remain as .csv (1 Reply)
Discussion started by: fabbas
1 Replies

3. UNIX for Dummies Questions & Answers

Sending email attachments

Hello, I've search the forum, but I cannot find an answer to my specific question. I'm trying to send some files to my professor. Upon his request, I used the following: tar -cvf vh.tar vh_part1.c vh_part2.c vh_part3.c vh_part4.c vh_sample_run15.txt uuencode vh.tar vh.tar > proj1 mail... (2 Replies)
Discussion started by: venush
2 Replies

4. Shell Programming and Scripting

Email with messagebody and attachments

Hi Friends, I am using perl on windows environment and i wish to send out an email with body of the mail referring from a text file and attaching a file. Perl should read the body of the mail from a file say bodyofmail.txt and attach a file say attachment.txt. I would like to do both in the same... (0 Replies)
Discussion started by: ganga.dharan
0 Replies

5. HP-UX

Sending Unix files as attachments in an email

Hi, I am executing the following command in order to send a file as an attachment: mailx -s "Subject" emailID@xyz.com < Testfile.txt Instead of attaching the file Testfile.txt, it is writing the contents of the file in the email message body. Please advise on how I can send the file as an... (7 Replies)
Discussion started by: sangharsh
7 Replies

6. UNIX for Advanced & Expert Users

Email with multiple attachments & HTML body

I have a html file: # cat sample.html <html> <body> Sample HTML file</p> </body> </html> And I have two excel sheets (sheet1.xls & sheet2.xls) I want to send an email by having the sample.html as the message body and two spreadsheets as the attachments. I tried using the below command:... (12 Replies)
Discussion started by: BHM
12 Replies

7. Shell Programming and Scripting

Dynamic email attachments

Hi all, I am quite new to Unix shell scripting and I am trying to create a common function to send mail that is capable of adding multiple attachments. The script works if there is only one attachment. But when there is more than one, it just won't work. It gives a syntax message "Usage:... (3 Replies)
Discussion started by: dongzky
3 Replies

8. UNIX for Dummies Questions & Answers

Send Files as Attachments through email

Dear Members, I am trying to send a file as an attachment from the command prompt in Linux. I am using the following: (echo "Find attached Exception Report"; uuencode $DATA_TOP/out/data/$err_rpt_file $err_rpt_file)|/bin/mailx -s "***Exceptions Found" davidk@xyz.com Here err_rpt_file... (2 Replies)
Discussion started by: sandeep_1105
2 Replies

9. Shell Programming and Scripting

Email Attachments in shell script

Hi Fellas, I have a script that queries a sybase DB through isql and appends to a file, say file.csv I want to use the mail command in the shell script to email the file to me. i tried the following command but it doesn't work. can any one suggest whats wrong here. Note that i need the file... (2 Replies)
Discussion started by: Irishboy24
2 Replies

10. Shell Programming and Scripting

How to send email with multiple attachments ?

Hello , I am trying to send an email with two attachments . I have tried all previous suggestion in this forum but none worked. I could send one attachment in an email by uuencode $file "$file" | mailx -m -s "File" xxx@xx.com but unable to send multiple attachments . I have tried ... (8 Replies)
Discussion started by: RaviTej
8 Replies
UUENVIEW(1)						      General Commands Manual						       UUENVIEW(1)

NAME
uuenview - a powerful encoder for binary files SYNOPSIS
uuenview [options] file(s) DESCRIPTION
uuenview encodes a binary file into ASCII text for sending over non-8-bit electronic data channels, such as electronic mail or the usenet. uuenview is a superset of and fully backwards compatible with the standard uuencode(1) command, featuring more comfort and more flexibil- ity. Files encoded with uuenview are compatible with virtually all decoders, as long as the encoding method (see below) is supported by the remote side. If the remote side uses uudeview(1), there shouldn't be any problems at all. If properly configured, uuenview can directly send encoded files by email or to the usenet. These messages are wrapped into a proper MIME envelope, which is handy if the recipient uses MIME-compliant mail or news software. OPTIONS
ENCODING SELECTION -b Chooses the Base64 encoding method as specified by the MIME standard. -u Chooses the uuencoding method, for compatibility with uuencode(1). -y Chooses the yEncoding method. -x Chooses the now obsolete xxencoding method. -t Sends the file(s) as plain text. -q Encodes the file(s) using quoted printable encoding. These options are positional and affect the encoding of all remaining files on the command line until changed. When sending, posting or attaching files, the default is to use Base64, resulting in MIME compliant messages. Otherwise, when encoding to standard output or into a file, the default is to use uuencoding. TARGETS -o Specifies that output shall be written into files. These files will have the same base name as the source file and an extension of .001, .002 etc, depending on the number of parts required by the -lines option. The encoded files are written to the current direc- tory. -od path Same as '-o', but the encoded files are written to the given directory instead. -m email Mails the encoded file(s), each one probably split into multiple parts, to the given email address. Multiple recipients can be given as a quoted, comma-separated list. On Unix systems, mail is usually piped to sendmail(8). -p newsgroup Posts the encoded file(s), each one probably split into multiple parts, to the given newsgroup. Multiple newsgroups can be given as a quoted, comma-separated list. The inews(1) program is invoked for posting. You may have to set the NNTPSERVER enviroment variable to your news server. -a Attaches files. This feature is expected to be used from shell scripts and the like. In attach mode, a message is read from standard input, complete with headers. The files given on the command line are then "attached" to the message, which is converted, if neces- sary, to a proper MIME multipart format. The -a option can be combined with -m or -p in order to directly mail or post the result. Else, the message, complete with attachments, is written to standard output. If no target option is given, the encoded data is printed to standard output. HEADERS When mailing or posting a file, it is possible to set certain headers. Be careful to quote parameters that consist of more than one word. -s subject Set the Subject: header line. The file name and part number are automatically appended. Without this, a default subject header is generated. -f from Set the From: header line. -r reply Set the Reply-To: header line. OTHER -v Verbosely prints everything the program's trying to do. -lines Substituting lines with a number, sets the maximum number of encoded lines per part. The encoded data is automatically split into as many parts as required. Line counts less than 200 are ignored. The uuencoding and xxencoding methods encode 45k, and Base64 encodes 57k of data in 1000 lines. If this option is not specified, the default is unlimited lines per part, resulting in exactly one part. file(s) One or more filenames to be processed. To encode a file from the standard input, use a single hyphen '-' and give a filename to be used for the encoded file as the next parameter. Options may also be set in the $UUENVIEW environment variable, which is read before processing the options on the command line. NOTES
Files read from standard input can only be used once, meaning that at most one target option may be given. Output written to standard output cannot be split into multiple parts. In this case, the -lines option is ignored. uuenview must be correctly configured at compile time in order for mailing and posting to work. If it doesn't, consult your system adminis- trator. The program used for posting a file can be set at runtime using the INEWS environment variable. This setting overrides the com- pile-time configuration. Base64 is not MIME. Base64 is the encoding specified by the MIME standard, but in order for a message to become a proper MIME message, a number of headers are required. uuenview produces these headers when mailing or posting, but not when writing to a file. In this case, uuenview does not have any control over the headers. If you include Base64 output into your messages, they are not MIME-compliant! If you rename, copy or link the program to uuencode, it may act as a smart replacement for the standard, accepting the same command-line syntax. This has not been well-tested yet. EXAMPLES
uuenview -m 'root,fred@somewhere.com' uudeview.tgz Encodes the file uudeview.tgz and mails it to both your local system administrator and to your friend Fred at the Somewhere company. If you give more than one filename on the command line, each file is usually handled separately. A workaround is to send them all as attachment to a single (or empty) mail: uuenview -m root -b -a file1 file2 < /dev/null Creates an empty mail and attaches the two given files, encoded in Base64 format, and mails the result to your system administrator. SEE ALSO
uudeview(1), uuencode(1), uudecode(1), sendmail(8), inews(1). The uudeview homepage on the Web, http://www.fpx.de/fp/Software/UUDeview/ BUGS
The program does not detect error conditions when mailing or posting. Attaching only works reliably if certain headers of the input message (for example Content-Type) are not folded and shorter than 1024 char- acters. It is not possible to encode into BinHex. The program will quite likely fail to handle binary data as input for plain text or quoted-printable attachments. On plain text attach- ments, the line length (must be less than 998 characters according to MIME) is not enforced. It is not possible to set the "charset" value of plain text attachments. It is not possible to set the content type value of attachments. sendmail(8) stops reading upon a line consisting only of a single dot. uudeview does not check plain text input files against this condi- tion. (The problem is worked around when using quoted-printable, and does not exist with the other encodings.) June 2001 UUENVIEW(1)
All times are GMT -4. The time now is 06:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy