summaryrefslogtreecommitdiffstats
path: root/tools/gpg-wks-client.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2017-09-12 18:08:09 +0200
committerWerner Koch <wk@gnupg.org>2017-09-12 18:08:09 +0200
commita821b4f5567d02c3329c2b94a73dcbe12e6699a2 (patch)
tree8d64b3e0d05423217edebc2ee1a32fa8af666e11 /tools/gpg-wks-client.c
parentwks: Add new policy flag protocol-version (diff)
downloadgnupg2-a821b4f5567d02c3329c2b94a73dcbe12e6699a2.tar.xz
gnupg2-a821b4f5567d02c3329c2b94a73dcbe12e6699a2.zip
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 <wk@gnupg.org>
Diffstat (limited to 'tools/gpg-wks-client.c')
-rw-r--r--tools/gpg-wks-client.c20
1 files changed, 18 insertions, 2 deletions
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)