LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Using uuencode to email a file with a .out extension (https://www.linuxquestions.org/questions/linux-newbie-8/using-uuencode-to-email-a-file-with-a-out-extension-4175451315/)

00mpa 02-22-2013 02:32 PM

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!

TB0ne 02-22-2013 02:35 PM

Quote:

Originally Posted by 00mpa (Post 4897711)
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?

00mpa 02-22-2013 02:49 PM

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

millgates 02-22-2013 02:56 PM

Please post the error you are getting / describe in more detail in what way your code is not working as expected.

00mpa 02-22-2013 03:00 PM

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.

TB0ne 02-22-2013 03:07 PM

Quote:

Originally Posted by 00mpa (Post 4897731)
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?


All times are GMT -5. The time now is 02:53 PM.