Re: [exim] raw mime_filename

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Mikhail Golub
Dátum:  
Címzett: exim-users
Tárgy: Re: [exim] raw mime_filename
Thanks for reply.

mime_content_disposition - it's not that :(
https://www.exim.org/exim-html-current/doc/html/spec_html/ch-content_scanning_at_acl_time.html

$mime_content_disposition

     This variable contains the normalized content of the 
Content-Disposition: header. You can expect strings like “attachment” or 
“inline” here.



Headers example:
Content-Disposition: attachment;
    filename="=?windows-1251?B?wevg7eog7/Du7+7n6Pazvy5kb2N4?="; size=48777;
    creation-date="Wed, 25 Aug 2021 08:33:00 GMT";
    modification-date="Thu, 13 Oct 2022 07:06:59 GMT"
Content-Transfer-Encoding: base64



If I get "raw" $mime_filename, i can do convert in perl:
use Encode;
$utf8 = decode('MIME-Header', $unknown_variable_raw_mime_filename);

Maybe $mime_content_description?
But not always present :(

mime_filename=помилкаАрт1665572404626.docx, mime_content_description=
mime_filename=Скрин11665574157026.jpg, mime_content_description=
mime_filename=▒▒▒▒▒▒▒▒▒.txt, mime_content_description=


On 13.10.2022 20:34, Jeremy Harris via Exim-users wrote:
> On 13/10/2022 17:57, Mikhail Golub via Exim-users wrote:
>> How can I get "raw" $mime_filename ?
>>
>> In Exim - "headers_charset = UTF-8".
>> And if file name of attachment not in utf8 i have a problem with log
>> display.
>> Example from log, $mime_filename:
>> "▒▒▒▒▒▒ ▒▒▒ 12_10_22.xlsx"
>
> Have a look at $mime_content_disposition - this is where the $mime_filename
> was extracted from.  If I read the code right, the encoded value there
> could
> include a filename-charset as well as the file name.
>
> Relevant standards seem to be RFC 2231, RFC 2047.
>