Geary.RFC822.Message: Fix Message-Id header not being set
The port to GMime 3 missed setting the Message-Id header on the underlying GMime Message object when constructing a message, from a ComposedEmail, so this was not getting set on outoging email. Fixes #758
This commit is contained in:
parent
0edaf3b988
commit
fe760ff40a
2 changed files with 61 additions and 9 deletions
|
|
@ -58,6 +58,7 @@ This is the second line.
|
|||
add_test("get_searchable_body", get_searchable_body);
|
||||
add_test("get_searchable_recipients", get_searchable_recipients);
|
||||
add_test("get_network_buffer", get_network_buffer);
|
||||
add_test("from_composed_email", from_composed_email);
|
||||
add_test("from_composed_email_inline_attachments", from_composed_email_inline_attachments);
|
||||
}
|
||||
|
||||
|
|
@ -213,6 +214,53 @@ This is the second line.
|
|||
assert_true(buffer.to_string() == NETWORK_BUFFER_EXPECTED, "Network buffer differs");
|
||||
}
|
||||
|
||||
public void from_composed_email() throws GLib.Error {
|
||||
RFC822.MailboxAddress to = new RFC822.MailboxAddress(
|
||||
"Test", "test@example.com"
|
||||
);
|
||||
RFC822.MailboxAddress from = new RFC822.MailboxAddress(
|
||||
"Sender", "sender@example.com"
|
||||
);
|
||||
Geary.ComposedEmail composed = new Geary.ComposedEmail(
|
||||
new GLib.DateTime.now_local(),
|
||||
new Geary.RFC822.MailboxAddresses.single(from)
|
||||
).set_to(new Geary.RFC822.MailboxAddresses.single(to));
|
||||
composed.body_text = "hello";
|
||||
|
||||
this.message_from_composed_email.begin(
|
||||
composed,
|
||||
async_complete_full
|
||||
);
|
||||
Geary.RFC822.Message message = message_from_composed_email.end(async_result());
|
||||
|
||||
assert_non_null(message.to, "to");
|
||||
assert_non_null(message.from, "from");
|
||||
assert_non_null(message.date, "date");
|
||||
assert_non_null(message.message_id, "message_id");
|
||||
|
||||
string message_data = message.to_string();
|
||||
assert_true(
|
||||
message_data.contains("To: Test <test@example.com>\n"),
|
||||
"to data"
|
||||
);
|
||||
assert_true(
|
||||
message_data.contains("From: Sender <sender@example.com>\n"),
|
||||
"from data"
|
||||
);
|
||||
assert_true(
|
||||
message_data.contains("Message-Id: "),
|
||||
"message-id data"
|
||||
);
|
||||
assert_true(
|
||||
message_data.contains("Date: "),
|
||||
"date data"
|
||||
);
|
||||
assert_true(
|
||||
message_data.contains("hello\n"),
|
||||
"body data"
|
||||
);
|
||||
}
|
||||
|
||||
public void from_composed_email_inline_attachments() throws Error {
|
||||
RFC822.MailboxAddress to = new RFC822.MailboxAddress(
|
||||
"Test", "test@example.com"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue