Re: How to decode INLINE GPG messages?

2017-03-06 Thread Jonas Hedman
On 17-03-06 16:23, Alexander Gattin wrote:
> Hello,
> 
> On Sun, Mar 05, 2017 at 08:35:59PM -0600, Derek
> Martin wrote:
> > It's sad to see this question still popping up.
> > Inline PGP is a hack that should have died at
> > least a decade ago, and more like two decades.
> 
> My friend used to send inline PGP messages until
> half a year ago, and I'm sure there are still some
> inline PGP users left.
> 

In my experience most inliners I converse with are also keybase users
and this is only speculation but I guess they find it convenient to 
copy-paste clear/encrypted text into their browsers and keybase instead
of installing anything locally to manage PGP. The only other inline
contact I can think of on top of my head uses some kind of 
gmail-firefox-pgp-plugin(?) and only accepts inline encryption.  

The state of things in this regard is a bit... sad and keybase popping
up on the scene doesn't seem to speed up the demise of inline PGP
messages. 

Sorry for OT.

Regards
-- 
Jonas Hedman 

PGP: 8F72 C5BE AAFA B4BA 8F46 9185 5C39 89E0 616B B08C


signature.asc
Description: Digital signature


Re: How to decode INLINE GPG messages?

2017-03-04 Thread Jonas Hedman
On 17-02-22 12:01, Michelle Konzack wrote:
> Hello,
> 
> I get every day GPG signed and crypted messages, but these are always as
> attachment.  However, two days ago, I have gotten a message with  INLINE
> crypting like
> 
> -BEGIN PGP MESSAGE-
> Charset: windows-1252
> Version: GnuPG v2
> 
> hQIMA4/WG/fTbdX8ARAAw0CwUeDUpr34bVyIdOv+S32F8sMeCogqz0VIeKe+Qaq1
> ,snip>
> =XbKy
> -END PGP MESSAGE-
> 
> and I can not open it.
> I have NEVER used this inline stuff, hence my question:
> 
> How can I read it?
> 
> Thanks

I saw that you got a good answer already but I just wanted to add that
you can trigger this automatically:

From the FAQ: 

"How to make oldstyle / classic / traditional / inline PGP work? 

With recent Mutts >= 1.5.7, use the  function
automatically inside a message-hook, setting this one line in muttrc:

message-hook '!(~g|~G) ~b"^-BEGIN\ PGP\ (SIGNED\ )?MESSAGE"' "exec 
check-traditional-pgp"

: Note: This doesn't work so well with inline signatures within MIME
digests. ..."

https://dev.mutt.org/trac/wiki/MuttFaq/Encryption

In my experience it is a bit of a hit and miss though.

Best regards

-- 
Jonas Hedman 

PGP: 8F72 C5BE AAFA B4BA 8F46 9185 5C39 89E0 616B B08C


signature.asc
Description: Digital signature


Re: Delete all threads which are incomplete?

2016-07-03 Thread Jonas Hedman
On 16-07-02 14:57:53, Francesco Ariis wrote:
> 
> Ah! my time to shine
> 
> http://www.ariis.it/static/articles/mutt-ml/page.html
> 
> tl;dr: play around with
> 
> macro index d "~l~N(!~(!~x.+))(!~(~F))"
> 
> and see if you like it
> -F

I just wanted to thank you for sharing this, I found it very useful!


Regards
-- 
Jonas Hedman 

XMPP:n...@nstr.se
PGP Key: 0x5c3989e0616bb08c
Fingerprint: 8F72 C5BE AAFA B4BA 8F46  9185 5C39 89E0 616B B08C


signature.asc
Description: Digital signature


Re: integrated gpg

2016-05-15 Thread Jonas Hedman
On 16-05-15 03:27:20, Bob Holtzman wrote:
> On Fri, May 13, 2016 at 10:15:25PM +0200, Wim wrote:
> 
> After much screwing around I ran across the solution. I had been
> entering "p" in the compose window too early. After composing the
> message and hitting "escape" then ":wq" I hit "p" in the next window,
> the one where you normally enter "y" to send the message. Lo and behold
> the encryption menu appeared. Unfortunately that revealed another
> problem. When encrypting a test message, sending it, then going into the
> outbox and trying to decrypt it, it throws an error about the passphrase
> being invalid. A search turned up nothing applicable.
> 
> I'm at a loss to know where to start trying to troubleshoot this. 
> Any ideas?
> 

This might be stupid and or too obvious but do you have yourself as a
gpg-recipient?

For example, I have the following in my .muttrc so that I can always
later on read my encrypted sent emails:

set pgp_encrypt_sign_command="/usr/lib/mutt/pgpewrap gpg2
--passphrase-fd 0 --batch --quiet --no-verbose \
--textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust
--encrypt-to 616BB08C -- -r %r -- %f"

