The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Working With Multiple Boot Environments on OpenSolaris iBot Solaris BigAdmin RSS 0 12-03-2008 09:20 AM
uuencode not working 150177 Linux 1 08-12-2008 01:46 PM
Working with multiple home directories. trey85stang Shell Programming and Scripting 11 05-16-2008 03:45 AM
sed: working with multiple lines orno Shell Programming and Scripting 3 11-14-2007 06:28 AM
Multiple rsh in a script not working praphul Shell Programming and Scripting 3 05-31-2005 08:53 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-21-2009
pinnacle pinnacle is offline
Registered User
  
 

Join Date: Apr 2009
Posts: 182
uuencode not working for multiple files

Hi,

I have gone through the other related post but are of no help for me

I am sending multiple files as attachement.
The first file comes fine as an attachement but the other files are coming as binary.

For people with older version of email software they can see all attachements but the people with new version can see only the first attachement.
I have tried the following code but still the same problem.


Code:
mailx -s "test" ABC@XYZ.com << EOF
`/usr/bin/uuencode IJK.csv IJKM.csv`
`/usr/bin/uuencode IOU.csv IOLUA.csv`
EOF



Code:
(uuencode   IJK.csv IJKM.csv; uuencode -m IOU.csv IOLUA.csv) | mailx -s "test" ABC@XYZ.com


I want to fix the problem from unix side.

Appreciate help
  #2 (permalink)  
Old 06-02-2009
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderator ala Mode
  
 

Join Date: Feb 2007
Location: Innsbruck, Austria
Posts: 1,889
UNIX mail utilities long predated the attachment schemes improvised in the mid 90's. You'll need to use a specialized utility, a custom perl-script, or a full-fledged mail program (such as pine). Here's a perl script to help; but it will require some modules (MIME::Lite and dependencies) to be installed. It only does one attachment at a time, but you can modify it, right?

Code:
#!/usr/bin/perl -w
use MIME::Lite;
use Getopt::Std;
our ($opt_d,$opt_s,$opt_f, $opt_h);
getopt('ds:f:h:');

# Specify the mailhub with -h (or localhost used)
# Specify recipients on the command line
# Specify the file to be attached with -f (only one)
# Subject with -s

### Create a new multipart message:
my $msg = MIME::Lite->new(
   From    => $ENV{USER} . '@' . `hostname -f`,
   Subject => $opt_s,
   Type    => 'multipart/mixed'
);

### Add parts (each "attach" has same arguments as "new"):
my (@text) = <STDIN>;
(scalar(@text)) and $msg->attach(
   Type     => 'TEXT',
   Data     => \@text
);

$opt_f and $msg->attach(
   Type     => 'application/zip',
   Path     => $opt_f,
   Filename => $opt_f,
   Disposition => 'attachment'
);

### use Net:SMTP to do the sending
for (@ARGV) {
  $msg->replace('To',$_);
  $msg->send('smtp',($opt_h || "localhost"), Debug=> ($opt_d ? 1 : 0) );
}

Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:05 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0