From a821b4f5567d02c3329c2b94a73dcbe12e6699a2 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 12 Sep 2017 18:08:09 +0200 Subject: wks: Add hack for the broken posteo system * tools/gpg-wks-client.c (command_send): Additional hack for posteo. Check the protocol-version flag. Signed-off-by: Werner Koch --- tools/gpg-wks-client.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'tools/gpg-wks-client.c') diff --git a/tools/gpg-wks-client.c b/tools/gpg-wks-client.c index 5b98de441..e703640e1 100644 --- a/tools/gpg-wks-client.c +++ b/tools/gpg-wks-client.c @@ -693,6 +693,7 @@ command_send (const char *fingerprint, char *userid) mime_maker_t mime = NULL; struct policy_flags_s policy; int no_encrypt = 0; + int posteo_hack = 0; const char *domain; memset (&policy, 0, sizeof policy); @@ -762,11 +763,14 @@ command_send (const char *fingerprint, char *userid) if (policy.auth_submit) log_info ("no confirmation required for '%s'\n", addrspec); - /* Hack to support old providers. */ - if (policy.auth_submit && !ascii_strcasecmp (domain, "posteo.de")) + /* Hack to support posteo but let them disable this by setting the + * new policy-version flag. */ + if (policy.protocol_version < 3 + && !ascii_strcasecmp (domain, "posteo.de")) { log_info ("Warning: Using draft-1 method for domain '%s'\n", domain); no_encrypt = 1; + posteo_hack = 1; } /* Encrypt the key part. */ @@ -805,6 +809,18 @@ command_send (const char *fingerprint, char *userid) void *data; size_t datalen, n; + if (posteo_hack) + { + /* Needs a multipart/mixed with one(!) attachment. It does + * not grok a non-multipart mail. */ + err = mime_maker_add_header (mime, "Content-Type", "multipart/mixed"); + if (err) + goto leave; + err = mime_maker_add_container (mime); + if (err) + goto leave; + } + err = mime_maker_add_header (mime, "Content-type", "application/pgp-keys"); if (err) -- cgit v1.2.3