Problem with mail attachment in Snow Leopard

 
Thread Tools Search this Thread
Operating Systems OS X (Apple) Problem with mail attachment in Snow Leopard
# 1  
Old 03-02-2010
Data Problem with mail attachment in Snow Leopard

Hi,

We have few scripts that are run through jobs . It sends us daily reports (using mailx). This was working fine in Leopard. But in Snow Leopard there is problem with the attachments.Neither the attachment name is being displayed correctly(all it displays is "Mail Attachment") nor the format of the attachment stays intact (i.e everything opens up in text editor even if they are .xls files).

Do we have a work around for this? I just want the attachments to display properly as that in Leopard.

Thanks in advance.
# 2  
Old 03-02-2010
This may help (or not)

Mail.app not recognizing Unix attachments

From that page:
Quote:
If under Leopard and before, you received email messages containing attachments the old Unix way:


begin 644 filename.ext
...uuencode stream here...
end

you may be surprized to see that Snow Leopard doesn't allow to use quick view anymore even if the attachement is of well known file extension (.html as an exemple…)

The attachment is now displayed as a "Mail Attachment" and visible only in any text editor… with TextEdit proposed as the default one.
Quite annoying if you have Unix jobs sending you automatic reports with bash lines like this:


uuencode filename.ext filename.ext | mail -s "My beautiful report" reader@mycompany.com

This doesn't work as before if "reader" is now using Snow Leopard… You have to do something like this:


#!/bin/sh

function usage
{
echo "Usage: $0 [-h] | [-t mimetype] [-e encoding] pathtoreport from to cc [cc ...]" 1>&2
}

set -- `getopt ht:e: "$@"` || {
exit 1
}

# our defaults: set yours…
mimetype="text/html"
encoding="ISO-8859-1"

while :
do
case "$1"
in
-t)
mimetype=$2; shift 2;;
-e)
encoding=$2; shift 2;;
-h)
help=$1; shift;;
--)
shift; break;;
esac
done

if test "$help" = "-h"
then
usage
exit 0
fi

if [ $# -lt 4 ]
then
usage
exit 1
fi

pathtoreport=$1
from=$2
to=$3
cc=$4

shift 4
ccs=$@

for cc1 in "$ccs"
do
cc="$cc, $cc1"
done

subject=`basename $pathtoreport`
b=`date +%Y%m%d%H%M%s`
boundary="--MYBOUNDARY_ID-"$b
(
cat <<EOF
MIME-Version: 1.0
To: $to
Cc: $cc
Content-type: multipart/alternative; boundary=$boundary
From: $from
Subject: $subject
Reply-To: $from

$boundary
Content-Transfer-Encoding: quoted-printable
Content-Type: $mimetype;
charset=$encoding

$(cat "$pathtoreport")

$boundary
EOF
) | /usr/sbin/sendmail -t

And call it that way:


sendreport.sh PATH_TO/filename.ext sender@thisserver.com reader@mycompany.com other@mycompany.com

Feel free to adapt to your taste and context of usage... And of course, if you know of another solution invoking only some settings to change at client side under Snow Leopard: let us know !

Last edited by RTM; 03-02-2010 at 03:46 PM.. Reason: adding info from web site in case it disappears in the future
Login or Register to Ask a Question

Previous Thread | Next Thread

4 More Discussions You Might Find Interesting

1. OS X (Apple)

fetchmail and postfix mail setup on Snow Leopard - request for guidance

Howdy, I hope it is ok to post this here. I would like to do all my POP3 email with fetchmail, postfix and emacs. On Snow Leopard 10.6.8 - this is not urgent and I really want to do it in one of the right ways. This is fetchmail release 6.3.11+GSS+SSL+KRB5. postconf mail_version = 2.5.14 GNU... (11 Replies)
Discussion started by: butterbaerchen
11 Replies

2. OS X (Apple)

Installing Oracle 10g on Snow Leopard using this tutorial

This tutorial. Which is a lovely tutorial, really, and was working up until this instruction: Now download db.zip installation archive and place it somewhere and unzip it: mkdir Install cd Install # download db.zip to this directory unzip db.zip cd db/Disk1 I didn't know how to... (1 Reply)
Discussion started by: khayraB
1 Replies

3. OS X (Apple)

Alpine 2 on Snow Leopard

I've just installed Alpine on Snow Leopard but can't seem to get a default spell checker configured for it. What happened to spell? I can't find it at all on 10.6, must have been some changes. Does anyone know about the default unix spell checker on SL? Thanks! (0 Replies)
Discussion started by: platz
0 Replies

4. OS X (Apple)

MacPorts on Snow Leopard

Hello everyone. I was previously using MacPorts 1.8 on Mac OS 10.5.8 without any problems and everything was working well. I recently upgraded to Xcode 3.2 and Mac OS 10.6, since then my MacPorts installation has not been working at all. I deleted it and then reinstalled the .dmg from the... (1 Reply)
Discussion started by: HoldenCaulfield
1 Replies
Login or Register to Ask a Question