PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Logiciels d'hébergement > comp.mail.imap > parsing bodystructure
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.mail.imap Discussion of IMAP-based mail systems.

parsing bodystructure

Réponse
 
LinkBack Outils de la discussion
Vieux 30/06/2006, 03h20   #1
redragon@red-dragon.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut parsing bodystructure

I've been working on an email client based on IMAP but I have yet to
see a logical patern in the BODYSTRUCTURE call in IMAP.

If someone could suggest a good way to parse this from a simple to
complex email message it would be greatly appreciated.

I have tried both BODY and BODYSTRUCTURE with no luck on parsing it out
and building a segment table (ie: 1.1.1, 1.1.2, 2.1.1.2, ect)

Carl

  Réponse avec citation
Vieux 30/06/2006, 06h23   #2
Philip Guenther
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: parsing bodystructure

redragon@red-dragon.com wrote:
> I've been working on an email client based on IMAP but I have yet to
> see a logical patern in the BODYSTRUCTURE call in IMAP.


Oh god, not another "IMAP client author" who doesn't immediately refer
to the RFC, as found at
http://www.ietf.org/rfc/rfc3501.txt

If you actually _have_ read the RFC and have specific questions about
what it says, go ahead and ask them here or on the imap-protocol
mailing list.


That said, first, there is no such thing as a 'call' in IMAP.
BODYSTRUCTURE data is returned as an item in untagged FETCH responses.
Using proper terminology will ease communication with other IMAP
developers.

Next, if you want to understand BODYSTRUCTURE, you need to read RFC
3501 carefully. And then read it again. And then stare at the
responses generated by known correct servers, followed by staring at
the ceiling to ponder.

The critically relevant sections of RFC 3501 are section 7.4.2 ("FETCH
response") and section 9 ("Formal Syntax"). The former explains the
fields and the nesting of the structures, while the latter explains the
niggly details of where parens and spaces go.

The code in UW-IMAP's c-client may also be useful by providing an
example of how a C program might choose to represent the parsed data.


> If someone could suggest a good way to parse this from a simple to
> complex email message it would be greatly appreciated.


To parse it: generate a parser from the ABNF grammar in RFC 3501,
section 9.


> I have tried both BODY and BODYSTRUCTURE with no luck on parsing it out
> and building a segment table (ie: 1.1.1, 1.1.2, 2.1.1.2, ect)


Actually, my recall is that the nesting of the 'body' grammar
non-terminal exactly matches the nesting of section data numbers.
I.e., if the top level 'body' has three immediately nest 'body' pieces,
then 1, 2, and 3 are the valid top level section specifiers. Recurse
from there...


Philip Guenther

  Réponse avec citation
Vieux 01/07/2006, 00h16   #3
Oliver Block
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: parsing bodystructure

Hello,

redragon@red-dragon.com wrote:
> If someone could suggest a good way to parse this from a simple to
> complex email message it would be greatly appreciated.
>
> I have tried both BODY and BODYSTRUCTURE with no luck on parsing it out
> and building a segment table (ie: 1.1.1, 1.1.2, 2.1.1.2, ect)


I guess, I didn't understand your question yet. First of all: If you are
working on an email client using IMAP you should consult RFC 3501.

I you want me to understand your point, you should write about what you
really want to do. (e.g. Which language do you use? ...)

Best Regards,

Oliver

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 13h27.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,11931 seconds with 11 queries