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


Re: Trouble with decryption of certain emails using GPG + Mutt application/pgp-encrypted is unsupported

2015-02-16 Thread jonas

A small update on the matter. John was kind enough the send me a
encrypted test email from the iphone app and it worked
perfectly. I could verify signatures and and decrypt it properly from
within mutt automatically without any trouble. 

With this in mind I just realized that my friend for weird and unknown
reasons uses hotmail. Could that have something to do with it?

/jonas


signature.asc
Description: Digital signature


Trouble with decryption of certain emails using GPG + Mutt application/pgp-encrypted is unsupported

2015-02-14 Thread jonas
Hello! I'm having some trouble decrypting emails from a friend who is
using some kind of Iphone app for PGP.

When I get a encrypted email from this person it usually looks like this:

Date: Tue, 3 Feb 2015 13:06:17 +0100
From: frend friend@...
To: me
Subject: something

[-- Attachment #1 --]
[-- Type: text/plain, Encoding: 7bit, Size: 0.1K --]

[-- Attachment #2: encrypted.asc --]
[-- Type: application/pgp-encrypted, Encoding: 7bit, Size: 2.5K --]

[-- application/pgp-encrypted is unsupported (use 'v' to view this part)
--]

[-- Attachment #3 --]
[-- Type: text/plain, Encoding: 7bit, Size: 0.1K --]


Where,

[-- Attachment #1 --] always is a empty plain textfile.
[-- Attachment #2: encrypted.asc --] is the encrypted message
[-- Attachment #3 --] is either empty or contains non-cryptographic
signature plaintext. i.e kindly regards /friend

I want mutt to automagically recognize encrypted.asc and do its normal
buisniess. I have no problems with signatures, inline encrypted emails
or emails with empty bodies with just one attached encrypted.asc but when
I get emails formated this way it doesn't work for some reason.

I can save encrypted.asc and decrypt it manually from commandline so
there seems to be nothing wrong with the encryption.

I would really appreciate if someone could help me out and make this
work.

Here is my config related to gpg:

In mutt.rc:

source ~/.gpg.rc

set pgp_use_gpg_agent = yes

set pgp_sign_as = ...
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 ... -- -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 ky -- -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


And my .gpg.rc

# GnuPG configuration
set pgp_decode_command=gpg --status-fd=2 %?p?--passphrase-fd 0?
--no-verbose --quiet --batch --output - %f
set pgp_verify_command=gpg --status-fd=2 --no-verbose --quiet --batch
--output - --verify %s %f
set pgp_decrypt_command=gpg --status-fd=2 %?p?--passphrase-fd 0?
--no-verbose --quiet --batch --output - %f
set pgp_sign_command=gpg --no-verbose --batch --quiet --output -
%?p?--passphrase-fd 0? --armor --detach-sign --textmode %?a?-u %a? %f
set pgp_clearsign_command=gpg --no-verbose --batch --quiet --output -
%?p?--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 --
-r %r -- %f
set pgp_encrypt_sign_command=/usr/lib/mutt/pgpewrap gpg
%?p?--passphrase-fd 0? --batch --quiet --no-verbose --textmode --output
%- --encrypt --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f
set pgp_import_command=gpg --no-verbose --import %f
set pgp_export_command=gpg --no-verbose --export --armor %r
set pgp_verify_key_command=gpg --verbose --batch --fingerprint
--check-sigs %r
set pgp_list_pubring_command=gpg --no-verbose --batch --quiet
--with-colons --list-keys %r
set pgp_list_secring_command=gpg --no-verbose --batch --quiet
--with-colons --list-secret-keys %r
set pgp_good_sign=^\\[GNUPG:\\] GOODSIG


My version of mutt is 1.5.23  and gpg is 1.4.18

Thanks and sorry for a lenghty post.

/Jonas



signature.asc
Description: Digital signature


Re: pin flagged messages

2014-03-13 Thread Jonas Petong
On 12.Mar 2014, 20:03, Mart Lubbers wrote:
 On Wed, Mar 12, 2014 at 06:43:01PM +0100, Jonas Petong wrote:
  On 11.Mar 2014, 13:23, Mart Lubbers wrote:
   On Thu, Feb 27, 2014 at 07:37:27AM -0600, David Champion wrote:
* On 27 Feb 2014, Mart Lubbers wrote: 
 Hi,
 I've looked in the overwhelming and detailed documentation but 
 couldn't
 find an answer. I was wondering if it was possible to pin flagged 
 emails
 on top of the mailbox. So that mutt displays my email by date(or any
 other sorting method I initialized) but always keeps my flagged as
 important mails(by ^F) pinned to the top of the screen.

You would need to use scoring for this, and to sort by score.
  
  I'd recommend to configure your scoring rules as follows:
  
  # # default - scoring
  unscore *
  score '~A'  +1  
  # all messages start with score 1
  score ~F+9  
  # flagged mails are important
  score ~D=0  
  # this is a deleted email
  
  # # thresholds
  set score_threshold_delete=0
  # delete messages with score 0
  
  # # basic-coloring
  color index default white ~n'1-1'
  color index default yellow ~n'1'
  color index red default '~D'
  
  # # SPAM rules
  score ~s'sex'|~s'adult'|~s'penis'|~s'xxx'|~s'viagra' -99
  # delete this
  

-- 
David Champion • d...@bikeshed.us
   
   Thanks again, I've been working on this for some hours and have it
   almost done, the only thing that doesn't work is the sorting.
   I'm using this macro for pinning posts, it basically flags the message
   and then scores all flagged messages 1 and all others 0.
   
   macro index \CP flag-messageenter-commandunscore 
   *enterenter-commandscore ~A 0enterenter-commandscore ~F 1enter 
   toggle pin
  
  Following the scoring-rules explained above, your command should rather look
  like this:
  
  macro index,browser \CP \
flag-message:source ~/.muttrcenter \
Flag Message then source scoring rules
  
   
   Now I want it to be sorted first on score and then on date.
   So all messages with score 1 have to be on top and sorted on date and
   all messages with score 0 have to be under the score 1 messages and also
   sorted on date.
   
   Is this possible? I've tried lots of sort and sort_aux methods but
   couldn't find the right configuration. It would be even better if my
   thread view stays in tact.
  
  For this it would be enough to just define
  
  set sort=score
  set sort_aux=reverse-date
  
  OR you can even define a scoring rule matching your Inbox-Folder...
  
  folder-hook ~/path/to/your/inbox  set sort=score
  folder-hook ~/path/to/your/inbox  set sort_aux=reverse-date
  
  this should all go into your ~/.muttrc and I think you're fine.
  BTW I think it's a nice idea to pin your flagged messages on top of
  your mails received, so it makes you remind responding them by time.
  
  I'd be interested if someone came up with a way to sort them as threads
  in the second place!
  
   Thanks, Mart
  
  cheers
  ---
  'It always seems impossible until it's done.' Nelson Mandela - Live by this 
  people!
 
 Hi,
 Thanks for the response, it is still not how I want it. My thread
 structure is gone and the date is with the newest the lowest whereas I
 would like my newest to be the first.

Yes right, this seems unachievable with the vim-own sort settings. For
me it makes no difference whether I choose sort_aux=date,
sort_aux=reverse-date or even sort_aux=reverse-last-date-received.
All of the three methods will rearrange my messages from first-, to
last-received, instead of the other way round.

 Mart
 
 ps. The scoring is very clever, however if you have some commands that
 you want to run exactly once in your muttrc you have a problem:)

If you create a standalone config-file, which contains your scoring
rules only, there is no need to source your entire muttrc. You could
name this file e.g. ~/.mutt/muttrc_scoring and than adjust above
mentioned macro to make it source your muttrc_scoring file only. Anyhow
those should be sourced at startup as well. To achieve this, just put
the following line into your muttrc:

so ~/.mutt/muttrc_scoring

\CP will exclusively reload your scoring rules, not your muttrc anymore!

Still remaining the 'set sort' issue, which seems somehow rare to me.
Hopefully there'll be someone delivering an explanation for it, since for
me it seems unexplainable.

cheers

---
jonas

'It always seems impossible until it's done.' Nelson Mandela - Live by this 
people!


Re: pin flagged messages

2014-03-12 Thread Jonas Petong
On 11.Mar 2014, 13:23, Mart Lubbers wrote:
 On Thu, Feb 27, 2014 at 07:37:27AM -0600, David Champion wrote:
  * On 27 Feb 2014, Mart Lubbers wrote: 
   Hi,
   I've looked in the overwhelming and detailed documentation but couldn't
   find an answer. I was wondering if it was possible to pin flagged emails
   on top of the mailbox. So that mutt displays my email by date(or any
   other sorting method I initialized) but always keeps my flagged as
   important mails(by ^F) pinned to the top of the screen.
  
  You would need to use scoring for this, and to sort by score.

I'd recommend to configure your scoring rules as follows:

# # default - scoring
unscore *
score '~A'  +1  # 
all messages start with score 1
score ~F+9  # 
flagged mails are important
score ~D=0  # 
this is a deleted email

# # thresholds
set score_threshold_delete=0# 
delete messages with score 0

# # basic-coloring
color index default white ~n'1-1'
color index default yellow ~n'1'
color index red default '~D'

# # SPAM rules
score ~s'sex'|~s'adult'|~s'penis'|~s'xxx'|~s'viagra' -99# 
delete this

  
  -- 
  David Champion • d...@bikeshed.us
 
 Thanks again, I've been working on this for some hours and have it
 almost done, the only thing that doesn't work is the sorting.
 I'm using this macro for pinning posts, it basically flags the message
 and then scores all flagged messages 1 and all others 0.
 
 macro index \CP flag-messageenter-commandunscore 
 *enterenter-commandscore ~A 0enterenter-commandscore ~F 1enter 
 toggle pin

Following the scoring-rules explained above, your command should rather look
like this:

macro index,browser \CP \
  flag-message:source ~/.muttrcenter \
  Flag Message then source scoring rules

 
 Now I want it to be sorted first on score and then on date.
 So all messages with score 1 have to be on top and sorted on date and
 all messages with score 0 have to be under the score 1 messages and also
 sorted on date.
 
 Is this possible? I've tried lots of sort and sort_aux methods but
 couldn't find the right configuration. It would be even better if my
 thread view stays in tact.

For this it would be enough to just define

set sort=score
set sort_aux=reverse-date

OR you can even define a scoring rule matching your Inbox-Folder...

folder-hook ~/path/to/your/inbox  set sort=score
folder-hook ~/path/to/your/inbox  set sort_aux=reverse-date

this should all go into your ~/.muttrc and I think you're fine.
BTW I think it's a nice idea to pin your flagged messages on top of
your mails received, so it makes you remind responding them by time.

I'd be interested if someone came up with a way to sort them as threads
in the second place!

 Thanks, Mart

cheers
---
'It always seems impossible until it's done.' Nelson Mandela - Live by this 
people!


Re: Yet another 'duplicate' thread

2013-11-15 Thread Jonas Petong
On 15.Nov 2013, 01:18, Gregor Zattler wrote:
 Hi Jonas,
 * Jonas Petong jonas.pet...@web.de [13. Nov. 2013]:
  On 13.Nov 2013, 13:01, Nathan Stratton Treadway wrote:
  On Wed, Nov 13, 2013 at 18:50:44 +0100, Jonas Petong wrote:
  Cameron, you were right, the message id's are the same. From the matter 
  of fact
  that limiting my Inbox by ~= did not work led me to the conclusion that 
  their
  IDs have been different. Seems like you've teached me wrong so.
  
  What happens when you try to limit by ~= ?  
  
  (Note that as I understand this limit only works when the sort order is
   thread.  That is, with no limit applied you should be seeing the
   duplicate messages marked with an = character your mailbox index
   listing, and then those marked messages will be selected by the 
  ~=
   filter.)
  
  solved... 
 
 but then, why limit the view?  Delete the duplicate message
 right away:
 
 1) open mailfoder in question
 2) switch to threaded view (per default the key binding is ot)
 3) delete-pattern ~= (per default the key-binding is D~=RETURN
 4) carefully examine if the right messages are flagged with a D
 5) expunge the messages via sync-messages (default key-binding
in index is $).

In fact this is how I did in the end. Thank you anyways, though. Seems
like I didn't point this out in detail when writing my first request.

Have a nice weekend!
Jonas

 
 Done.
 
 HTH, Gregor

-- 
the basis of a healthy, tidy mind is a big trash basket. [Kurt Tucholsky]


Re: Yet another 'duplicate' thread

2013-11-14 Thread Jonas Petong
On 14.Nov 2013, 10:24, Cameron Simpson wrote:
 On 13.Nov 2013, 13:01, Nathan Stratton Treadway wrote:
  (Note that as I understand this limit only works when the sort order is
   thread. That is, with no limit applied you should be seeing the
   duplicate messages marked with an = character your mailbox index
   listing, and then those marked messages will be selected by the ~=
   filter.)
 
 Worth restating. This is something of a mutt annoyance - silent failure.
 
 On 13Nov2013 20:38, Jonas Petong jonas.pet...@web.de wrote:
  Sorry for that one! Cameron, could you explain me anyhow how to use that 
  script
  you proposed? Or at least which environment to set? Might be of use for 
  further
  stuck in nowhere problems (even if for no reason as in my case). You all 
  have
  a great day!
 
 Well, the script as supplied is pseudocode (and of course untested),
 but based around using Python. (If you don't know Python, it is
 well worth learning.)

in fact I was going to learn python anyways for the simple fact that it is the
preferred script language to manage a raspberry pi! I'll take your advice for
sure then.

 
 A fuller (but still totally untested) sketch might look like this:
 
 #!/usr/bin/python
 
 import sys
 import email.parser
 from mailbox import Maildir
 
 # get the maildir pathname from the command line
 mdirpath = sys.argv[1]
 
 # open the Maildir
 M = Maildir(mdirpath)
 
 # list holding message information
 L = []
 for key in M.keys():
 # open the message file
 fp = M.get_file(key)
 # load the headers from this message
 hdrs = email.parser.Parser().parse(fp, headersonly=True)
 # speculative: get the filename of the message
 pathname = fp.name
 fp.close()
 # make a tuple with the info we want
 info = hdrs['date'], hdrs['subject'], hdrs['message-id'], key, pathname
 L.append(info)
 
 # sort the list
 # because we have date then subject in the tuple, the sort order is date then 
 subject
 # (then message-id, then key)
 L = sorted(L)
 
 # this last bit could be adapted to move every second message elsewhere
 for i in range(0, len(L), 2):
 date, subject, message_id, key, pathname = L[i]
 fp.close()
... decide what to do...
 
 The last loop iterates 0, 2, 4,... up to the largest index in the list L.
 
 Pulling every second message like this is very fragile - you needed
 to be totally sure that you had an exactly duplicated set of messages.
 
 Personally, I would be inclined to make a dict instead of a list,
 mapping message-ids to a list of message paths (or the info tuples).
 Then you can iterate over the dict and remove or move sideways the
 second and following messages for each message-id, leaving only the
 original.
 
 I'd also be writing this script to print a report instead of
 moving/deleting. Then I can examine the output for sanity before
 hitting the button. If the report went:
 
 pathname message-id date subject
 
 it would be easy to read the pathnames from a second script to do
 the actual message removal. Or whatever.
 
 Please feel free to ask whatever questions you like. I do a lot of
 stuff with Maildirs and Python; I replaced procmail with my own
 mail filing program a year or so ago.

the only thing left for me to do is following the good example of Maurice
speaking out my regards for this deep-in-detail answer. Thank you so much for
your effort! In the way you were explaining those two lines of code makes it
easy to understand and, in fact, is a perfect start to learn python. Even if
that wasn't my intention in the first place ;-) Thank you, Cameron!

cheers,
jonas

 
 Cheers,
 -- 
 Cameron Simpson c...@zip.com.au
 
 Q: How many user support people does it take to change a light bulb?
 A: We have an exact copy of the light bulb here and it seems to be
 working fine. Can you tell me what kind of system you have?

-- 
the basis of a healthy, tidy mind is a big trash basket. [Kurt Tucholsky]


Re: Yet another 'duplicate' thread

2013-11-13 Thread Jonas Petong
On 13.Nov 2013, 00:48, Ken Moffat wrote:
 On Tue, Nov 12, 2013 at 07:22:24PM +0100, Jonas Petong wrote:
  Today I accidentally copied my mails into the same folder where they had 
  been
  stored before (evil keybinding!!!) and now I'm faced with about a 1000 
  copies
  within my inbox. Since those duplicates do not have a unique mail-id, it's
  hopeless to filter them with mutts integrated duplicate limiting pattern.
  Command 'limit~=' has no effect in my case and deleting them by hand
  will take me hours!
  
  I know this question has been (unsuccessfully) asked before. Anyhow is 
  there is
  a way to tag every other mail (literally every nth mail of my inbox-folder) 
  and
  afterwards delete them? I know something about linux-scripting but 
  unfortunately
  I have no clue where to start with and even which script-language to use.
  
  This close-to-topic approach with 'fdupes' has been released some time ago
  (http://consolematt.wordpress.com/tag/fdupes/) but in my view it seems way 
  to
  complicated. As I could recognize from mutts mailing archive, I'm not the 
  only
  one who has had trouble with it. Therefore I appreciate any hint which 
  drives me
  into the right direction and helps me solving this.
  
  Running Mutt 1.5.21 under Ubuntu Gnome 13.10. (Linux 3.11.0-13-generic).
  
  I don't have a script, but I usually view lists without threading,
 using date/time sent in sender's timezone (%d) - I'm sure that using
 the local time zone (%D) probably works the same way.  On occasion I've
 had to change which of my upstreams was subscribed to heavy-traffic
 lists such as lkml, and at other times I've occasionally had mails
 appearing twice after upstream problems.  When needed, it's just a
 case of looking at the index and deleting every other mail.
 Tedious, but achievable - particularly for only 1000 mails - I've
 done more than that in the past ;-)

me too, but I thought that was kind of a waste of time if there was a
possibility to solve this with a script automatically. Or even better within
mutt itself. By the way I'm a bit worried about my 'j' key ;-)

 
  I believe the order in which I see mails is governed by
 index_format [ I haven't looked at this stuff in ages - why break
 what works for me ]. Mine is:
 
 set index_format=%4C %Z %{%b %d} %-15.15n (%?l?%4l%4c?) %s

looks pretty much like mine.

  If you aren't a reckless person, turn off incoming mail and backup
 the directory or mbox before you try *any* solution.

thank you for that one, I mean it! Wouldn't be the first time trying to restore
old folders from my external backup drive. Just stored a copy of my ~/Mails :-)

 
 ĸen
 -- 
 das eine Mal als Tragödie, dieses Mal als Farce

