attachments in index without patching

2010-11-10 Thread Francesco de Virgilio
On 10.11.10, 11:44, Francesco de Virgilio wrote:
 Thanks Stefan and David, it is incredible how sometimes I search
 anywhere for an answer, but at the end it was simply and RTFM matter.
 
 Anyway, I'm now using this
 
 set index_format = %3e %Z %{%d/%m/%y} %-25.25n %?X?[%X]   ? %s
 
 and it works fine, excepted that the counter does not show
 application/octet-stream attachments (in most cases PDF or -- ugly -- .doc or 
 .odt) . Reading the online man, I've
 added
 
 attachments application/octet-stream
 
 to my muttrc, even if I think it's not necessary, since
 
 attachments +A */.*
 
 is defined by default. However, now with :attachments ? I have:
 
 Current attachments settings:
 
 attachments +A */.*
 attachments +A image/jpeg
 attachments +A application/octet-stream
 attachments -A text/x-vcard
 attachments -A application/pgp.*
 attachments -A application/x-pkcs7-.*
 attachments -A message/external-body
 attachments +I text/plain
 attachments -I message/external-body
 
 But, Mutt seems to ignore pdf and WYSIWYG editors attachments during
 count in index.
 
 What's wrong with me?

Answer: me :D

Ok, it was just

attachments +I application/octet-stream

Thanks anyway :)

-- 
Francesco de Virgilio
*Ubuntu-it team member*
   mailto:frad...@ubuntu-it.org
   http://wiki.ubuntu-it.org/FrancescoDeVirgilio
*Wikimedia projects contributor*
   http://en.wikipedia.org/wiki/User:Fradeve11
*OpenStreetMap Mapper*
   http://www.openstreetmap.org/user/Fradeve11
*Blog*
   http://www.fradeve.org
Love - Peace - Freedom - Free Software


signature.asc
Description: Digital signature


Re: attachments in index without patching

2010-11-10 Thread Francesco de Virgilio
On 10.11.10, 00:33, Stefan Wimmer wrote:
 Hi, I'm using this for showing me the number of attachments:
 
   set index_format=%4C %Z %2M %{%d %b %y} %-28.28a (%4l) %?X?[%X]   ? %s
 
 And it's mainly the part %?X?[%X] ...
 
 Using 'man muttrc' you get the following explanation:
 
   %X number of attachments (please see the “attachments” section for
  possible speed effects)
 
 HTH
 Stefan

Thanks Stefan and David, it is incredible how sometimes I search
anywhere for an answer, but at the end it was simply and RTFM matter.

Anyway, I'm now using this

set index_format = %3e %Z %{%d/%m/%y} %-25.25n %?X?[%X]   ? %s

and it works fine, excepted that the counter does not show
application/octet-stream attachments (in most cases PDF or -- ugly -- .doc or 
.odt) . Reading the online man, I've
added

attachments application/octet-stream

to my muttrc, even if I think it's not necessary, since

attachments +A */.*

is defined by default. However, now with :attachments ? I have:

Current attachments settings:

attachments +A */.*
attachments +A image/jpeg
attachments +A application/octet-stream
attachments -A text/x-vcard
attachments -A application/pgp.*
attachments -A application/x-pkcs7-.*
attachments -A message/external-body
attachments +I text/plain
attachments -I message/external-body

But, Mutt seems to ignore pdf and WYSIWYG editors attachments during
count in index.

What's wrong with me?

-- 
Francesco de Virgilio
*Ubuntu-it team member*
   mailto:frad...@ubuntu-it.org
   http://wiki.ubuntu-it.org/FrancescoDeVirgilio
*Wikimedia projects contributor*
   http://en.wikipedia.org/wiki/User:Fradeve11
*OpenStreetMap Mapper*
   http://www.openstreetmap.org/user/Fradeve11
*Blog*
   http://www.fradeve.org
Love - Peace - Freedom - Free Software


signature.asc
Description: Digital signature


attachment count issue with multipart messages

2010-11-10 Thread Will Fiveash
I've received a message from an iPhone that has a MIME structure as
follows:

1 no description   [multipa/alternativ, 7bit, 48K]
2 ├─no description   [text/plain, 7bit, 0.1K]
3 └─no description   [multipa/related, 7bit, 47K]
4   ├─no description  [text/html, 7bit, 0.5K]
5   └─Photo   [image/jpeg, base64, 46K]

While I have an index_format setup to display the # of attachements
mutt is showing 0.  In .muttrc I have:

