[plug] Emailing - gotchas

Bernd Felsche bernie at innovative.iinet.net.au
Thu Jul 1 13:15:14 WST 2004


On Thursday 01 July 2004 12:17, Craig Ringer wrote:
> Bernd Felsche wrote:
> > I hadn't named the PDF as *.pdf in the mailing wrapper, so nail made
> > it an application/text attachment in the MIME header. I changed the
> > mailing wrapper program to have the intermediate file with a pdf
> > extension and "nail" then changed the MIME header to
> > application/pdf.
> >
> > Even Lookout! then processed the resulting attachment as expected.

> If you were sending PDF files as text/plain then I suspect LookOut! was
> in fact in the right. Did you try any other mail clients under Windows
> to see if they also had the problem? If I understand correctly, they
> should have.

I was keeping my fingers crossed that "nail" would determine the
correct document type :-) It didn't. It used the same dumb file type
determination method as Windows.

> Even better, Base64-encode your attachments so that line-ending
> translation won't matter. A simple example that uses the email package
> for Python (and ReportLab to generate the PDF - feel free to replace
> that bit with loading a PDF from a file instead) is attached.

Thanks for the sample Python... it's still pretty much a read-only
language for me.

It assumes that the attached is a PDF so it doesn't save me any
work.... I know that
	file -i 
gives me about the MIME type. (Doffs hat) But there was no way I
could provide that as an argument to "nail" or any other
command-line based MUA.

"MimeTypes" appears to do something usefully similar. But I'm not
sure if it actually reads the file to determine content type.

I'll probably play with a re-write of the mailing wrapper in Python
over the weekend. There's not enough blood on the keyboard yet.

Be prepared to scoff at my feeble effort!

-- 
/"\ Bernd Felsche - Innovative Reckoning, Perth, Western Australia
\ /  ASCII ribbon campaign | I'm a .signature virus!
 X   against HTML mail     | Copy me into your ~/.signature
/ \  and postings          | to help me spread!





More information about the plug mailing list