* Martin Körner <[EMAIL PROTECTED]> wrote:

> I am using email module for creating mails with attachment (and then 
> sending via smtplib).
> 
> If the name of the attachment file is longer than about 60 characters 
> the filename is wrapped in the Content-Disposition header:
> 
> Content-Disposition: attachment;
>       filename="This is a sample file with a very long filename
>       0123456789.zip"
> 
> 
> This leads to a wrong attachment filename in email clients - the space 
> after "filename" is not shown or the client displays a special character 
> (the linbreak or tab before 0123456789.zip).

Yeah, this is badly applied header folding. You can circumvent it by
encoding the filename parameter according to
<http://ftp.rfc-editor.org/in-notes/rfc2184.txt>

Note that parameter continuation ala filename*1="..."; filename*2="...." is not
really supported by MUAs, but support for filename*="..." seems to be a /bit/ 
better.

nd
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to