summaryrefslogtreecommitdiff
path: root/fml/lib
diff options
context:
space:
mode:
authorfukachan <fukachan>2003-05-13 04:26:46 +0000
committerfukachan <fukachan>2003-05-13 04:26:46 +0000
commit57a55fa9ff12621e054c6367e7112e84eb2089e4 (patch)
tree2dc9c8b688637ddfd33e0c4b9c81d1a5b36baca1 /fml/lib
parente1a3aa8e18d321a8f669f192a1a0faed8e3621df (diff)
downloadfml8-57a55fa9ff12621e054c6367e7112e84eb2089e4.tar.gz
fml8-57a55fa9ff12621e054c6367e7112e84eb2089e4.tar.bz2
fml8-57a55fa9ff12621e054c6367e7112e84eb2089e4.zip
use "reject_notice_preamble" in filter rejection notice.
it describes: o the reason why we do not use mime/multipart. o this message is not from you but somebody forged.
Diffstat (limited to 'fml/lib')
-rw-r--r--fml/lib/FML/Filter.pm13
-rw-r--r--fml/lib/FML/Process/Distribute.pm15
2 files changed, 23 insertions, 5 deletions
diff --git a/fml/lib/FML/Filter.pm b/fml/lib/FML/Filter.pm
index 94ba9a4d..57ef3dd7 100644
--- a/fml/lib/FML/Filter.pm
+++ b/fml/lib/FML/Filter.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: Filter.pm,v 1.26 2003/05/09 13:09:15 tmu Exp $
+# $FML: Filter.pm,v 1.27 2003/05/13 03:49:55 fukachan Exp $
#
package FML::Filter;
@@ -249,6 +249,7 @@ sub article_filter_reject_notice
my $msg = $curproc->incoming_message();
my $r = $msg_args->{ _arg_reason } || 'unknown';
my $type = $config->{article_filter_reject_notice_data_type} || 'string';
+ my $size = 2048;
# recipients
my $list =
@@ -256,6 +257,7 @@ sub article_filter_reject_notice
my $rcpts = $curproc->convert_to_mail_address($list);
$msg_args->{ recipient } = $rcpts;
$msg_args->{ _arg_address } = $cred->sender();
+ $msg_args->{ _arg_size } = $size;
Log("filter notice: [ @$rcpts ]");
@@ -271,7 +273,14 @@ sub article_filter_reject_notice
$curproc->reply_message($msg, $msg_args);
}
elsif ($type eq 'string') {
- my $s = $msg->whole_message_as_str( { indent => ' ' } );
+ my $s = $msg->whole_message_as_str( {
+ indent => ' ',
+ size => $size,
+ });
+ my $r = "The first $size bytes of this message follows:";
+ $curproc->reply_message_nl("error.reject_notice_preamble",
+ $r,
+ $msg_args);
$curproc->reply_message(sprintf("\n\n%s", $s), $msg_args);
}
else {
diff --git a/fml/lib/FML/Process/Distribute.pm b/fml/lib/FML/Process/Distribute.pm
index 060579d2..e41ff67f 100644
--- a/fml/lib/FML/Process/Distribute.pm
+++ b/fml/lib/FML/Process/Distribute.pm
@@ -3,7 +3,7 @@
# Copyright (C) 2000,2001,2002,2003 Ken'ichi Fukamachi
# All rights reserved.
#
-# $FML: Distribute.pm,v 1.113 2003/05/02 07:57:54 fukachan Exp $
+# $FML: Distribute.pm,v 1.114 2003/05/13 03:49:55 fukachan Exp $
#
package FML::Process::Distribute;
@@ -199,9 +199,11 @@ sub run
my $sender = $curproc->{'credential'}->{'sender'};
my $data_type =
$config->{post_restrictions_reject_notice_data_type} || 'string';
- my $msg_args = {
+ my $size = 2048;
+ my $msg_args = {
_arg_address => $sender,
recipient => $sender,
+ size => $size,
};
my $eval = $config->get_hook( 'distribute_run_start_hook' );
@@ -239,7 +241,14 @@ sub run
# send back deny request with the original message.
my $msg = $curproc->incoming_message();
if ($data_type eq 'string') {
- my $s = $msg->whole_message_as_str( { indent => ' ' } );
+ my $s = $msg->whole_message_as_str( {
+ indent => ' ',
+ size => $size,
+ } );
+ my $r = "The first $size bytes of this message follows:";
+ $curproc->reply_message_nl("error.reject_notice_preamble",
+ $r,
+ $msg_args);
$curproc->reply_message(sprintf("\n\n%s", $s), $msg_args);
}
else {