-- 
the basis of a healthy, tidy mind is a big trash basket. [Kurt Tucholsky]


Re: Yet another 'duplicate' thread

2013-11-13 Thread Jonas Petong
On 13.Nov 2013, 13:01, Nathan Stratton Treadway wrote:
 On Wed, Nov 13, 2013 at 18:50:44 +0100, Jonas Petong wrote:
  Cameron, you were right, the message id's are the same. From the matter of 
  fact
  that limiting my Inbox by ~= did not work led me to the conclusion that 
  their
  IDs have been different. Seems like you've teached me wrong so.
 
 What happens when you try to limit by ~= ?  
 
 (Note that as I understand this limit only works when the sort order is
 thread.  That is, with no limit applied you should be seeing the
 duplicate messages marked with an = character your mailbox index
 listing, and then those marked messages will be selected by the ~=
 filter.)

solved... this is really a newbies error: not reading the manual properly -.-
Sorry for that one!  Cameron, could you explain me anyhow how to use that script
you proposed? Or at least which environment to set? Might be of use for further
stuck in nowhere problems (even if for no reason as in my case). You all have
a great day!

 
   Nathan

-- 
the basis of a healthy, tidy mind is a big trash basket. [Kurt Tucholsky]


Yet another 'duplicate' thread

2013-11-12 Thread Jonas Petong
Today I accidentally copied my mails into the same folder where they had been
stored before (evil keybinding!!!) and now I'm faced with about a 1000 copies
within my inbox. Since those duplicates do not have a unique mail-id, it's
hopeless to filter them with mutts integrated duplicate limiting pattern.
Command 'limit~=' has no effect in my case and deleting them by hand
will take me hours!

