Re: Deleting attachment from signed email

2007-11-24 Thread Stefan Klinger
Hello again,

and thanks for the extensive reply.

On 23 November 2007, Kyle Wheeler wrote with possible deletions:
> > How can I remove the signature? As said, it's an attachment wihich I 
> > failed to delete due to it's own presence.

> The tricky bit is that decode-save 
> can remove all the headers and such, depending on your other mutt 
> options (I think there's a combination that can be used to preserve 
> the headers, but I'd have to dig through the documentation to figure 
> it out). decrypt-save Might be more to your liking, but it only strips 
> out encrypted messages (i.e. I don't think it will take signing off of 
> a message). However, it probably relies on $pgp_decrypt_command, which 
> you can fiddle with to maybe get what you want done.

Sorry, I completely failed to do this. The documentation of the functions
(decode|decrypt)-(save|copy) seems to be a bit thin. But anyway, I don't
want to decode anything, since there's nothing encoded, only signed.

I had a look at the mutt sources and simply removed the check

  (WithCrypto && hdr->security & ~PGP_TRADITIONAL_CHECKED)
  
from 'recvattach.c'. After compilation I tried the result on copies of a
signed message with attachments. When I only delete the signature
attachment [applica/pgp-signat], I'll see a line

  [-- Error: Inconsistent multipart/signed structure! --]

when I re-open the message. I guess that the required MIME structure is
broken here. But if I leave the signature intact, while removing the
(un)desired attachments, everything is fine.

My findings:
  * removing the signature implies changing the mime-type.
  * removing other attachments breaks the signature, but I can live with
that.
  * if the signature is broken, there's no point in wasting memory on it.
  
My suggestion:
  * Allow deletion of attachments.
  * Allow removing the signature.
  * Maybe require the signature be removed before allowing deletion of
other attachments.

The question is whether this will break anything apart from the
signature being valid? I cannot answer this, since, practically, I have
no knowledge about S/MIME, MIME and all that stuff. Also, I don't know
the mutt source, and I certainly will break things if I change something.

Is anyone interested in fixing this?

Kind regards,
Stefan


-- 
Stefan Klinger  o/klettern
/\/  bis zum
send plaintext only - max size 32kB - no spam \   Abfallen
http://www.stefan-klinger.de


Re: Deleting attachment from signed email

2007-11-23 Thread Kyle Wheeler
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Friday, November 23 at 11:53 AM, quoth Stefan Klinger:
>> If you REALLY REALLY want to delete the attachment and you don't 
>> care about invalidating the signature, you can edit the email with 
>> your text editor (press E).
>
> This is not an option for me. The signature seems to be an attachment itself, 
> and I certainly don't want to hack into the MIME structure. 

Fair enough.

> How can I remove the signature? As said, it's an attachment wihich I 
> failed to delete due to it's own presence.

Mutt has a few helpful functions (that you can bind to keys) that may 
be useful for addressing this sort of problem. Namely, there's 
decrypt-save and decode-save. You can bind them to keys like this:

bind index \eC decode-save # press escape-C to trigger

In the index, if you type a question mark, mutt will show you what 
keys are bound to what functions. The tricky bit is that decode-save 
can remove all the headers and such, depending on your other mutt 
options (I think there's a combination that can be used to preserve 
the headers, but I'd have to dig through the documentation to figure 
it out). decrypt-save Might be more to your liking, but it only strips 
out encrypted messages (i.e. I don't think it will take signing off of 
a message). However, it probably relies on $pgp_decrypt_command, which 
you can fiddle with to maybe get what you want done.

Good luck! hope that helps

~Kyle
- -- 
How can you expect to enjoy life without heartily disliking a good 
many people?
-- Cary Tennis
-BEGIN PGP SIGNATURE-
Comment: Thank you for using encryption!

iD8DBQFHRwdVBkIOoMqOI14RAlXYAKCd85GmOf1NvDEcSiAtnKZbe/G7RQCdFfWC
GTp3kvvK4VjvI5GxDujMZtc=
=3q6q
-END PGP SIGNATURE-


Re: Deleting attachment from signed email

2007-11-23 Thread Stefan Klinger
On 22 November 2007, Kyle Wheeler wrote with possible deletions:
> On Thursday, November 22 at 05:20 PM, quoth Stefan Klinger:
> > Problem:
> > I am not able to remove an attachment or the signature from a signed 
> > message.

