Re: [GMime] More error information...
- From: Jeffrey Stedfast <jestedfa microsoft com>
- To: Albrecht Dreß <albrecht dress arcor de>
- Cc: Balsa Mailing List <balsa-list gnome org>
- Subject: Re: [GMime] More error information...
- Date: Fri, 17 Mar 2017 21:14:57 +0000
Hey Albrecht,
On 3/17/17, 4:43 PM, "Albrecht Dreß" <albrecht dress arcor de> wrote:
Hi Jeff:
Am 17.03.17 19:56 schrieb(en) Jeffrey Stedfast via balsa-list:
> FWIW, 3.0 is the release for breaking API to make things better. So in general, I’m OK with breaking it.
Great!
> Note: g_mime_stream_[file,fs]_new_for_path() have been renamed to _open() in 3.0 and as of now also
take a GError.
That's good news, and really an improvement IMO.
> In other exciting news, when GMime parses email addresses, it extracts the charset property in the
rfc2047 encoded-word token and sets that on the InternetAddress::charset field
Hmmm.... I appears that RFC 2047 allows mixing different encodings in the same header, there is even an
example at the very end of sect. 8 ("=?ISO-8859-1?Q?a?= =?ISO-8859-2?Q?_b?=" → "a b"). How do you handle
this case? Also quite weird, but IIRC I saw such mixtures in the subject (though not in address headers) of
malware spam...
There’s no great way to do this… so I grab the first charset used or UTF-8 if that is used at all.
In your example, it would pick iso-8859-1.
It’s not perfect, but it mostly works in practice.
> GMimeParam now also has a GMimeParamEncodingMethod property which allows you to override the default
and make it use rfc2047 encoding when writing out the headers instead of rfc2231.
Also a nice feature.
> Oh! Also… I was reading over your emails to the list and noticed that you recently replaced the SMTP
backend. One of the problems you had was hiding various X-Balsa-* and Bcc headers?
Well, not a real problem. The old libesmtp library had options to strip certain headers from the RFC
5321 "DATA" section. IMO this was the wrong place as a SMTP implementation is supposed to pass the message
data blob "as is" (i.e. it also assumes proper line endings and that leading dots are escaped). The right
place for formatting it properly is the RFC 5322 & friends implementation, i.e. GMime, so I wrote a trivial
stream filter which does a perfect job afaict.
I’m sure it does. (
> I’ve been thinking of adding a GMimeFormatOptions to GMime. In fact, I was planning on implementing
that this weekend…
A GList or GHashTable would be much better than my filter. I hard-wired the headers we want to remove
for the time being, but there /may/ be others which should be hidden. E.g. the user-agent which carries
information about the MUA and the OS the recipient doesn't need to (actually: shouldn't) know, as this is
helpful for crafting a targeted attack against the sender's system (we all know that there are NO BUGS AT ALL
in Balsa, though - ROTFL ;-).
Yep.
Jeff
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]