Re: [Exim] "non-printing character 27"

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Nathan Ollerenshaw
Dátum:  
Címzett: Exim users list
Tárgy: Re: [Exim] "non-printing character 27"
On Aug 5, 2004, at 9:53 PM, Nathan Ollerenshaw wrote:

> On Aug 5, 2004, at 9:08 PM, Nathan Ollerenshaw wrote:
>
>> On Aug 5, 2004, at 8:57 PM, Peter Bowyer wrote:
>>
>>>> If I send english subject emails to it, it works fine. Japanese
>>>> emails
>>>> don't. Simple solution is to remove the $header_subject part, but I
>>>> wanted to keep that if possible.
>>>
>>> Does setting/changing 'headers_charset' help?
>>
>> I dont think it can, because I won't know what charset the headers
>> will
>> be in. But the subject is encoded with RFC2022 (or whatever it is) so
>> i
>> should just be able to use the $rheader_subject:. Thanks for pointing
>> me to the right part of the docs :)
>
> Solution was to use
>
> headers_charset = iso-2022-jp
>
> globally, then use
>
> auto_reply:
> driver = autoreply
> subject = [Auto-Reply] ${rfc2047:$header_subject:}
> headers = "Content-Type: text/plain; charset=iso-2022-jp"
> to = $sender_address
> text = ${extract{mailReplyText}{$address_data}}
> from = $local_part@$domain


Just an update for the archives so that others that hit this problem
can find the solution in google.

I found that the above fix worked fine for iso-2022-jp subjects but not
for others. The solution was, as someone said, to use $rheader_subject.

However, I found that for longer subjects, $rheader_subject will
contain \n characters depending on the mail client (some clients, like
mine, like to split each and every rfc2047 encoded 'chunk' onto
separate lines in the Subject: header).

For me, the dirty hack was to do:

subject = ${rfc2047:[Auto-Reply]} ${sg{$rheader_subject:}{\n}{}}

(You don't need to really rfc2047 encode the first part, but I did it
for the hell of it)

If there is a way to make exim split the subject line over multiple
lines, that would be nice. Maybe use headers_add, instead? The problem
with the solution above is that if a subject hits the maximum length of
a header (998 bytes or something like that) then the results are
undefined. Either they'll get truncated, or worse..

If I find a better solution, I'll post it.

Nathan.

--
Nathan Ollerenshaw - UNIX Systems Engineer
ValueCommerce - http://www.valuecommerce.ne.jp/