[geary: 16/23] Allow addresses without domains (fixes disabled mailbox-addresses-test)
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary: 16/23] Allow addresses without domains (fixes disabled mailbox-addresses-test)
- Date: Sat, 21 Dec 2019 05:43:15 +0000 (UTC)
commit c0e8f717e8c92a65a43234e00947fe005a2260f8
Author: Torben <torben letorbi gmail com>
Date: Mon Dec 16 00:34:30 2019 +0100
Allow addresses without domains (fixes disabled mailbox-addresses-test)
src/engine/rfc822/rfc822.vala | 6 ++++--
test/engine/rfc822-mailbox-addresses-test.vala | 5 ++---
2 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/engine/rfc822/rfc822.vala b/src/engine/rfc822/rfc822.vala
index ceb749b0..718fae9c 100644
--- a/src/engine/rfc822/rfc822.vala
+++ b/src/engine/rfc822/rfc822.vala
@@ -37,11 +37,13 @@ public void init() {
}
public GMime.FormatOptions get_format_options() {
- return GMime.FormatOptions.get_default();
+ return GMime.FormatOptions.get_default().clone();
}
public GMime.ParserOptions get_parser_options() {
- return GMime.ParserOptions.get_default();
+ GMime.ParserOptions opt = GMime.ParserOptions.get_default().clone();
+ opt.set_allow_addresses_without_domain(true);
+ return opt;
}
public string? get_charset() {
diff --git a/test/engine/rfc822-mailbox-addresses-test.vala b/test/engine/rfc822-mailbox-addresses-test.vala
index 5b9fed39..70e535d5 100644
--- a/test/engine/rfc822-mailbox-addresses-test.vala
+++ b/test/engine/rfc822-mailbox-addresses-test.vala
@@ -27,10 +27,9 @@ class Geary.RFC822.MailboxAddressesTest : TestCase {
addrs = new
MailboxAddresses.from_rfc822_string("\"=?utf-8?b?dGVzdCIgPHBvdHVzQHdoaXRlaG91c2UuZ292Pg==?==?utf-8?Q?=00=0A?=\"
<demo mailsploit com>");
assert(addrs.size == 1);
- // Disabled since GMime doen't seem to be able to parse both addresses (might be fixable with
different parser options)
// Courtesy Mailsploit https://www.mailsploit.com
- //addrs = new
MailboxAddresses.from_rfc822_string("\"=?utf-8?Q?=42=45=47=49=4E=20=2F=20=28=7C=29=7C=3C=7C=3E=7C=40=7C=2C=7C=3B=7C=3A=7C=5C=7C=22=7C=2F=7C=5B=7C=5D=7C=3F=7C=2E=7C=3D=20=2F=20=00=20=50=41=53=53=45=44=20=4E=55=4C=4C=20=42=59=54=45=20=2F=20=0D=0A=20=50=41=53=53=45=44=20=43=52=4C=46=20=2F=20?==?utf-8?b?RU5E=?=\",
<demo mailsploit com>");
- //assert(addrs.size == 2);
+ addrs = new
MailboxAddresses.from_rfc822_string("\"=?utf-8?Q?=42=45=47=49=4E=20=2F=20=28=7C=29=7C=3C=7C=3E=7C=40=7C=2C=7C=3B=7C=3A=7C=5C=7C=22=7C=2F=7C=5B=7C=5D=7C=3F=7C=2E=7C=3D=20=2F=20=00=20=50=41=53=53=45=44=20=4E=55=4C=4C=20=42=59=54=45=20=2F=20=0D=0A=20=50=41=53=53=45=44=20=43=52=4C=46=20=2F=20?==?utf-8?b?RU5E=?=\",
<demo mailsploit com>");
+ assert(addrs.size == 2);
}
public void from_rfc822_string_quoted() throws GLib.Error {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]