LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-23-2012, 03:52 PM   #1
kais1
Member
 
Registered: Dec 2008
Posts: 61

Rep: Reputation: 17
Sending attachmeng using uuencode


Hai all,

RHEL AS 4

am using the below code to send attachment

[code]
cat mail_body;uuencode MED_HEALTHCHECKUP.OUT MED_HEALTHCHECKUP.OUT )|mailx -s "INVALID OBJECTS REPORT FOR $DATE_SUFFIX" knehealthcheck@gmail.com &
[code]

and it is failing with the below error
[code]
uuencode: command not found
[code]

I tried installing sharutils rpm as below
[code]
warning: sharutils-4.6.1-2.ia64.rpm: V3 DSA signature: NOKEY, key ID 1d1e034b
error: Failed dependencies:
rtld(GNU_HASH) is needed by sharutils-4.6.1-2.ia64
[code]

How I can fix this ?. if not, is there any other alternative other than uuencode as I also don't have mutt installed

Please advise

Kai
 
Old 03-23-2012, 05:03 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Have you considered saving yourself the trouble, and using mutt?

Code:
mutt -a MED_HEALTHCHECKUP.OUT -s "INVALID OBJECTS REPORT FOR $DATE_SUFFIX" knehealthcheck@gmail.com < mail_body
mutt should be available from the install DVD/CD.


Cheers,
Tink
 
1 members found this post helpful.
Old 03-23-2012, 05:07 PM   #3
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Use mutt(1). It gets you MIME-compliance. Uuencoding attachments has arguably been superseded at this stage of the game.

P.S. RHEL4 support ended a couple weeks ago.
 
1 members found this post helpful.
Old 03-24-2012, 06:14 AM   #4
kais1
Member
 
Registered: Dec 2008
Posts: 61

Original Poster
Rep: Reputation: 17
sendmail with attachment s

Dear all,

RHEL AS 4

am using the below code to send email as attachement

[code]
ALERTDIR=/reports/final
ALRMSG_SAM=$ALERTDIR/HEALTHCHECKUP.out
if [ -f $ALRMSG_SAM ]
then
rm $ALRMSG_SAM
fi

if test -s $ALRMSG_SAM
then
/usr/sbin/sendmail -t <<EOF
From: ERP-Production Server
To: testit@gmail.com
Subject: Health Check Report
Content-Type: html
content-disposition: attachment; filename=HEALTHCHECKUP.out
EOF
fi
[code]

This doesn't work and doesn't write in /var/log/mail too. but when am using the send mail in command line like

[code]
df -h | sendmail "testit@gmail.com'
[code]

works fine ?

Any idea ?

Kai
 
Old 03-24-2012, 06:43 AM   #5
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Quote:
Originally Posted by kais1 View Post
Dear all,

RHEL AS 4

am using the below code to send email as attachement

[code]
ALERTDIR=/reports/final
ALRMSG_SAM=$ALERTDIR/HEALTHCHECKUP.out
if [ -f $ALRMSG_SAM ]
then
rm $ALRMSG_SAM
fi

if test -s $ALRMSG_SAM
then
/usr/sbin/sendmail -t <<EOF
From: ERP-Production Server
To: testit@gmail.com
Subject: Health Check Report
Content-Type: html
content-disposition: attachment; filename=HEALTHCHECKUP.out
EOF
fi
[code]

This doesn't work and doesn't write in /var/log/mail too. but when am using the send mail in command line like

[code]
df -h | sendmail "testit@gmail.com'
[code]

works fine ?

Any idea ?

Kai
Hi

probably you are using BASH, so the first thing in script should define which environment uses, like:
Code:
#!/bin/bash
echo "Hello, world."
then the IF clauses when testing variables could be more correct to use double quotes " around the var name, like:
Code:
if test -s "$ALRMSG_SAM"
then you can first try to break the code into smaller pieces to see what happens with this line:
Code:
if test -s $ALRMSG_SAM

I would try it this way:

TESTOUT=$(test -s "$ALRMSG_SAM")
if [ "$TESTOUT" ]; then
...
then you will see which part is having trouble so you can correct it. (probably you have read some of this or this)

good luck

Last edited by lithos; 03-24-2012 at 06:44 AM.
 
Old 03-24-2012, 05:31 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Merged the two closely related threads. Please keep your discussions in one spot.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
uuencode question dennismonsewicz Linux - Newbie 6 01-06-2010 05:22 PM
uuencode sherimm Linux - Software 4 01-22-2009 02:47 AM
Problem using uuencode hashbangbinbash Linux - Newbie 2 04-17-2008 09:54 AM
does fedora have uuencode? sorno Linux - Newbie 2 08-07-2005 07:40 AM
uuencode Berhanie Programming 4 11-27-2004 07:33 PM


All times are GMT -5. The time now is 05:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration