Re: [gmime-devel] Porting code from gmime 2.6 to 3.0
- From: Casper Langemeijer <casper langemeijer eu>
- To: Jeffrey Stedfast <fejj gnome org>
- Cc: "gmime-devel-list gnome org" <gmime-devel-list gnome org>
- Subject: Re: [gmime-devel] Porting code from gmime 2.6 to 3.0
- Date: Tue, 1 May 2018 19:38:38 +0200
On May 1 2018, at 4:23 pm, Jeffrey Stedfast <fejj gnome org> wrote:
I'm assuming the 3.0 equivalent of this must be
g_mime_parser_options_set_rfc2047_compliance_mode(options,
GMIME_RFC_COMPLIANCE_LOOSE) or
g_mime_parser_options_set_rfc2047_compliance_mode(options,
GMIME_RFC_COMPLIANCE_STRICT)
but which one is it?
You were definitely on the right track! The setting you are looking for
is the LOOSE value.
Yes!!!
That being said, the default values for all parser compliance settings
is LOOSE, so you don't need to actually mess with that.
That also means that you can pass NULL as the 'options' argument to all
of the GMime API's that take a GMimeParserOptions parameter.
I gathered that, that's why I'm so happy! I can just drop the constant in g_mime_init() and it will work then!
I'm not sure if dbmail uses the old g_mime_set_user_charsets() APIs or
not, but if it does, the GMimeParserOptions is where to set those
fallback charsets now. I figured I'd mention that since that might not
be super obvious.
It doesn't, so that's easy too. I think I've done most of the work. Removal of g_mime_header_list_foreach() made me do some work on dbmail's code, g_mime_utils_header_decode_date() using GDateTime also. dbmails had an internal_date variable for timestamp and a separate offset, I changed it to a GDateTime. That meant all the references to internal_date had to change, but the code is much cleaner now. In the process this fixed a bug with half-our-time-difference timezones. (Right in the week where North Korea decided to shift that half hour and join the south btw. I looked it up, there are quite some more
https://www.timeanddate.com/time/time-zones-interesting.html)
If you have any more questions, let me know and I'll try to help you out,
Although I'm still working on it, it would be awesome if you could review my changes here:
https://github.com/langemeijer/dbmail/commits/upgrade-to-gmime3 I've been a professional software developer for over 20 years, but I don't have much experience in writing C code. It's mainly arduino and other small projects. I'm learning and really appreciate feedback. I try to compensate lack of experience by working in the open, and exercise very verbose communication, leaving my train of thought into my communication and commit-log.
I've committed a todo document in commit
https://github.com/langemeijer/dbmail/commit/850976c that you might recognize as a portion of your own porting guide. In every commit I've made when I solved an issue I removed that portion of the guide. When I reached the bottom I started adding things to the document that were not in the porting guide. My commits are small and focus on a single change.
I find the gmime library very easy to work with, the documentation is good (But I have some improvements that I will PR when I'm done) , and the tests are very welcome examples of how to use the library. Also I can see that the api changes you made make good sense. Thank you for your work and your time.
Greetings, Casper
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]