diff options
| author | fukachan <fukachan> | 2001-01-21 14:22:38 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2001-01-21 14:22:38 +0000 |
| commit | 7c8b24957dcdb3e0470f224326930c1ecb5866a2 (patch) | |
| tree | 4d91254892d2b81f5788b117db3836e0f9622329 | |
| parent | 3a42673e95a8ad8f1713ab81103ac001db20e9fb (diff) | |
| download | fml8-7c8b24957dcdb3e0470f224326930c1ecb5866a2.tar.gz fml8-7c8b24957dcdb3e0470f224326930c1ecb5866a2.tar.bz2 fml8-7c8b24957dcdb3e0470f224326930c1ecb5866a2.zip | |
enable add_fml_article_id add_x_sequence
| -rw-r--r-- | fml/etc/default_config.cf.ja | 2 | ||||
| -rw-r--r-- | fml/etc/defaults/header.cf.ja | 2 | ||||
| -rw-r--r-- | fml/lib/FML/Header.pm | 18 | ||||
| -rw-r--r-- | fml/lib/FML/Process/Distribute.pm | 25 | ||||
| -rw-r--r-- | regress/Makefile | 3 |
5 files changed, 45 insertions, 5 deletions
diff --git a/fml/etc/default_config.cf.ja b/fml/etc/default_config.cf.ja index 3c39f9fe..c8fd3fa0 100644 --- a/fml/etc/default_config.cf.ja +++ b/fml/etc/default_config.cf.ja @@ -44,6 +44,8 @@ header_checks = validate_message_id verify_unique_list_post header_rewrite_rules = add_rfc2369 + add_fml_article_id + add_x_sequence =head2 ¥í¥Ã¥¯ lock_dir = $ml_home_dir/var/lock diff --git a/fml/etc/defaults/header.cf.ja b/fml/etc/defaults/header.cf.ja index a4444c90..b5479944 100644 --- a/fml/etc/defaults/header.cf.ja +++ b/fml/etc/defaults/header.cf.ja @@ -7,3 +7,5 @@ header_checks = validate_message_id verify_unique_list_post header_rewrite_rules = add_rfc2369 + add_fml_article_id + add_x_sequence diff --git a/fml/lib/FML/Header.pm b/fml/lib/FML/Header.pm index 529df81a..fbd99859 100644 --- a/fml/lib/FML/Header.pm +++ b/fml/lib/FML/Header.pm @@ -88,7 +88,15 @@ sub check } -sub _add_rfc2369_to_header +sub add_fml_article_id +{ + my ($header, $config, $args) = @_; + + $header->add('X-Mail-Count', $args->{ id }); +} + + +sub add_rfc2369 { my ($header, $config, $args) = @_; @@ -103,4 +111,12 @@ sub _add_rfc2369_to_header } +sub add_x_sequence +{ + my ($header, $config, $args) = @_; + + $header->add('x-sequence', "$args->{ name } $args->{ id }"); +} + + 1; diff --git a/fml/lib/FML/Process/Distribute.pm b/fml/lib/FML/Process/Distribute.pm index 767b1a33..e6f3fc9a 100644 --- a/fml/lib/FML/Process/Distribute.pm +++ b/fml/lib/FML/Process/Distribute.pm @@ -79,12 +79,14 @@ sub _distribute # XXX $curproc->{ article } is prepared as a side effect. my $ah = $curproc->_prepare_article($args); + # get sequence number + my $id = $ah->increment_id; + # header operations # XXX we need $curproc->{ article }, which is prepared above. - $curproc->_header_rewrite($args); + $curproc->_header_rewrite({ id => $id }); # spool in the article before delivery - my $id = $ah->increment_id; $ah->spool_in($id); # delivery starts ! @@ -111,12 +113,27 @@ sub _header_rewrite my $config = $curproc->{ config }; my $header = $curproc->{ article }->{ header }; my $rules = $curproc->{ config }->{ header_rewrite_rules }; + my $id = $args->{ id }; for my $rule (split(/\s+/, $rules)) { Log("_header_rewrite( $rule )"); + + if ($rule eq 'add_fml_article_id') { + $header->add_fml_article_id($config, { id => $id } ); + } + + if ($rule eq 'add_x_sequence') { + $header->add_x_sequence($config, { + name => $config->{ address_for_post }, + id => $id, + }); + } + if ($rule eq 'add_rfc2369') { - $header->_add_rfc2369_to_header($config, - { mode => 'distribute' }); + $header->add_rfc2369($config, { + id => $id, + mode => 'distribute', + }); } } } diff --git a/regress/Makefile b/regress/Makefile index 15ad7212..bda270f5 100644 --- a/regress/Makefile +++ b/regress/Makefile @@ -13,3 +13,6 @@ link: rm -f lib; ln -s ../fml/lib rm -f libexec; ln -s ../fml/libexec rm -f log; ln -s /var/spool/ml/elena/log + +diff: + @ (cd ..;cvs diff -ub) |