set index_format=%4C %Z %{%m/%d/%y} %-15.15F %?M?(#%03M)?([%X]%4c) %s

attachments +A */.*
attachments +A image/jpeg
attachments +A application/octet-stream
attachments -A text/x-vcard
attachments -A application/pgp.*
attachments -A application/(x-)?pkcs7-.*
attachments -A message/external-body
attachments +I application/octet-stream
attachments +I application/pdf
attachments +I image/.*
attachments -I message/external-body

I'm expecting that the Photo (image/jpeg) attachment would cause mutt to
display at least 1 for the attachment count in the Index view.  Does my
.muttrc config need to be modified and if so, how?

-- 
Will Fiveash


Re: attachment count issue with multipart messages

2010-11-10 Thread Michelle Konzack
Hello Will Fiveash,

Am 2010-11-10 14:32:34, hacktest Du folgendes herunter:
 I've received a message from an iPhone that has a MIME structure as
 follows:
 
 1 no description   [multipa/alternativ, 7bit, 48K]
 2 ├─no description   [text/plain, 7bit, 0.1K]
 3 └─no description   [multipa/related, 7bit, 47K]
 4   ├─no description  [text/html, 7bit, 0.5K]
 5   └─Photo   [image/jpeg, base64, 46K]

Sometime back I had to write a script which send such messages and I had
to figured out that it must be:

 1 no description   [multipa/related, 7bit, 47K]
 2 ├─no description [multipa/alternativ, 7bit, 48K]
 3 ├ ├─no description  [text/plain, 7bit, 0.1K]
 4 ├ └─no description   [text/html, 7bit, 0.5K]
 5 └─Photo  [image/jpeg, base64, 46K]

So, the iPhone app is wrong

 I'm expecting that the Photo (image/jpeg) attachment would cause mutt to
 display at least 1 for the attachment count in the Index view.  Does my
 .muttrc config need to be modified and if so, how?

The Photo is NO ATTACHMENT but a part of the multipa/related stuff.

Thanks, Greetings and nice Day/Evening
Michelle Konzack

-- 
# Debian GNU/Linux Consultant ##
   Development of Intranet and Embedded Systems with Debian GNU/Linux

itsyst...@tdnet France EURL   itsyst...@tdnet UG (limited liability)
Owner Michelle KonzackOwner Michelle Konzack

Apt. 917 (homeoffice)
50, rue de Soultz Kinzigstraße 17
67100 Strasbourg/France   77694 Kehl/Germany
Tel: +33-6-61925193 mobil Tel: +49-177-9351947 mobil
Tel: +33-9-52705884 fix

http://www.itsystems.tamay-dogan.net/  http://www.flexray4linux.org/
http://www.debian.tamay-dogan.net/ http://www.can4linux.org/

Jabber linux4miche...@jabber.ccc.de
ICQ#328449886

Linux-User #280138 with the Linux Counter, http://counter.li.org/


signature.pgp
Description: Digital signature


Re: attachment count issue with multipart messages

2010-11-10 Thread David Champion
* On 10 Nov 2010, Will Fiveash wrote: 
 I've received a message from an iPhone that has a MIME structure as
 follows:
 
 1 no description   [multipa/alternativ, 7bit, 48K]

Mutt's attachment counter does not recurse through multipart/alternative
MIME parts.  See parse.c:1556.  I checked the latest version of this
patch that I made before it was mainlined 5 years ago.  While several
things were simplified to get that patch upstream, it has the same logic
for multipart/alternative.  I'm afraid I don't remember for sure why I
made this choice, but it's probably because there's no objective basis
for deciding which alternative in a multipart/alternative should be
analyzed.  Counting attachments among all available alternatives is
almost certainly not what a user wants.

In principle the attachment counter could follow display rules and
choose the preferred alternative based upon alternative_order,
etc.  This crosses an imaginary boundary between describing the
absolute structure of the message and making subjective decisions
about interpretation, but there's nothing logically incorrect about
it.  However there could be unwated computational expense in that
approach.  In 2005 at least there was pretty serious concern about the
computational cost of counting attachments at all, so in order to get
the code upsteam I took all possible steps to minimize that.


 2 ??no description   [text/plain, 7bit, 0.1K]
 3 ??no description   [multipa/related, 7bit, 47K]
 4   ??no description  [text/html, 7bit, 0.5K]
 5   ??Photo   [image/jpeg, base64, 46K]

Note that when iPhone sends a multipart/related message with text and
image parts -- when it sends just the mp/related subtree of the message
you have -- mutt does notice and count the jpeg.  (I tested this by
sending email from the SMS/MMS app on an iPhone.)  So it's certain that
your problem is caused by having a mp/alternative that envelops the
mp/related.


Michelle Konzack wrote that iPhone's appraoch is wrong.  I guess it's
somewhat a matter of interpretation: is the text message a textual
representation of an HTML message that includes one JPEG, or does the
JPEG accompany a message which can be represented as HTML or as text?
It probably depends on how you see the relationship between the image
and the message.  FWIW I tend to agree with Michelle but I can see where
iPhone developers might think otherwise.

Even so though, your problem is a mutt limitation and not inherent
to the MIME structure, which is completely legitimate even if it is
conceptually flawed.

-- 
David Champion  *  d...@uchicago.edu  *  IT Services  *  University of Chicago