summaryrefslogtreecommitdiff
path: root/fml/lib/FML/Header.pm
diff options
context:
space:
mode:
authortmu <tmu>2003-09-19 13:30:33 +0000
committertmu <tmu>2003-09-19 13:30:33 +0000
commit61e9a95250f42f845fa1f501f9f7a82f3f9273e3 (patch)
tree276367b3951654097307359e47743e748570716f /fml/lib/FML/Header.pm
parentd844753a0fe3cc2925d015bb8d9398b6021ec18e (diff)
downloadfml8-61e9a95250f42f845fa1f501f9f7a82f3f9273e3.tar.gz
fml8-61e9a95250f42f845fa1f501f9f7a82f3f9273e3.tar.bz2
fml8-61e9a95250f42f845fa1f501f9f7a82f3f9273e3.zip
new Header->add_message_id()
change Header::MessageID->gen_id() Args change in Process::Kernel->_add_info_on_header() add add_message_id()
Diffstat (limited to 'fml/lib/FML/Header.pm')
-rw-r--r--fml/lib/FML/Header.pm27
1 files changed, 26 insertions, 1 deletions
diff --git a/fml/lib/FML/Header.pm b/fml/lib/FML/Header.pm
index 18651f9d..884c0475 100644
--- a/fml/lib/FML/Header.pm
+++ b/fml/lib/FML/Header.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: Header.pm,v 1.62 2003/08/23 04:35:27 fukachan Exp $
+# $FML: Header.pm,v 1.63 2003/08/23 14:37:58 fukachan Exp $
#
package FML::Header;
@@ -264,6 +264,10 @@ when $args->{type} is 'MIME::Lite'.
add X-Sequence.
+=head2 add_message_id($config, $args)
+
+add Message-Id.
+
=cut
@@ -339,6 +343,27 @@ sub add_rfc2369
}
}
+# Descriptions: add "Message-ID if not define
+# Arguments: OBJ($header) OBJ($config) HASH_REF($args)
+# Side Effects: update $header
+# Return Value: none
+sub add_message_id
+{
+ my ($header, $config, $args) = @_;
+ my $object_type = defined $args->{ type } ? $args->{ type } : '';
+
+ use FML::Header::MessageID;
+ my $mid = FML::Header::MessageID->new->gen_id($config,$args);
+
+ if ($object_type eq 'MIME::Lite') {
+ my $msg = $args->{ message };
+ $msg->attr('Message-Id' => $mid);
+ }
+ else {
+ $header->add('Message-Id', $mid);
+ }
+}
+
# Descriptions: add "X-Sequence: elena NUM" to header
# Arguments: OBJ($header) OBJ($config) HASH_REF($args)