parent
a43a1a0275
commit
42c5b6248a
8 changed files with 30 additions and 5 deletions
|
|
@ -1723,7 +1723,7 @@ public class Composer.Widget : Gtk.EventBox, Geary.BaseInterface {
|
|||
Geary.ComposedEmail draft = yield to_composed_email(null, true);
|
||||
yield this.draft_manager.update(
|
||||
yield new Geary.RFC822.Message.from_composed_email(
|
||||
draft, null, null
|
||||
draft, null, GMime.EncodingConstraint.7BIT, null
|
||||
),
|
||||
null,
|
||||
null
|
||||
|
|
|
|||
|
|
@ -326,7 +326,7 @@ public class MailMerge.Folder : Geary.AbstractLocalFolder {
|
|||
var processor = new Processor(this.template);
|
||||
var composed = processor.merge(fields);
|
||||
var message = yield new Geary.RFC822.Message.from_composed_email(
|
||||
composed, null, cancellable
|
||||
composed, null, GMime.EncodingConstraint.7BIT, cancellable
|
||||
);
|
||||
|
||||
var id = new EmailIdentifier(next_id++);
|
||||
|
|
|
|||
|
|
@ -236,6 +236,7 @@ public class Geary.RFC822.Message : BaseObject, EmailHeaderSet {
|
|||
|
||||
public async Message.from_composed_email(Geary.ComposedEmail email,
|
||||
string? message_id,
|
||||
GMime.EncodingConstraint constraint,
|
||||
GLib.Cancellable? cancellable)
|
||||
throws Error {
|
||||
this.message = new GMime.Message(true);
|
||||
|
|
@ -338,6 +339,7 @@ public class Geary.RFC822.Message : BaseObject, EmailHeaderSet {
|
|||
null,
|
||||
"text/plain",
|
||||
true,
|
||||
constraint,
|
||||
cancellable
|
||||
);
|
||||
} catch (GLib.Error err) {
|
||||
|
|
@ -438,6 +440,7 @@ public class Geary.RFC822.Message : BaseObject, EmailHeaderSet {
|
|||
body_charset,
|
||||
"text/html",
|
||||
false,
|
||||
constraint,
|
||||
cancellable
|
||||
);
|
||||
} catch (GLib.Error err) {
|
||||
|
|
@ -1200,6 +1203,7 @@ public class Geary.RFC822.Message : BaseObject, EmailHeaderSet {
|
|||
string? charset,
|
||||
string content_type,
|
||||
bool is_flowed,
|
||||
GMime.EncodingConstraint constraint,
|
||||
GLib.Cancellable? cancellable)
|
||||
throws GLib.Error {
|
||||
GMime.Stream content_stream = new GMime.StreamMem.with_buffer(content);
|
||||
|
|
@ -1211,7 +1215,7 @@ public class Geary.RFC822.Message : BaseObject, EmailHeaderSet {
|
|||
|
||||
GMime.ContentEncoding encoding = yield Utils.get_best_encoding(
|
||||
filter_stream,
|
||||
GMime.EncodingConstraint.7BIT,
|
||||
constraint,
|
||||
cancellable
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ public class Geary.Smtp.Capabilities : Geary.GenericCapabilities {
|
|||
public const string AUTH_PLAIN = "plain";
|
||||
public const string AUTH_LOGIN = "login";
|
||||
public const string AUTH_OAUTH2 = "xoauth2";
|
||||
public const string 8BITMIME = "8bitmime";
|
||||
|
||||
public const string NAME_SEPARATOR = " ";
|
||||
public const string VALUE_SEPARATOR = " ";
|
||||
|
|
|
|||
|
|
@ -120,6 +120,21 @@ public class Geary.Smtp.ClientService : Geary.ClientService {
|
|||
throws GLib.Error {
|
||||
debug("Saving composed email: %s", email_subject(composed));
|
||||
|
||||
// Detect server encoding constraint
|
||||
GMime.EncodingConstraint constraint = GMime.EncodingConstraint.7BIT;
|
||||
try {
|
||||
|
||||
ClientConnection smtp = new ClientConnection(this.remote);
|
||||
yield smtp.connect_async(cancellable);
|
||||
yield smtp.say_hello_async(cancellable);
|
||||
if (smtp.capabilities.has_capability(Capabilities.8BITMIME)) {
|
||||
constraint = GMime.EncodingConstraint.8BIT;
|
||||
}
|
||||
yield smtp.disconnect_async(cancellable);
|
||||
} catch (Error err) {
|
||||
// Oh well
|
||||
}
|
||||
|
||||
// XXX work out what our public IP address is somehow and use
|
||||
// that in preference to the originator's domain
|
||||
var from = composed.from;
|
||||
|
|
@ -128,7 +143,10 @@ public class Geary.Smtp.ClientService : Geary.ClientService {
|
|||
: this.account.primary_mailbox.domain;
|
||||
Geary.RFC822.Message rfc822 =
|
||||
yield new Geary.RFC822.Message.from_composed_email(
|
||||
composed, GMime.utils_generate_message_id(domain), cancellable
|
||||
composed,
|
||||
GMime.utils_generate_message_id(domain),
|
||||
constraint,
|
||||
cancellable
|
||||
);
|
||||
|
||||
EmailIdentifier id = yield this.outbox.create_email_async(
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ async void main_async() throws Error {
|
|||
}
|
||||
|
||||
msg = yield new Geary.RFC822.Message.from_composed_email(
|
||||
composed_email, null, null
|
||||
composed_email, null, GMime.EncodingConstraint.7BIT, null
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -446,6 +446,7 @@ This is the second line.
|
|||
return yield new Geary.RFC822.Message.from_composed_email(
|
||||
composed,
|
||||
GMime.utils_generate_message_id(composed.from.get(0).domain),
|
||||
GMime.EncodingConstraint.7BIT,
|
||||
null
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -133,6 +133,7 @@ class Integration.Smtp.ClientSession : TestCase {
|
|||
return yield new Geary.RFC822.Message.from_composed_email(
|
||||
composed,
|
||||
GMime.utils_generate_message_id(from.domain),
|
||||
GMime.EncodingConstraint.7BIT,
|
||||
null
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue