Discussion:
uuencode (GNU sharutils) 4.7
(too old to reply)
srihari D
2016-02-23 00:12:39 UTC
Permalink
Hi,

We are experiencing issues with uuencode, we wanted to send files as
attachments by using uuencode, but it's displaying the contents of file as
body of the email. Below is the syntax being used, please help me on this
issue.

uuencode myfile.txt Display_name.txt|mail ***@gmail.com

Regards,
Srihari Dusi.
Bob Proulx
2016-02-23 04:43:24 UTC
Permalink
Post by srihari D
We are experiencing issues with uuencode, we wanted to send files as
attachments by using uuencode, but it's displaying the contents of file as
body of the email. Below is the syntax being used, please help me on this
issue.
The above does not "attach" the file to the email. The above inserts
the output of uuencode into the body of the message. There is no
attachment in the above.

In the above uuencode is working as it has been designed to work. All
is correct.

These days you probably should want to use MIME attachments instead of
uuencode. I am not saying anything bad about uuencode. It does
exactly what it does and the command is still needed in order to
access uuencoded files. But these days MIME attachments are generally
the prefered method.

I hesitate to suggest a way to do attachments because it depends so
much upon your environment. But 'mutt' handles attachments well.

echo Attached is the myfile.txt file |
mutt -s "subject line here" -a myfile.txt -- ***@gmail.com

Bob
srihari D
2016-02-23 20:23:43 UTC
Permalink
Okay thanks for your email,

Actually we use the same syntax to attach and send emails on our AIX
server, it was doing the same. So thought it will do the same on RHEL
server as well,

Syntax on AIX: uuencode file.txt file.txt|mail ***@gmail.com

above used to send emails with file.txt as attachment.
Post by Bob Proulx
Post by srihari D
We are experiencing issues with uuencode, we wanted to send files as
attachments by using uuencode, but it's displaying the contents of file
as
Post by srihari D
body of the email. Below is the syntax being used, please help me on this
issue.
The above does not "attach" the file to the email. The above inserts
the output of uuencode into the body of the message. There is no
attachment in the above.
In the above uuencode is working as it has been designed to work. All
is correct.
These days you probably should want to use MIME attachments instead of
uuencode. I am not saying anything bad about uuencode. It does
exactly what it does and the command is still needed in order to
access uuencoded files. But these days MIME attachments are generally
the prefered method.
I hesitate to suggest a way to do attachments because it depends so
much upon your environment. But 'mutt' handles attachments well.
echo Attached is the myfile.txt file |
Bob
Bob Proulx
2016-02-23 22:02:12 UTC
Permalink
Post by srihari D
Okay thanks for your email,
Actually we use the same syntax to attach and send emails on our AIX
server, it was doing the same. So thought it will do the same on RHEL
server as well,
Maybe yes and maybe no. You were using the "mail" command. Which
mail command is that on AIX? It has been a few years since I
regularly used AIX and I don't remember. At one time it was the
/bin/mail command which was a very simple mailer. Later it might have
been the BSD mailx command which was much more powerful (powerful then
but considered limited by comparison to later mailers). Neither
/bin/mail nor mailx supported attachments. Nor MIME either as they
predated the standard. Therefore I wonder what version this actually
was and how this was creating attachments for you on AIX. Maybe it is
a custom something there?

For more details about the various history of mail, Mail, and mailx I
think this is a pretty reasonable reference. There are others too.
With these differences in mind you will see why I am asking.

http://heirloom.sourceforge.net/mailx_history.html

RHEL and other GNU/Linux distributions all came much later and they
generally only include the newer mailx version of the command. They
would generally symlink it to "mail" and "Mail" so that all called
names would invoke the mailx command. The mailx command might be the
heirloom version or might be the BSD version. Every distribution is
different and I don't remember which is which and would need to look.
Post by srihari D
above used to send emails with file.txt as attachment.
I wonder if perhaps we are using the term attachment to mean
different things. Within the context of email I refer to the MIME
standard. An overview reference it here:

https://en.wikipedia.org/wiki/MIME

Strictly speaking sending a file in the body of an email is not an
attachment. That is simply in the body of the mail. Your syntax to
uuencode a file and then send it as the body of an email is fine as
far as that goes. (Usually the two names on the uuencode command line
are the same however.) That should work the same on both legacy Unix
systems and GNU/Linux systems such as RHEL.

If you would be so kind as to satisfy my curiosity it would be great
if you were to send me one of those messages from your AIX mail as an
attachment. I would like to see what headers are produced and how it
is attached.
Post by srihari D
We are experiencing issues with uuencode, we wanted to send files as
attachments by using uuencode, but it's displaying the contents of
file as body of the email. Below is the syntax being used, please
help me on this issue.
Perhaps the difference is not at the sending side but at the reading
side. Reading a mail generated as above would show the uuencoded
block in the body of the email. That is expected since you have
uuencoded a file and sent that in the body of the email. But perhaps
you were using a special mailer that natively understood about
uuencoded blocks and displayed that specially? Just guessing here but
a difference in how you have read these may be all that is different.

Bob

Loading...