If I leave out the "... --encrypt-to 616BB08C ..."-part then, _only_ 
the recipient(s) on the other end can decrypt the email.

Though some argue this is bad practice but I think it depends on your
use case. 

I'm not sure that this is your issue but I'm throwing this out there
anyway.

Regards.
-- 
Jonas Hedman 

XMPP:n...@nstr.se
PGP Key: 0x5c3989e0616bb08c
Fingerprint: 8F72 C5BE AAFA B4BA 8F46  9185 5C39 89E0 616B B08C


signature.asc
Description: Digital signature


Re: Disable arrow keys for navigation

2016-04-28 Thread Jonas Hedman
On 16-04-28 18:41:35, Joel Buckley wrote:
> Something like this:
> 
> bind index,pager  noop
> bind index,pager  noop
> bind index,pager  noop
> bind index,pager  noop
> 
> Works for me
> 
> -- 
> Joel Buckley


That does exactly what I want!

Many thanks and I apologize for not reading the documentation carefully
enough and failing to notice noop.
-- 
Jonas Hedman 

XMPP:n...@jabber.at
PGP Key: 0x5c3989e0616bb08c
Fingerprint: 8F72 C5BE AAFA B4BA 8F46  9185 5C39 89E0 616B B08C


signature.asc
Description: Digital signature


Disable arrow keys for navigation

2016-04-28 Thread Jonas Hedman
Hi mutters

This might be slightly weird but I would like to disable navigation 
(goto next or previous email) by arrow keys (up, down) in the index &  
pager. The motivation for this is to get into my thick head that I 
should use hjkl.

Can this be achieved somehow? I tried to search in the documentation for
a way to override default behaviour _and_ bind a key to do nothing but I
couldn't find any "do nothing" function in
http://www.mutt.org/doc/manual/#functions

What is the best (or least worst) way of doing this? 

Any ideas?

Regards
-- 
Jonas Hedman 

XMPP:n...@jabber.at
PGP Key: 0x5c3989e0616bb08c
Fingerprint: 8F72 C5BE AAFA B4BA 8F46  9185 5C39 89E0 616B B08C


signature.asc
Description: Digital signature


Clash between macro for saving & msg-hook for checking traditional pgp

2016-03-14 Thread Jonas Hedman
I have the following macro in my .muttrc

macro index hy ":set confirmappend=no delete=yes
auto_tag=yes\n=main/stuff\n:set
confirmappend=yes delete=ask-yes\n"

 and I also have

message-hook '!(~g|~G) ~b"^-BEGIN\ PGP\ (SIGNED\ )?MESSAGE"' "exec
check-traditional-pgp"

To deal with old-style inline encrypted emails.

When I try to save an inline encrypted email using the above macro
something weird happens:

It opens vim in "compose mail-mode" and wants to forward the mail I'm
trying to save To: irmappend=yes@computername,delete=ask-yes@computername

When I exit vim I end up in compose mode editing the cc header to
"heck-traditional-pgp>"

I have no idea what is going on here but I guess there is some kind of
clash between the message hook and the macro. Is there anyway I can get
them to work nicely together?

Regards
-- 
Jonas Hedman 

XMPP:n...@jabber.at
PGP Key: 0x5c3989e0616bb08c
Fingerprint: 8F72 C5BE AAFA B4BA 8F46  9185 5C39 89E0 616B B08C


signature.asc
Description: Digital signature


Re: Need passphrase for unencrypting but not for signing

2016-01-26 Thread Jonas Hedman
On 16-01-26 00:20:40, Xu Wang wrote:
> Hello all,
> 
> I have set up gpg signing, encrypting, and I also have to decrypt when
> someone send an encrypted message to me. However, I find it curious
> that in order to decrypt a message I need to put my passphrase in. But
> for signing, I do not need to. Is this normal? It is the same
> passphrase. I'm not sure which settings I set in order to achive this.

I don't have an answer to your question but I'm really curious about
this. What does your setup look like and how did you create your 
keypair? Did you use any special options in the creation process?

Typically one would want to be prompted for a passphrase both for
decryption and signing.

Mutt can be set to remember the gpg passphrase for a certain time. Is it
possible that you might have decrypted some email and typed the
passphrase and then while mutt remembered the passphrase signed and sent
another email?

Interesting situation nevertheless.

-- 
Jonas Hedman 

XMPP:n...@jabber.at
PGP Key: 0x5c3989e0616bb08c
Fingerprint: 8F72 C5BE AAFA B4BA 8F46  9185 5C39 89E0 616B B08C


signature.asc
Description: Digital signature


Macro for goto next in thread and then go back out to inbox

