sup

A curses threads-with-tags style email client

sup-website.git

git clone https://supmua.dev/git/sup-website/

community/pipermail-archives/sup-devel/2014-05.txt (9166B) - raw

      1 From sankeytms@gmail.com  Sat May 10 08:23:11 2014
      2 From: sankeytms@gmail.com (Troy Sankey)
      3 Date: Sat, 10 May 2014 01:23:11 -0700
      4 Subject: [sup-devel] check keys before sending
      5 Message-ID: <1399708417-sup-4178@ultralap.site>
      6 
      7 Hi sup developers,
      8 
      9 Recently I sent an encrypted message to a group of recipients, thinking
     10 that all their keys were still valid.  However, one of them had an
     11 expired key, so the message was not encrypted to that recipient and he
     12 could not read it.
     13 
     14 I want sup to prompt the user about potentially invalid keys before
     15 sending a message.  I think the code will look something like this:
     16 
     17 
     18 diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
     19 index fd8f824..88ae3cc 100644
     20 --- a/lib/sup/crypto.rb
     21 +++ b/lib/sup/crypto.rb
     22 @@ -167,6 +167,14 @@ EOS
     23                                 {:operation => "encrypt", :options => gpg_opts}) || gpg_opts
     24      recipients = to + [from]
     25      recipients = HookManager.run("gpg-expand-keys", { :recipients => recipients }) || recipients
     26 +
     27 +    # make sure all recipients can be encrypted-to
     28 +    recipients.each do |recipient|
     29 +      if GPGME::Key.find(:public, recipient).length == 0 and !BufferManager.ask_yes_or_no("Could not encrypt to #{recipient}. Really send?")
     30 +        raise Error, "Send message cancelled."
     31 +      end
     32 +    end
     33 +
     34      begin
     35        if GPGME.respond_to?('encrypt')
     36          cipher = GPGME.encrypt(recipients, format_payload(payload), gpg_opts)
     37 
     38 
     39 I have not tested this patch, so if it looks wrong then it probably is!
     40 Does anybody have any thoughts on this feature?
     41 
     42 Troy
     43 -------------- next part --------------
     44 A non-text attachment was scrubbed...
     45 Name: signature.asc
     46 Type: application/pgp-signature
     47 Size: 836 bytes
     48 Desc: not available
     49 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20140510/883525da/attachment.bin>
     50 
     51 From eg@gaute.vetsj.com  Sat May 10 16:54:58 2014
     52 From: eg@gaute.vetsj.com (Gaute Hope)
     53 Date: Sat, 10 May 2014 18:54:58 +0200
     54 Subject: [sup-devel] check keys before sending
     55 In-Reply-To: <1399708417-sup-4178@ultralap.site>
     56 References: <1399708417-sup-4178@ultralap.site>
     57 Message-ID: <CABKe4Msvczo6zDWpBCT9OZspuNObDpVdeTZ0qSDrR4Zv9djDXQ@mail.gmail.com>
     58 
     59 I think this can be included if you test and verify the patch. Definetely
     60 very useful.
     61 
     62 
     63 On Sat, May 10, 2014 at 10:23 AM, Troy Sankey <sankeytms at gmail.com> wrote:
     64 
     65 > Hi sup developers,
     66 >
     67 > Recently I sent an encrypted message to a group of recipients, thinking
     68 > that all their keys were still valid.  However, one of them had an
     69 > expired key, so the message was not encrypted to that recipient and he
     70 > could not read it.
     71 >
     72 > I want sup to prompt the user about potentially invalid keys before
     73 > sending a message.  I think the code will look something like this:
     74 >
     75 >
     76 > diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb
     77 > index fd8f824..88ae3cc 100644
     78 > --- a/lib/sup/crypto.rb
     79 > +++ b/lib/sup/crypto.rb
     80 > @@ -167,6 +167,14 @@ EOS
     81 >                                 {:operation => "encrypt", :options =>
     82 > gpg_opts}) || gpg_opts
     83 >      recipients = to + [from]
     84 >      recipients = HookManager.run("gpg-expand-keys", { :recipients =>
     85 > recipients }) || recipients
     86 > +
     87 > +    # make sure all recipients can be encrypted-to
     88 > +    recipients.each do |recipient|
     89 > +      if GPGME::Key.find(:public, recipient).length == 0 and
     90 > !BufferManager.ask_yes_or_no("Could not encrypt to #{recipient}. Really
     91 > send?")
     92 > +        raise Error, "Send message cancelled."
     93 > +      end
     94 > +    end
     95 > +
     96 >      begin
     97 >        if GPGME.respond_to?('encrypt')
     98 >          cipher = GPGME.encrypt(recipients, format_payload(payload),
     99 > gpg_opts)
    100 >
    101 >
    102 > I have not tested this patch, so if it looks wrong then it probably is!
    103 > Does anybody have any thoughts on this feature?
    104 >
    105 > Troy
    106 >
    107 > _______________________________________________
    108 > Sup-devel mailing list
    109 > Sup-devel at rubyforge.org
    110 > http://rubyforge.org/mailman/listinfo/sup-devel
    111 >
    112 >
    113 -------------- next part --------------
    114 An HTML attachment was scrubbed...
    115 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20140510/a10234d4/attachment.html>
    116 
    117 From eg@gaute.vetsj.com  Mon May 19 11:02:40 2014
    118 From: eg@gaute.vetsj.com (Gaute Hope)
    119 Date: Mon, 19 May 2014 13:02:40 +0200
    120 Subject: [sup-devel] sup 0.18.0 released
    121 Message-ID: <1400497068-astroid-0-zja6wv13cb-10572@strange>
    122 
    123 Greetings,
    124 
    125 Sup 0.18.0 has just been released. Get it at rubygems!
    126 
    127 Regards, Gaute
    128 
    129 
    130 From sankeytms@gmail.com  Tue May 20 05:36:36 2014
    131 From: sankeytms@gmail.com (Troy Sankey)
    132 Date: Mon, 19 May 2014 22:36:36 -0700
    133 Subject: [sup-devel] Emacs Integration wiki page
    134 Message-ID: <1400562885-sup-1119@ultralap.site>
    135 
    136 Emacs!
    137 
    138 The following changes since commit 96c7fdd5fb4d9bc99e70a050eba72c31e445:
    139 
    140   Template (2014-04-24 01:01:53 -0700)
    141 
    142 are available in the git repository at:
    143 
    144   https://linux.ucla.edu/~sankeytm/repos/sup.wiki.git master
    145 
    146 for you to fetch changes up to a61957168fb14fc45926c8e4ac78ea9e35b36aa0:
    147 
    148   added page for Emacs Integration (2014-05-19 21:57:21 -0700)
    149 
    150 ----------------------------------------------------------------
    151 Troy Sankey (1):
    152       added page for Emacs Integration
    153 
    154  Emacs-Integration.md | 37 +++++++++++++++++++++++++++++++++++++
    155  1 file changed, 37 insertions(+)
    156  create mode 100644 Emacs-Integration.md
    157 
    158 diff --git a/Emacs-Integration.md b/Emacs-Integration.md
    159 new file mode 100644
    160 index 0000000..ecfcc59
    161 --- /dev/null
    162 +++ b/Emacs-Integration.md
    163 @@ -0,0 +1,37 @@
    164 +# Emacs Integration
    165 +
    166 +To configure Sup to use Emacs as an editor, set _:editor:_ in
    167 +_~/.sup/config.yaml_ to the `emacs` command.  Alternatively, use `emacs
    168 +-nw` to run Emacs in text mode.
    169 +
    170 +Excerpt from _~/.sup/config.yaml_:
    171 +
    172 +```yaml
    173 +:editor: emacs -nw
    174 +```
    175 +
    176 +To configure emacs for writing mail, enable message-mode on files
    177 +matching the regex "/sup.*eml$".  Add this to your _~/.emacs_:
    178 +
    179 +```elisp
    180 +(add-to-list 'auto-mode-alist '("/sup.*eml$" . message-mode))
    181 +```
    182 +
    183 +If you want to enable some minor modes for convenience
    184 +(e.g. auto-fill-mode, flyspell-mode) use a message-mode hook:
    185 +
    186 +```elisp
    187 +(add-hook 'message-mode-hook (lambda ()
    188 +  (auto-fill-mode 1)
    189 +  (flyspell-mode 1)))
    190 +```
    191 +
    192 +To move the cursor down to the first empty line, add to the hook like
    193 +this:
    194 +
    195 +```elisp
    196 +(add-hook 'message-mode-hook (lambda ()
    197 +  (auto-fill-mode 1)
    198 +  (flyspell-mode 1)
    199 +  (search-forward-regexp "^$")))
    200 +```
    201 -------------- next part --------------
    202 A non-text attachment was scrubbed...
    203 Name: signature.asc
    204 Type: application/pgp-signature
    205 Size: 836 bytes
    206 Desc: not available
    207 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20140519/46ce4458/attachment.bin>
    208 
    209 From eg@gaute.vetsj.com  Tue May 20 06:53:42 2014
    210 From: eg@gaute.vetsj.com (Gaute Hope)
    211 Date: Tue, 20 May 2014 08:53:42 +0200
    212 Subject: [sup-devel] Emacs Integration wiki page
    213 In-Reply-To: <1400562885-sup-1119@ultralap.site>
    214 References: <1400562885-sup-1119@ultralap.site>
    215 Message-ID: <CABKe4Mudd=udT1w26fp5+yJVWuH2hTEfWc3JnJ6UhirM6WDP1w@mail.gmail.com>
    216 
    217 Thanks, merged.
    218 
    219 
    220 On Tue, May 20, 2014 at 7:36 AM, Troy Sankey <sankeytms at gmail.com> wrote:
    221 
    222 > Emacs!
    223 >
    224 > The following changes since commit 96c7fdd5fb4d9bc99e70a050eba72c31e445:
    225 >
    226 >   Template (2014-04-24 01:01:53 -0700)
    227 >
    228 > are available in the git repository at:
    229 >
    230 >   https://linux.ucla.edu/~sankeytm/repos/sup.wiki.git master
    231 >
    232 > for you to fetch changes up to a61957168fb14fc45926c8e4ac78ea9e35b36aa0:
    233 >
    234 >   added page for Emacs Integration (2014-05-19 21:57:21 -0700)
    235 >
    236 > ----------------------------------------------------------------
    237 > Troy Sankey (1):
    238 >       added page for Emacs Integration
    239 >
    240 >  Emacs-Integration.md | 37 +++++++++++++++++++++++++++++++++++++
    241 >  1 file changed, 37 insertions(+)
    242 >  create mode 100644 Emacs-Integration.md
    243 >
    244 > diff --git a/Emacs-Integration.md b/Emacs-Integration.md
    245 > new file mode 100644
    246 > index 0000000..ecfcc59
    247 > --- /dev/null
    248 > +++ b/Emacs-Integration.md
    249 > @@ -0,0 +1,37 @@
    250 > +# Emacs Integration
    251 > +
    252 > +To configure Sup to use Emacs as an editor, set _:editor:_ in
    253 > +_~/.sup/config.yaml_ to the `emacs` command.  Alternatively, use `emacs
    254 > +-nw` to run Emacs in text mode.
    255 > +
    256 > +Excerpt from _~/.sup/config.yaml_:
    257 > +
    258 > +```yaml
    259 > +:editor: emacs -nw
    260 > +```
    261 > +
    262 > +To configure emacs for writing mail, enable message-mode on files
    263 > +matching the regex "/sup.*eml$".  Add this to your _~/.emacs_:
    264 > +
    265 > +```elisp
    266 > +(add-to-list 'auto-mode-alist '("/sup.*eml$" . message-mode))
    267 > +```
    268 > +
    269 > +If you want to enable some minor modes for convenience
    270 > +(e.g. auto-fill-mode, flyspell-mode) use a message-mode hook:
    271 > +
    272 > +```elisp
    273 > +(add-hook 'message-mode-hook (lambda ()
    274 > +  (auto-fill-mode 1)
    275 > +  (flyspell-mode 1)))
    276 > +```
    277 > +
    278 > +To move the cursor down to the first empty line, add to the hook like
    279 > +this:
    280 > +
    281 > +```elisp
    282 > +(add-hook 'message-mode-hook (lambda ()
    283 > +  (auto-fill-mode 1)
    284 > +  (flyspell-mode 1)
    285 > +  (search-forward-regexp "^$")))
    286 > +```
    287 >
    288 > _______________________________________________
    289 > Sup-devel mailing list
    290 > Sup-devel at rubyforge.org
    291 > http://rubyforge.org/mailman/listinfo/sup-devel
    292 >
    293 >
    294 -------------- next part --------------
    295 An HTML attachment was scrubbed...
    296 URL: <http://rubyforge.org/pipermail/sup-devel/attachments/20140520/1bf1df68/attachment-0001.html>
    297