> Instead, it's a principle problem. How can you delete an attachment 
> from a signed mail without invalidating the signature? Unless you have 
> the original private key (to re-sign the message after  you modify 
> it), it's technically impossible.

Obviously right. Some people keep sending me email with 3MB attachments, which
annoys me anyway. Since they are impervious to advice, I decided to delete the
attachmenst. I dont't want to remove the whole email though. This worked fine,
until some days ago, when one of them started signing his mail.

> If you REALLY REALLY want to delete the attachment and you don't care 
> about invalidating the signature, you can edit the email with your 
> text editor (press E).

This is not an option for me. The signature seems to be an attachment itself,
and I certainly don't want to hack into the MIME structure. 


On 23 November 2007, Corsair wrote with possible deletions:
> Indeed, one cannot do that in mutt.  However, one can always do a M-s
> to strip out everything but the main text.

This seems not to work for me (key not bound). What should it do? Strip *all*
attachments? Certainly not what I want.


How can I remove the signature? As said, it's an attachment wihich I failed to
delete due to it's own presence.


Kind regards,
Stefan


-- 
Stefan Klinger o/klettern
http://www.stefan-klinger.de   /\/  bis zum
send plaintext only - max size 32kB  \   Abfallen


Re: Deleting attachment from signed email

2007-11-23 Thread Corsair
On Thu, Nov 22, 2007 at 05:20:14PM +0100, Stefan Klinger wrote:
> Problem:
> I am not able to remove an attachment or the signature from a signed message.

Indeed, seems it's exactly what it's designed to be.  However, you can
always do a M-s to strip the main text out from the attachments and
save it in your mailbox.

-- 
There is no emotion; there is peace.
There is no ignorance; there is knowledge.
There is no passion; there is serenity.
There is no death; there is the Force.


pgpgp61cHU9RI.pgp
Description: PGP signature


Re: Deleting attachment from signed email

2007-11-22 Thread Kyle Wheeler
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Thursday, November 22 at 05:20 PM, quoth Stefan Klinger:
> Problem:
> I am not able to remove an attachment or the signature from a signed message.
>
> Reproduce:
> Use muttrc from below, which is quite minimal. Change to a mailbox 
> (on imap) that contains a signed message (indicated by an 's'). 
> Select that message. Press 'v'. Select attachment to be deleted. 
> Press 'd'. Message area displays "Deletion of attachments from 
> encrypted messages is unsupported." and the attachment is not marked 
> for deletion.
>
> How can I do this? Is it a principal problem, or a bug in mutt?