2016-01-25 Thread Jonas Hedman
When reading long threads in mailing lists I often feel it might be
convenient to have the following functionality in the pager:

Instead of working my way through a thread using  or  I
would like to press some key and it takes me to the next message in the
thread like  but when I reach the last mail in the thread
and press again it takes me back out to the current inbox index. 

I'm pretty much a noob but I'm wondering if it might be possible to
define this as a macro?

Any help would be highly appreciated!

-- 
Jonas Hedman 

XMPP:n...@jabber.at
PGP Key: 0x5c3989e0616bb08c
Fingerprint: 8F72 C5BE AAFA B4BA 8F46  9185 5C39 89E0 616B B08C


signature.asc
Description: Digital signature


Re: understanding PGP encrypt to myself

2015-11-14 Thread jonas hedman
On 15-11-14 17:45:47, Xu Wang wrote:
> Hi,
> 
> I am learning more about PGP encryption with mutt, and am following this 
> guide:
> http://dev.mutt.org/trac/wiki/MuttGuide/UseGPG
> 
> There is a part which discusses about "also encrypt the message using
> the author's public key". This is very useful because now I can
> decrypt the message that I send (in case I want to see what I sent). I
> would like to understand more what happens.
> 
> When I encrypt with public key of recipient *and* with my public key,
> is this to mean that I send two separate messages, one encrypted with
> recipient public key and a separate one with my public key? Or it is
> possible to send *one* message that both the recipient and me are
> capable of decrypting. I am trying to understand how this magic works.
> 
> Kind regards,
> 
> Xu


You just send one message. If you have a Sent-dir then you can
decrypt it yourself at a later date, if you don't do this can decrypt it
afterwards. It's pretty handy at times.

Basically, the encrypted messages gets two recipients and can be
decrypted by two private keys, yours and the person you sent the email
to.


-- 
Jonas Hedman 

XMPP:n...@jabber.at
PGP Key: 0x5c3989e0616bb08c
Fingerprint: 8F72 C5BE AAFA B4BA 8F46  9185 5C39 89E0 616B B08C


signature.asc
Description: Digital signature


Re: mutt with GPG and S/Mime

2015-06-30 Thread jonas hedman
On 15-06-30 22:00:27, Niels Kobschaetzki wrote:
 Hi,
 
 is it possible to use with one account PGP and S/Mime? I found a how-to
 for using S/Mime or using mutt with one account with PGP and one account
 S/Mime. But I want to use my main account with both and would like to
 choose on a per user basis whether I encrypt via PGP or S/Mime. I know
 people who use only PGP and others only S/Mime.
 So: is this possible in mutt? If yes, how - any how-tos you can
 recommend?
 
 Thanks,
 Niels

Hi!

I use send-hooks for this for examples
send-hook someonewhoperfersinlinecry...@mail.com set pgp_autoinline; set 
pgp_autoencrypt

While I have S/Mime as standard in my default crypto settings.

/jonas


signature.asc
Description: Digital signature


Re: Swedish chars in attached gpg-encrypted message fails

2015-06-21 Thread jonas hedman
On 15-06-20 12:37:06, Kevin J. McCarthy wrote:
 jonas hedman wrote:
Content-Type: text/plain; charset=iso-8859-1
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
  
 Secret =E5=E4=F6 =C5=C4=D6
 
 As the header shows, the =E5 characters are quoted-printable encoding.
 
 Mutt is encoding the characters because the PGP/MIME RFC (3156) says all
 8-bit characters for pgp/signed message MUST be encoded.  (I am guessing
 you are both signing and encrypting the messages.)
 
 Email clients should generally deal with this correctly, and decode the
 content before displaying it.  If for some reason, the recipients are
 viewing the content outside of a MUA, they may want to use the qprint
 utility to decode and view the content.
 
  2. Why doesn't this problem show up when encrypting inline style?
 
 Inline style has no such mandate.  If allow_8bit is set and you are also
 encrypting the message (which ascii-armors the output), then Mutt allows
 the 8-bit encoding.
 
 -- 
 Kevin J. McCarthy
 GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA
 http://www.8t8.us/configs/gpg-key-transition-statement.txt


Thank you so much for your informative reply!
I've done some reading and I get the issue better now.

I guess I either have to come up with some neat and simple way to for my
recipients to decode quoted-printable or just stick with inline style
encryption for these people.

Thanks again! :)


/jonas




signature.asc
Description: Digital signature


Re: Swedish chars in attached gpg-encrypted message fails

