This concept converts the RFC822 email string to XML.
Every field will have a RFC822 namespace and the field name,the
RFC822 standard fields will have a standard field name,
any field starting with "x-" will be put in one of the extension-field element and
any other element will be put in the user-defined-element.
The part element will holds the mail content headers and the BodyPart element,
where will be placed the content body.
This example will show how you can create an EMX concept,
and print the result to XML string.
#the $s variable holds a normal RFC822 email string
$mail = Emx.create( $s )
#the $mail is now a mail concept with elements and attributes
#it is prints the mail in XML
print $mail.toXML
#if you want to print your original mail (the source)
print $mail.toTXT
Methods inherited from: Concept
cloneConcept, extendsConcept, fromXML, getAllInheritedConcepts, getConceptAttribute, getConceptAttributeField, getConceptAttributeFields, getConceptAttributes, getConceptConstructors, getConceptElement, getConceptElementField, getConceptElementFields, getConceptElements, getConceptLabel, getConceptMethod, getConceptMethods, getConceptOperators, getConceptType, getErrorHandler, getInheritedConcepts, getResourceURI, hasConceptAttribute, hasConceptElement, hasConceptMethod, hasPath, isHidden, loadContent, setConceptLabel, setErrorHandler, setHidden, setShowEmpty, showEmpty, toTXT, toXML, setResourceURI |
|
Label: | emx:content |
Type: | String |
Is Static: | false |
Is Hidden: | false |
Show Empty: | false |
Mail content attribute, can placed here an URL which will points to your mail content
Label: | xml:lang |
Type: | String |
Is Static: | false |
Is Hidden: | false |
Show Empty: | false |
Mail language
Label: | xmlns:emx |
Type: | Nil |
Is Static: | false |
Is Hidden: | false |
Show Empty: | false |
XML namespace for this concept
Label: | xmlns:rfc822 |
Type: | Nil |
Is Static: | false |
Is Hidden: | false |
Show Empty: | false |
XML namespace for RFC822
Label: | msg |
Type: | String |
Is Static: | false |
Is Hidden: | true |
Is Multi: | false |
Show Empty: | true |
Hidden element to holds the message content
Label: | header |
Type: | Map |
Is Static: | false |
Is Hidden: | true |
Is Multi: | false |
Show Empty: | true |
Hidden element to holds the message header
Label: | msgSource |
Type: | String |
Is Static: | false |
Is Hidden: | true |
Is Multi: | false |
Show Empty: | true |
Hidden element to holds the message source
Label: | rfc822:return-path |
Type: | Element |
Is Static: | false |
Is Hidden: | false |
Is Multi: | false |
Show Empty: | false |
Redturn-Path:
Label: | rfc822:from |
Type: | Element |
Is Static: | false |
Is Hidden: | false |
Is Multi: | false |
Show Empty: | false |
From:
Label: | rfc822:sender |
Type: | Element |
Is Static: | false |
Is Hidden: | false |
Is Multi: | false |
Show Empty: | false |
Sender:
Label: | rfc822:resent-from |
Type: | Element |
Is Static: | false |
Is Hidden: | false |
Is Multi: | false |
Show Empty: | false |
Resent-From:
Label: | rfc822:resent-sender |
Type: | Element |
Is Static: | false |
Is Hidden: | false |
Is Multi: | false |
Show Empty: | false |
Resent-Sender:
Label: | rfc822:to |
Type: | Element |
Is Static: | false |
Is Hidden: | false |
Is Multi: | false |
Show Empty: | false |
To:
Label: | rfc822:cc |
Type: | Element |
Is Static: | false |
Is Hidden: | false |
Is Multi: | false |
Show Empty: | false |
CC:
Label: | rfc822:bcc |
Type: | Element |
Is Static: | false |
Is Hidden: | false |
Is Multi: | false |
Show Empty: | false |
Bcc:
Label: | rfc822:reply-to |
Type: | Element |
Is Static: | false |
Is Hidden: | false |
Is Multi: | false |
Show Empty: | false |
Reply-To:
Label: | rfc822:resent-to |
Type: | Element |
Is Static: | false |
Is Hidden: | false |
Is Multi: | false |
Show Empty: | false |
Resent-to:
Label: | rfc822:resent-cc |
Type: | Element |
Is Static: | false |
Is Hidden: | false |
Is Multi: | false |
Show Empty: | false |
Resent-Cc:
Label: | rfc822:resent-bcc |
Type: | Element |
Is Static: | false |
Is Hidden: | false |
Is Multi: | false |
Show Empty: | false |
Resent-Bcc:
Label: | rfc822:resent-reply-to |
Type: | Element |
Is Static: | false |
Is Hidden: | false |
Is Multi: | false |
Show Empty: | false |
Resent-Reply-To:
Label: | rfc822:keywords |
Type: | Element |
Is Static: | false |
Is Hidden: | false |
Is Multi: | false |
Show Empty: | false |
Keywords:
Label: | rfc822:subject |
Type: | Element |
Is Static: | false |
Is Hidden: | false |
Is Multi: | false |
Show Empty: | false |
Subject:
Label: | rfc822:comments |
Type: | Element |
Is Static: | false |
Is Hidden: | false |
Is Multi: | false |
Show Empty: | false |
Comments:
Label: | rfc822:received |
Type: | Element |
Is Static: | false |
Is Hidden: | false |
Is Multi: | true |
Show Empty: | true |
Received:
Label: | rfc822:date |
Type: | Element |
Is Static: | false |
Is Hidden: | false |
Is Multi: | false |
Show Empty: | false |
Date:
Label: | rfc822:resent-date |
Type: | Element |
Is Static: | false |
Is Hidden: | false |
Is Multi: | false |
Show Empty: | false |
Resent-Date:
Label: | rfc822:message-id |
Type: | Element |
Is Static: | false |
Is Hidden: | false |
Is Multi: | false |
Show Empty: | false |
Message-Id:
Label: | rfc822:resent-message-id |
Type: | Element |
Is Static: | false |
Is Hidden: | false |
Is Multi: | false |
Show Empty: | false |
Resent-Message-Id:
Label: | rfc822:in-reply-to |
Type: | Element |
Is Static: | false |
Is Hidden: | false |
Is Multi: | false |
Show Empty: | false |
In-Reply-To:
Label: | rfc822:references |
Type: | Element |
Is Static: | false |
Is Hidden: | false |
Is Multi: | false |
Show Empty: | false |
References:
Label: | rfc822:encrypted |
Type: | Element |
Is Static: | false |
Is Hidden: | false |
Is Multi: | false |
Show Empty: | false |
Encrypted:
Label: | rfc:822:extension-field |
Type: | Emx:ext |
Is Static: | false |
Is Hidden: | false |
Is Multi: | true |
Show Empty: | true |
Extension field for all fields starting with "x-"
Label: | rfc:822:user-defined-field |
Type: | Emx:udef |
Is Static: | false |
Is Hidden: | false |
Is Multi: | true |
Show Empty: | true |
Any other unlisted fields
Label: | emx:part |
Type: | Emx:part |
Is Static: | false |
Is Hidden: | false |
Is Multi: | false |
Show Empty: | false |
The message content
Parameters: |
$msg : | The message source string |
|
Creating this concept, and constructs all elements
Recursive function to extract message content from boundary nodes and
put it into the part element.
Extracts adress(es) from field value
Extracts the extended-fields
Extracts user group from a named field
Extracts the received fields
Extracts the user defined fields
Extracts a simple value from a named field
Extracts a complete adress from a named field
Prepare the messager header, extracts the field name and value pairs
Parameters: |
$s : | Message content bound |
|
Extract a named bouds from a multipart message
Returns the original mail source as string