Well, for one thing, it's documented that mutt doesn't do it (in fact, 
as you demonstrated, mutt TELLS YOU that it's not supported), so it's 
not a bug.

Instead, it's a principle problem. How can you delete an attachment 
from a signed mail without invalidating the signature? Unless you have 
the original private key (to re-sign the message after  you modify 
it), it's technically impossible.

If you REALLY REALLY want to delete the attachment and you don't care 
about invalidating the signature, you can edit the email with your 
text editor (press E).

~Kyle
- -- 
Human beings, who are almost unique in having the ability to learn 
from the experience of others, are also remarkable for their apparent 
disinclination to do so.
  -- Douglas Adams
-BEGIN PGP SIGNATURE-
Comment: Thank you for using encryption!

iD8DBQFHRh5gBkIOoMqOI14RAp/qAKCWbao5fRfGk3FB55kMrivYj5C+dQCeKKDW
BzxUeHNEnCY9rCiqEz34by0=
=9mTX
-END PGP SIGNATURE-


Re: Deleting attachment from signed email

2007-11-22 Thread David Champion
> How can I do this? Is it a principal problem, or a bug in mutt?

It's unsupported because attachments are part of the signed data.  If
you delete the attachment, the signature becomes invalid.  I would guess
that this was a design decision, not an oversight (bug).  But that's
largely a semantic technicality.

If you want to remove an attachment, first remove the signature.

-- 
 -D.[EMAIL PROTECTED]NSITUniversity of Chicago
 "War is God's way of teaching Americans geography." - Ambrose Bierce


Deleting attachment from signed email

2007-11-22 Thread Stefan Klinger
Hi.

Although this has been an issue in 2005 already, I was not able to find any fix 
or workaround.

Problem:
I am not able to remove an attachment or the signature from a signed message.

Reproduce:
Use muttrc from below, which is quite minimal. Change to a mailbox (on imap) 
that contains a signed message (indicated by an 's'). Select that message. 
Press 'v'. Select attachment to be deleted. Press 'd'. Message area displays 
"Deletion of attachments from encrypted messages is unsupported." and the 
attachment is not marked for deletion.

How can I do this? Is it a principal problem, or a bug in mutt?

I'm running a Debian GNU/Linux lenny/sid, with a standard 2.6.22-2-686 kernel.

My '~/.mutt/muttrc':

# Define the '+' shortcut, and the entry point for the folder browser (c?)
set folder = "imaps://[EMAIL PROTECTED]"
set imap_pass = ""

# Automatically log in to this mailbox at startup
set spoolfile = "+INBOX"
 
# where to store postponed messages
set postponed = "+Drafts"

# where to store sent mail
set record = "+Sent"

# where to store read mail
set mbox = "+Read"

# where to move mail when it was read
mbox-hook INBOX +Read

# ask before moving read mail to mbox
set move = ask-yes

# do not move read flagged messages to +Read
set keep_flagged = yes

# how often (in seconds) mutt should look for new mail
set mail_check = 600

# cache headers of emails below this directory
set header_cache = "/home/sk/.mutt/cache"



Here's the output of 'mutt -v'

Mutt 1.5.17 (2007-11-01)
Copyright (C) 1996-2007 Michael R. Elkins and others.
Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'.
Mutt is free software, and you are welcome to redistribute it
under certain conditions; type `mutt -vv' for details.

System: Linux 2.6.22-2-686 (i686)
ncurses: ncurses 5.6.20071013 (compiled with 5.6)
libidn: 1.1 (compiled with 1.1)
hcache backend: GDBM version 1.8.3. 10/15/2002 (built Apr 24 2006 03:25:20)
Compile options:
-DOMAIN
+DEBUG
-HOMESPOOL  +USE_SETGID  +USE_DOTLOCK  +DL_STANDALONE  
+USE_FCNTL  -USE_FLOCK   +USE_INODESORT   
+USE_POP  +USE_IMAP  +USE_SMTP  -USE_GSS  -USE_SSL_OPENSSL  +USE_SSL_GNUTLS  
+USE_SASL  +HAVE_GETADDRINFO  
+HAVE_REGCOMP  -USE_GNU_REGEX  
+HAVE_COLOR  +HAVE_START_COLOR  +HAVE_TYPEAHEAD  +HAVE_BKGDSET  
+HAVE_CURS_SET  +HAVE_META  +HAVE_RESIZETERM  
+CRYPT_BACKEND_CLASSIC_PGP  +CRYPT_BACKEND_CLASSIC_SMIME  -CRYPT_BACKEND_GPGME  
-EXACT_ADDRESS  -SUN_ATTACHMENT  
+ENABLE_NLS  -LOCALES_HACK  +COMPRESSED  +HAVE_WC_FUNCS  +HAVE_LANGINFO_CODESET 
 +HAVE_LANGINFO_YESEXPR  
+HAVE_ICONV  -ICONV_NONTRANS  +HAVE_LIBIDN  +HAVE_GETSID  +USE_HCACHE  
-ISPELL
SENDMAIL="/usr/sbin/sendmail"
MAILPATH="/var/mail"
PKGDATADIR="/usr/share/mutt"
SYSCONFDIR="/etc"
EXECSHELL="/bin/sh"
MIXMASTER="mixmaster"
To contact the developers, please mail to <[EMAIL PROTECTED]>.
To report a bug, please visit http://bugs.mutt.org/.

patch-1.5.13.cd.ifdef.2
patch-1.5.13.cd.purge_message.3.4
patch-1.5.13.nt+ab.xtitles.4
patch-1.5.4.vk.pgp_verbose_mime
patch-1.5.6.dw.maildir-mtime.1
patch-1.5.8.hr.sensible_browser_position.3


Hope that helps!

Kind regards,
Stefan Klinger


-- 
Stefan Klinger o/klettern
http://www.stefan-klinger.de   /\/  bis zum
send plaintext only - max size 32kB  \   Abfallen