Subject: | Outlook X.400 address |
Microsoft Outlook tends to prefer X.400 addresses before Internet email
addresses. In some cases, this results to email address headers using
the distinguished name like
From: Willi Wacker </O=HQ/OU=ADMIN GROUP/CN=RECIPIENTS/CN=WWACKER>
rather than something like
From: Willi Wacker <willi@wacker.org>
Nevertheless, Outlook seems to bury the email address in the MSG file
under the OLE tags 0E28' and 0E29'. Applying the patch attached as
Message-x400-patch.diff, the Internet email address can be found under
one of the hash entries X400DN1 X400DN2.
More general, ugly extensions like the X.400 patch above cannot be made
easily without modifying the module source. This is so because all the
the parser tables are lexical scope variables (allocated with the
keyword "my").
Applying the patch attached as Message-our-patch.diff patch, the X.400
and similar modifications would simply be introduced as
$Email::Outlook::Message::MAP_SUBITEM_FILE {'0E28'} = "X400DN1";
$Email::Outlook::Message::MAP_SUBITEM_FILE {'0E29'} = "X400DN2";
rather than overwriting methods (as I do at the moment) copying and
modifying large parts of the module code (the _process_root_dir ()
method in the X.400 case).
Jordan
Subject: | Message-x400-patch.diff |
--- /usr/share/perl5/Email/Outlook/old/Message.bak 2009-11-24 11:17:09.000000000 +0000
+++ /usr/share/perl5/Email/Outlook/Message.pm 2009-11-24 11:28:48.000000000 +0000
@@ -200,6 +200,20 @@
'1035' => "MESSAGEID", # Message-Id
'1039' => "REFERENCES", # References: Header
'1042' => "INREPLYTO", # In reply to Message-Id
+
+ # An X400 address is coded as an array of ascii strings separated by
+ # SOH (^A), it may be parsed like
+ # ($num_items, @fields) = split /\cA/, X400_ADDRESS
+ # where
+ # $num_items should be scalar
+ # and
+ # @fields may look like (distinguised-name-fragment, email-address).
+ #
+ # It is guessed that
+ # email-address is always @fields [$#fields].
+ #
+ '0E28' => "X400DN1", # group address distinguished name
+ '0E29' => "X400DN2", # alternate group address distinguished name
};
my $MAP_ADDRESSITEM_FILE = {
Subject: | Message-our-patch.diff |
--- /usr/share/perl5/Email/Outlook/old/Message.pm 2009-11-24 11:17:09.000000000 +0000
+++ /usr/share/perl5/Email/Outlook/Message.pm 2009-11-24 11:23:26.000000000 +0000
@@ -74,7 +74,7 @@
#
# Descriptions partially based on mapitags.h
#
-my $skipproperties = {
+our $skipproperties = {
# Envelope properties
'000B' => "Conversation key?",
'001A' => "Type of message",
@@ -158,14 +158,14 @@
my $ENCODING_BINARY = '0102';
my $ENCODING_DIRECTORY = '000D';
-my $KNOWN_ENCODINGS = {
+our $KNOWN_ENCODINGS = {
'000D' => 'Directory',
'001F' => 'Unicode',
'001E' => 'Ascii?',
'0102' => 'Binary',
};
-my $MAP_ATTACHMENT_FILE = {
+our $MAP_ATTACHMENT_FILE = {
'3701' => "DATA", # Data
'3704' => "SHORTNAME", # Short file name
'3707' => "LONGNAME", # Long file name
@@ -174,7 +174,7 @@
'3716' => "DISPOSITION", # disposition
};
-my $skipheaders = {
+our $skipheaders = {
map { uc($_) => 1 }
"MIME-Version",
"Content-Type",
@@ -185,7 +185,7 @@
"X-MS-Has-Attach"
};
-my $MAP_SUBITEM_FILE = {
+our $MAP_SUBITEM_FILE = {
'1000' => "BODY_PLAIN", # Body
'1009' => "BODY_RTF", # Compressed-RTF version of body
'1013' => "BODY_HTML", # HTML Version of body
@@ -202,7 +202,7 @@
'1042' => "INREPLYTO", # In reply to Message-Id
};
-my $MAP_ADDRESSITEM_FILE = {
+our $MAP_ADDRESSITEM_FILE = {
'3001' => "NAME", # Real name
'3002' => "TYPE", # Address type
'403D' => "TYPE", # Address type
@@ -211,7 +211,7 @@
'39FE' => "SMTPADDRESS", # SMTP Address variant
};
-my $MAP_PROPSTREAM_TAG = {
+our $MAP_PROPSTREAM_TAG = {
0x3007 => 'DATE2ND', # Outlook created??
0x0039 => 'DATE1ST', # Outlook sent date
# 0x0E06 => 'DATE2ND', # more dates, not needed here