I know this question has been (unsuccessfully) asked before. Anyhow is there is
a way to tag every other mail (literally every nth mail of my inbox-folder) and
afterwards delete them? I know something about linux-scripting but unfortunately
I have no clue where to start with and even which script-language to use.

This close-to-topic approach with 'fdupes' has been released some time ago
(http://consolematt.wordpress.com/tag/fdupes/) but in my view it seems way to
complicated. As I could recognize from mutts mailing archive, I'm not the only
one who has had trouble with it. Therefore I appreciate any hint which drives me
into the right direction and helps me solving this.

Running Mutt 1.5.21 under Ubuntu Gnome 13.10. (Linux 3.11.0-13-generic).

cheers,
jonas



Re: Better folder navigation ?

2013-03-28 Thread Jonas Geiregat
On 25/03/2013, Max Rydahl Andersen wrote:
 With ~250 nested folders the 'c' change folder is rather tedious to use.
 
 Is there a command to search for a folder by name so I don't have to 
 type/complte in the full name ?

You could list your mailboxes by using the mailboxes command in your
muttrc file.

Then you can easily switch by using the y key:

yMchange-folder?toggle-mailboxes  show
incoming mailboxes list

Then you'll get a list of all your mailboxes and you can search them
using the / key.

 
 Or is it somehow possible to write a macro that uses find shell command to 
 locate list of possible folders
 and then have me choose the right one ?
 
 Thanks,
 /max


Re: Mutt Quick Reference v.1.00

2007-10-18 Thread Jonas Jacobsson
Patrick Shanahan wrote:
 * Joseph [EMAIL PROTECTED] [10-17-07 19:47]:
  I would be interested in mairix as well as I'm using maildir format.
 
 jfyi, mairix now also works with mbox files  :^)

How does mairix integrate with Mutt?

I am very interested, but does it work with Cyrus?

/jonas


Viewing attached pdf files

2007-08-30 Thread Jonas Jacobsson
Hi fellow Mutt users,

How have you solved the problem with viewing attached pdf documents
withing Mutt? I just discovered pdftohtml and pdftotxt and will start
digging on how to use them. 

Since a pdf file is an octetstream I can't just use .mailcap since
that is dependant on the document type specified in the MIME header,
right? (Only looking for octetstream will cause alot of other document
types to be viewed with the same tool.)

/jonas