| 15 | | def start(): |
| 16 | | log.info("Configuring UTF-8 character set to use Quoted-Printable encoding.") |
| 17 | | Charset.add_charset('utf-8', Charset.SHORTEST, Charset.QP, 'utf-8') |
| 18 | | turbomail.config.update({"mail.encoding": "utf-8"}) |
| | 18 | class UTF8QuotedPrintable(Extension): |
| | 19 | name = "utf8qp" |
| | 20 | version = "1.0" |
| | 21 | url = "http://www.python-turbomail.org/wiki/3.0/SampleExtension" |
| | 22 | |
| | 23 | def start(self): |
| | 24 | super(UTF8QuotedPrintable, self).start() |
| | 25 | |
| | 26 | log.info("Configuring UTF-8 character set to use Quoted-Printable encoding.") |
| | 27 | Charset.add_charset('utf-8', Charset.SHORTEST, Charset.QP, 'utf-8') |
| | 28 | turbomail.config.update({"mail.encoding": "utf-8"}) |
| | 29 | |
| | 30 | def stop(self): |
| | 31 | super(UTF8QuotedPrintable, self).stop() |
| | 32 | |
| | 33 | log.info("Configuring UTF-8 character set to use Base-64 encoding.") |
| | 34 | Charset.add_charset('utf-8', Charset.SHORTEST, Charset.BASE64, 'utf-8') |
| | 35 | |
| | 36 | |
| | 37 | def load(): |
| | 38 | return UTF8QuotedPrintable() |
| | 39 | |
| | 40 | |