# UUEncode Attachment Missing

**URL:** <https://community.unix.com/t/uuencode-attachment-missing/260272>\
**Category:** Shell Programming and Scripting\
**Created:** [February 22, 2010, 11:34am UTC](https://community.unix.com/t/uuencode-attachment-missing/260272 "2010-02-22T11:34:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymoususer45](https://community.unix.com/letter_avatar/anonymoususer45/32/6_22734026db12803ebb3e059622ac3534.png) [@anonymoususer45](https://community.unix.com/u/anonymoususer45)\
**Post date:** [February 22, 2010, 11:34am UTC](https://community.unix.com/t/uuencode-attachment-missing/260272/1 "2010-02-22T11:34:50Z")

</div>

Hi All,

```
  I have created a shell utility that runs various database jobs and then mail the output of the database jobs to the customers. This is a generic utility and executes almost 15 reports and sends the results out. To send the attachment I use uuencode. This had been working fine till the script encountered a large file and the corresponding email that went out had the encoded text only. 

```

I am pasting herewith part of the encoded text in the email

> [@](#):
>
> begin 644 REPORTS\_NOT\_SUBMITTED\_OR\_PULLED\_AFTER\_22\_23\_MARCH\_2006.zp  
> M4$L#!!0 ( )M:5CR[$XLC.',% !Z\*60!2 !4 4D503U)44U].3U1?4U5"  
> M34E45$5$7T]27U!53$Q%1%]!1E1%4E\R,E\R,U]-05)#2%\R,# V7S(R+49E  
> M8BTR,#$P7S$Q+3$Y+3(R+4%-+F-S=E54"0 #YJZ"2^6N@DM5\> 0 T5[")-Q=

I am herewith attaching the code that encodes and mails the file.

```plaintext
(cat ${SUC_Template}.${DATE_TIME}.$$.tmp;uuencode ${ZIPFILE} "${SQL_NAME}.zp") | mailx -n -s "${SUBJECT}" ${BizEMailAddr}

```

This code works properly with 14 of the files but not with the 15th one. The only difference I had noticed is that the filesize generated with the 15th SQL file is very huge.

Any help would be highly appreciated.

Thanks a lot.

Thanks and Regards  
AnonymousUser45

---

<div class="post-metadata">

**Author:** ![abubacker](https://community.unix.com/letter_avatar/abubacker/32/6_22734026db12803ebb3e059622ac3534.png) [@abubacker](https://community.unix.com/u/abubacker)\
**Post date:** [February 23, 2010, 12:04am UTC](https://community.unix.com/t/uuencode-attachment-missing/260272/2 "2010-02-23T00:04:04Z")

</div>

If its not working what error it throws , can you explain more about it

---

<div class="post-metadata">

**Author:** ![anonymoususer45](https://community.unix.com/letter_avatar/anonymoususer45/32/6_22734026db12803ebb3e059622ac3534.png) [@anonymoususer45](https://community.unix.com/u/anonymoususer45)\
**Post date:** [February 23, 2010, 11:52am UTC](https://community.unix.com/t/uuencode-attachment-missing/260272/3 "2010-02-23T11:52:51Z")

</div>

The error is where I was expecting the attachment I got the encoded text. The encoded text that I was seeing in the email is shown above and the script line that does the encoding and mailing is also shown.

---

<div class="post-metadata">

**Author:** ![methyl](https://community.unix.com/letter_avatar/methyl/32/6_22734026db12803ebb3e059622ac3534.png) [@methyl](https://community.unix.com/u/methyl)\
**Post date:** [February 23, 2010, 12:49pm UTC](https://community.unix.com/t/uuencode-attachment-missing/260272/4 "2010-02-23T12:49:24Z")

</div>

I get exactly the same effect with a small text file and using your script. The uuencoded file appears in the mail body not as an attachment.

If change the mailx switch "-n" to "-m" it works.

Btw. How big is "huge"?

---

<div class="post-metadata">

**Author:** ![anonymoususer45](https://community.unix.com/letter_avatar/anonymoususer45/32/6_22734026db12803ebb3e059622ac3534.png) [@anonymoususer45](https://community.unix.com/u/anonymoususer45)\
**Post date:** [February 24, 2010, 1:58pm UTC](https://community.unix.com/t/uuencode-attachment-missing/260272/5 "2010-02-24T13:58:45Z")

</div>

Hi Methyl,

```
 My mailx installation is /usr/bin/mailx and it does not accept the -m switch. It might be because I am on Sun OS release 10.

```

```nohighlight
System = SunOS
Node = *********
Release = 5.10
KernelID = Generic_127111-09
Machine = sun4u
BusType = <unknown>
Serial = <unknown>
Users = <unknown>
OEM# = 0
Origin# = 1
NumCPU = 8

```

As far as the definition of huge is concerned, it was a relative one in this context (Huge amongst the 15 of the SQL reports). The actual size of the zip file was around 350K and the original data file was around 5.6M.

I am not sure why it fails for this guy but works for the rest14 ☹ .

Thanks and Regards  
-Nony
