Sponsored Content
Operating Systems OS X (Apple) Problem with mail attachment in Snow Leopard Post 302400196 by RTM on Tuesday 2nd of March 2010 12:56:44 PM
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
 

4 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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
uuencode(n)					       Text encoding & decoding binary data					       uuencode(n)

__________________________________________________________________________________________________________________________________________________

NAME
uuencode - UU-encode/decode binary data SYNOPSIS
package require Tcl 8 package require uuencode ?1.1.4? ::uuencode::encode string ::uuencode::decode string ::uuencode::uuencode ?-name string? ?-mode octal? (-file filename | ?--? string) ::uuencode::uudecode (-file filename | ?--? string) _________________________________________________________________ DESCRIPTION
This package provides a Tcl-only implementation of the uuencode(1) and uudecode(1) commands. This encoding packs binary data into printable ASCII characters. ::uuencode::encode string returns the uuencoded data. This will encode all the data passed in even if this is longer than the uuencode maximum line length. If the number of input bytes is not a multiple of 3 then additional 0 bytes are added to pad the string. ::uuencode::decode string Decodes the given encoded data. This will return any padding characters as well and it is the callers responsibility to deal with handling the actual length of the encoded data. (see uuencode). ::uuencode::uuencode ?-name string? ?-mode octal? (-file filename | ?--? string) ::uuencode::uudecode (-file filename | ?--? string) UUDecode a file or block of data. A file may contain more than one embedded file so the result is a list where each element is a three element list of filename, mode value and data. OPTIONS
-filename name Cause the uuencode or uudecode commands to read their data from the named file rather that taking a string parameter. -name string The uuencoded data header line contains the suggested file name to be used when unpacking the data. Use this option to change this from the default of "data.dat". -mode octal The uuencoded data header line contains a suggested permissions bit pattern expressed as an octal string. To change the default of 0644 you can set this option. For instance, 0755 would be suitable for an executable. See chmod(1). EXAMPLES
% set d [uuencode::encode "Hello World!"] 2&5L;&\@5V]R;&0A % uuencode::uudecode $d Hello World! % set d [uuencode::uuencode -name hello.txt "Hello World"] begin 644 hello.txt +2&5L;&@5V]R;&0` ` end % uuencode::uudecode $d {hello.txt 644 {Hello World}} BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category base64 of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. KEYWORDS
encoding, uuencode COPYRIGHT
Copyright (c) 2002, Pat Thoyts base64 1.1.4 uuencode(n)
All times are GMT -4. The time now is 05:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy