LinuxQuestions.org
Register a domain and help support LQ
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 02-22-2013, 03:32 PM   #1
00mpa
LQ Newbie
 
Registered: Feb 2013
Posts: 8

Rep: Reputation: Disabled
Using uuencode to email a file with a .out extension


Hi,

I am trying to use uuencode to send an email with an attachment that has a .out extension. When I first coded my program I was using a different extension, and it was working; however, when I switched to using a .out file, it stopped working. Can anyone tell me why this may be happening?

Also, I know I could use Email:MIME or MIME:LITE; however, I can't download it(or any type of modules) to the unix server I am using so I have resorted to using uuencode, but if there is another command that I could use to send an email with an attachment, please let me know!!!

Thanks!
 
Old 02-22-2013, 03:35 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,359

Rep: Reputation: 3912Reputation: 3912Reputation: 3912Reputation: 3912Reputation: 3912Reputation: 3912Reputation: 3912Reputation: 3912Reputation: 3912Reputation: 3912Reputation: 3912
Quote:
Originally Posted by 00mpa View Post
Hi,
I am trying to use uuencode to send an email with an attachment that has a .out extension. When I first coded my program I was using a different extension, and it was working; however, when I switched to using a .out file, it stopped working. Can anyone tell me why this may be happening?

Also, I know I could use Email:MIME or MIME:LITE; however, I can't download it(or any type of modules) to the unix server I am using so I have resorted to using uuencode, but if there is another command that I could use to send an email with an attachment, please let me know!!!
No idea, since you don't give us any real details. Things like version/distro of Linux, what program you're using to send the email, what language you coded your program in, what error(s)/message(s) you see, etc.

Judging from the Email::MIME, I'll assume you're using Perl. And you say it was working when you had a different extension....so, why not just change the extension to what WAS working??? Rename the file?
 
Old 02-22-2013, 03:49 PM   #3
00mpa
LQ Newbie
 
Registered: Feb 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
I can't change the extension because I don't have privileges to change the file being emailed. Also, I'm using Solaris 5.10, and because I don't upkeep the server, I can't simply download a newer version. Also, I tried using Perl, but found it easier if I simply ran it by invoking csh.

My super simple piece of code:

#!/bin/csh

uuencode file1.out file1.out | mailx -s "Report" emailAddress
 
Old 02-22-2013, 03:56 PM   #4
millgates
Member
 
Registered: Feb 2009
Location: 192.168.x.x
Distribution: Slackware
Posts: 840

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Please post the error you are getting / describe in more detail in what way your code is not working as expected.
 
Old 02-22-2013, 04:00 PM   #5
00mpa
LQ Newbie
 
Registered: Feb 2013
Posts: 8

Original Poster
Rep: Reputation: Disabled
I'm not getting an error, it acts like it runs, but it never sends anything. When I was using a test file with a different extension (something other than .out) it would send the email so I know the script works. I just think that uuencode doesn't like attaching a .out file so I'm trying to figure out why and if there is anything else that I could use instead of uuencode.
 
Old 02-22-2013, 04:07 PM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,359

Rep: Reputation: 3912Reputation: 3912Reputation: 3912Reputation: 3912Reputation: 3912Reputation: 3912Reputation: 3912Reputation: 3912Reputation: 3912Reputation: 3912Reputation: 3912
Quote:
Originally Posted by 00mpa View Post
I'm not getting an error, it acts like it runs, but it never sends anything. When I was using a test file with a different extension (something other than .out) it would send the email so I know the script works. I just think that uuencode doesn't like attaching a .out file so I'm trying to figure out why and if there is anything else that I could use instead of uuencode.
It may have nothing to do with uuencode. Chances are, the extension itself may be blocked by a mail server further upstream at your company. Again, test this by just renaming the file to something else. And have you tried to run the command from the command-line, to see what it does? Have you checked with any of the administrators, to see if things are getting logged, that will give you some ideas?

Also, when you script, you really should put full paths in, to make sure things are working correctly. Instead of:
Code:
uuencode file1.out file1.out | mailx -s "Report" emailAddress
try
Code:
/path/to/uuencode file1.out file1.out | /path/to/mailx -s "Report" emailAddress
And the way you have this posted, you do realize that you'll probably overwrite the file, right?? Read the man page on uuencode, but normally it's "uuencode file1.out -o newfilename.out". You also say you're using mailx...so why even bother with uuencode? Again, read the man page on the mailx command, and use the -a flag to attach a file.

Most importantly...has that script EVER worked for you?? And do you normally use csh instead of bash?
 
  


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
Mencoder adds the extension of the original file to the output file ex: file.flv.mp4 linuxlicious Linux - General 2 04-17-2012 03:22 PM
Mencoder adds the extension of the original file to the output file ex: file.flv.mp4 linuxlicious Linux - General 1 04-15-2012 05:07 AM
Linux file extension vs Dos file Extension? manaa Linux - Newbie 6 02-12-2009 05:19 PM
bash: renaming file extension based on actual file type alekone Linux - General 9 12-28-2008 10:12 AM


All times are GMT -5. The time now is 12:22 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