2015-06-21 Thread jonas hedman
On 15-06-21 09:36:53, Heinz Diehl wrote:
 On 21.06.2015, jonas hedman wrote: 
 
  I'm from Sweden and I occasionally communicate with other swedish people
  using pgp and I've stumbled upon this problem:
  If I encrypt a message containg any of the swedish letters åÅäÄöÖ
  using inline format everythings works just fine but when I encrypt it in
  the standard way, i.e sending the encrypted message as attachment the
  swedish letters get messed up when the recipient decrypts the message
 
 I'm from Norway (åøæ), and it works for me. I think it's a decoding
 problem on the receiver side. What happens when you send such a mail
 to yourself? Do you see garbled characters or is everything fine?



I think you are right. I guess the msg.asc are meant to be dercypted in
a mail client and therefor it fails when its decrypted manually from
commandline.

If I encrypt and send a email to myself and decrypt it in mutt it
works perfectly but if I save the msg.asc and decrypt it manually I get
Content-Transfer-Encoding: quoted-printable undecoded. So the problem is
seems mostly to be on the part of the receiver.

I think I have to convince my friends to get decent email clients =)

Thanks for your reply!
/jonas



signature.asc
Description: Digital signature


Swedish chars in attached gpg-encrypted message fails

2015-06-20 Thread jonas hedman
Hi, I have a slightly annoying problem.

I'm from Sweden and I occasionally communicate with other swedish people
using pgp and I've stumbled upon this problem:
If I encrypt a message containg any of the swedish letters åÅäÄöÖ
using inline format everythings works just fine but when I encrypt it in
the standard way, i.e sending the encrypted message as attachment the
swedish letters get messed up when the recipient decrypts the message
(not in mutt as for as I know).

For example if I encrypt the message Secret åäö ÅÄÖ and send it to
myself and then decrypt it in mutt it shows exactly;

  headers  stuff then:
  [-- The following data is PGP/MIME encrypted --]

Secret åäö ÅÄÖ

  [-- End of PGP/MIME encrypted data --]

but if I save the actual msg.asc file and decrypt it manually from
commandline I get

  Content-Type: text/plain; charset=iso-8859-1
   Content-Disposition: inline
   Content-Transfer-Encoding: quoted-printable

   Secret =E5=E4=F6 =C5=C4=D6

And this apparently what any recipient gets upon decryption. Any swedish
char in terminal shows up just fine on my system (debian) and my locale
is LANG=en_US.UTF-8 and I don't have any other problems with Swedish
chars as far as I know. But something goes wrong.

I basically have two questions,

1. How to fix this?
2. Why doesn't this problem show up when encrypting inline style?

I'm sorry if this is stupid, I know very little about charsets and
encodings.

My cryptopart of .muttrc looks like this:

  #gpg
  set pgp_use_gpg_agent = no

  set pgp_sign_as = 616BB08C
  set pgp_timeout = 3600
  set crypt_autosign = yes
  set crypt_replyencrypt = yes

  set pgp_decode_command=gpg %?p?--passphrase-fd 0? --no-verbose --batch 
--output - %f
  set pgp_verify_command=gpg --no-verbose --batch --output - --verify %s %f
  set pgp_decrypt_command=gpg --passphrase-fd 0 --no-verbose --batch --output 
- %f
  set pgp_sign_command=gpg --no-verbose --batch  --output - --passphrase-fd 0 
--armor --detach-sign \
  --textmode %?a?-u %a? %f
  set pgp_clearsign_command=gpg --no-verbose --batch --output - 
--passphrase-fd 0 --armor \
  --textmode --clearsign %?a?-u %a? %f
  set pgp_encrypt_only_command=/usr/lib/mutt/pgpewrap gpg --batch --quiet 
--no-verbose --output - --encrypt \ 
  --textmode --armor --always-trust --encrypt-to 616BB08C -- -r %r -- %f
  set pgp_encrypt_sign_command=/usr/lib/mutt/pgpewrap gpg --passphrase-fd 0 
--batch --quiet --no-verbose \
  --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust 
%--encrypt-to 616BB08C -- -r %r -- %f
  set pgp_import_command=gpg --no-verbose --import -v %f
  set pgp_export_command=gpg--no-verbose --export --armor %r
  set pgp_verify_key_command=gpg --no-verbose --batch --fingerprint 
--check-sigs %r
  set pgp_list_pubring_command=gpg --no-verbose --batch --with-colons 
--list-keys %r
  set pgp_list_secring_command=gpg --no-verbose --batch --with-colons 
--list-secret-keys %r
  set pgp_good_sign=^gpg:Good signature from
  message-hook '!(~g|~G) ~b^-BEGIN\ PGP\ (SIGNED\ )?MESSAGE' exec 
check-traditional-pgp

Mutt version Mutt 1.5.23 / gpg  1.4.18 @ debian stable.

Any help or pointers on how to resolve this would be highly appreciated!
With kindly regards
Jonas Hedman



signature.asc
Description: Digital signature