summaryrefslogtreecommitdiff
path: root/fml/lib/FML/Header.pm
diff options
context:
space:
mode:
authorfukachan <fukachan>2004-06-09 14:57:26 +0000
committerfukachan <fukachan>2004-06-09 14:57:26 +0000
commitc90cb60f082d08eb99f9c2d6f2d376d11890e364 (patch)
treee94368af7f1949d5d709fa64849beb8c55e901e4 /fml/lib/FML/Header.pm
parent144ad8827a022f951210eae5b8d2984450c64335 (diff)
downloadfml8-c90cb60f082d08eb99f9c2d6f2d376d11890e364.tar.gz
fml8-c90cb60f082d08eb99f9c2d6f2d376d11890e364.tar.bz2
fml8-c90cb60f082d08eb99f9c2d6f2d376d11890e364.zip
separate message-id duplication check and cache updating.
cache updating when process ends.
Diffstat (limited to 'fml/lib/FML/Header.pm')
-rw-r--r--fml/lib/FML/Header.pm50
1 files changed, 37 insertions, 13 deletions
diff --git a/fml/lib/FML/Header.pm b/fml/lib/FML/Header.pm
index 8e81a813..2a39d723 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.74 2004/03/12 11:45:47 fukachan Exp $
+# $FML: Header.pm,v 1.75 2004/05/01 14:29:41 fukachan Exp $
#
package FML::Header;
@@ -633,16 +633,6 @@ check whether message-id is unique or not. If the message-id is found
in the past message-id cache, the injected message must causes a mail
loop.
-=head2 check_x_ml_info($config, $rw_args)
-
-The injected message loops if x-ml-info: has our own
-C<article_post_address> address.
-
-=head2 check_list_post($config, $rw_args)
-
-The injected message loops if list-post: has our own
-C<article_post_address> address.
-
=cut
@@ -668,16 +658,50 @@ sub check_message_id
# we can tind the $mid in the past message-id cache ?
$dup = $db->{ $mid };
Log( "message-id duplicated" ) if $dup;
+ }
+ }
+
+ return $dup;
+}
+
+
+# Descriptions: store message-id into the cache.
+# Arguments: OBJ($header) OBJ($config) HASH_REF($rw_args)
+# Side Effects: update cache
+# Return Value: STR or 0
+sub update_message_id_cache
+{
+ my ($header, $config, $rw_args) = @_;
+ my $dir = $config->{ 'message_id_cache_dir' };
+ my $mid = $header->get('message-id');
+
+ $mid = $header->address_clean_up($mid);
+ if ($mid) {
+ use FML::Header::MessageID;
+ my $xargs = { directory => $dir };
+ my $db = FML::Header::MessageID->new->db_open($xargs);
+ if (defined $db) {
# save the current id
$db->{ $mid } = 1;
}
}
-
- return $dup;
}
+=head2 check_x_ml_info($config, $rw_args)
+
+The injected message loops if x-ml-info: has our own
+C<article_post_address> address.
+
+=head2 check_list_post($config, $rw_args)
+
+The injected message loops if list-post: has our own
+C<article_post_address> address.
+
+=cut
+
+
# Descriptions: check X-ML-Info: duplication against mail loop.
# Arguments: OBJ($header) OBJ($config) HASH_REF($rw_args)
# Side Effects: none