summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Totzke <patricktotzke@gmail.com>2017-07-31 20:25:33 +0100
committerGitHub <noreply@github.com>2017-07-31 20:25:33 +0100
commitd219fb693ec55adddc87963f86c06984e272344e (patch)
tree8f01936e5183cce7c791d8b3bd209e314c06ddd2
parent5a4f3ec96abf79e702de08fe401d79e81ef84d22 (diff)
parent0678b9e35b7e268752599dae3f673d21db8702b8 (diff)
Merge pull request #1096 from dcbaker/submit/gpg-no-bcc
command/envelope: Prompt before sending an encrypted message with Bcc
-rw-r--r--alot/commands/envelope.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/alot/commands/envelope.py b/alot/commands/envelope.py
index 4a1482b6..9fa8fac3 100644
--- a/alot/commands/envelope.py
+++ b/alot/commands/envelope.py
@@ -11,6 +11,7 @@ import logging
import os
import re
import tempfile
+import textwrap
from twisted.internet.defer import inlineCallbacks
@@ -196,6 +197,17 @@ class SendCommand(Command):
logging.debug('sending this message already!')
return
+ # Before attempting to construct mail, ensure that we're not trying
+ # to encrypt a message with a BCC, since any BCC recipients will
+ # receive a message that they cannot read!
+ if self.envelope.headers.get('Bcc') and self.envelope.encrypt:
+ warning = textwrap.dedent("""\
+ Any BCC recepients will not be able to decrypt this
+ message. Do you want to send anyway?""").replace('\n', ' ')
+ if (yield ui.choice(warning, cancel='no',
+ msg_position='left')) == 'no':
+ return
+
clearme = ui.notify(u'constructing mail (GPG, attachments)\u2026',
timeout=-1)