Prevent Nail from attaching my message as a .bin file?

3

1

When I pipe a very long change log into nail, I receive a blank email with a .bin attachment named ATT00001..bin in Outlook. The file is 36KB and contains the expected text but double spaced (presumably something to do with line endings). If the messages are brief, this doesn't happen.

How do I prevent Nail from converting my message to an attachment?

User-Agent: nail 11.25 7/29/05
MIME-Version: 1.0
Content-Type: application/octet-stream
Content-Transfer-Encoding: quoted-printable

Matt Joiner

Posted 2011-07-12T07:11:37.710

Reputation: 825

Answers

4

I have had this same problem with the son of nail (heirloom mailx) on a Redhat ES 6.1. The problem in the end boiled down to the file not being an ascii, unix standard file (that is LF-only).

I solved this problem by removing the \r characters from the file before sending the mail.

cat logfile | sed 's/\r//' > logfile.new

Davide Inglima

Posted 2011-07-12T07:11:37.710

Reputation: 156

I've long since moved on from the Outlook environment, but imagined it would be something like this given that MS is involved. Thanks. – Matt Joiner – 2013-01-24T23:28:51.583

Very useful answer. Basically, I have an utf-8 output from diff (since diffed files are utf-8) and this made my script failed (no issue with ansi files). The tip still worked so that's wonderful. Thank you – Mat M – 2013-04-15T21:08:47.050

3

This will also happen if you have i.e. UTF8 characters in your file and you have set your locale to something other than UTF8 . nail will suspect that your file has unknown control characters and convert it to an application/octet-stream attachment.

Any mail client will then list thls attachment, not knowing what to do with it. So (sadly?) it's not MS' fault this time. Gmail will list the attachment as "noname".

The sollution for this is to set LANG i.e. en_US.UTF8:

LANG="en_US.UTF8" ; export LANG

sastorsl

Posted 2011-07-12T07:11:37.710

Reputation: 131