Skip to Content.
Sympa Menu

devel - Re: [sympa-dev] filtering out headers

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: Fil <address@concealed>
  • To: address@concealed
  • Subject: Re: [sympa-dev] filtering out headers
  • Date: Thu, 14 Dec 2000 13:29:16 +0100

> > remove_headers X-Header: X-Head: X-Face: Delivered-To:
>
> I think it's a good idea to make this behaviour customizeable.
> Default for this would be :
> remove_headers
> Return-Receipt-To,Precedence,X-Sequence,Disposition-Notification-To
>
> which is sympa's current behaviour

Here you are !
(of course you can remove the 'do_log' commands)

patches for src/Conf.pm and src/List.pm


atlas:~/sympa/sympa-3.0b.4# diff -up src/Conf.pm-3.0b4 src/Conf.pm
--- src/Conf.pm-3.0b4 Thu Dec 14 12:26:46 2000
+++ src/Conf.pm Thu Dec 14 13:20:05 2000
@@ -22,7 +22,7 @@ my @valid_options = qw(
loop_command_max loop_command_sampling_delay
loop_command_decrease_factor
remind_return_path request_priority
rfc2369_header_fields sendmail sleep
sort sympa_priority syslog umask welcome_return_path
wwsympa_url
- openssl trusted_ca_options key_passwd
+ openssl trusted_ca_options key_passwd remove_headers
);
my %valid_options = ();
map { $valid_options{$_}++; } @valid_options;
@@ -82,7 +82,8 @@ my %Default_Conf =
'loop_command_max' => 200,
'loop_command_sampling_delay' => 3600,
'loop_command_decrease_factor' => 0.5,
- 'rfc2369_header_fields' =>
'help,subscribe,unsubscribe,post,owner,archive'
+ 'rfc2369_header_fields' =>
'help,subscribe,unsubscribe,post,owner,archive',
+ 'remove_headers' =>
'Return-Receipt-To,Precedence,X-Sequence,Disposition-Notification-To'
);

%Conf = ();
@@ -176,6 +177,12 @@ sub load {
delete $Conf{'rfc2369_header_fields'};
}else {
$Conf{'rfc2369_header_fields'} = [split(/,/,
$Conf{'rfc2369_header_fields'})];
+ }
+
+ if ($Conf{'remove_headers'} eq 'none') {
+ delete $Conf{'remove_headers'};
+ }else {
+ $Conf{'remove_headers'} = [split(/,/, $Conf{'remove_headers'})];
}

@{$Conf{'listmasters'}} = split(/,/, $Conf{'listmaster'});


atlas:~/sympa/sympa-3.0b.4# diff -up src/List.pm-3.0b4 src/List.pm
--- src/List.pm-3.0b4 Thu Dec 14 12:15:02 2000
+++ src/List.pm Thu Dec 14 13:16:25 2000
@@ -1312,13 +1312,17 @@ sub distribute_msg {
}

## Remove unwanted headers if present.
- $hdr->delete('Return-Receipt-To');
- $hdr->delete('Precedence');
- $hdr->delete('X-Sequence');
- $hdr->delete('Disposition-Notification-To');
- $hdr->add('X-Loop', "$name\@$host");
-
+ &do_log('notice','remove_headers... '.$Conf{'remove_headers'});
+ if ($Conf{'remove_headers'}) {
+ foreach my $field (@{$Conf{'remove_headers'}}) {
+ &do_log('notice','remove_header '.$field);
+ $hdr->delete($field);
+ }
+ }
+ &do_log('notice','remove_headers done');
+
## Add useful headers
+ $hdr->add('X-Loop', "$name\@$host");
$hdr->add('X-Sequence', $sequence);
$hdr->add('Precedence', 'list');
foreach my $i (@{$self->{'admin'}{'custom_header'}}) {





Archive powered by MHonArc 2.6.19+.

Top of Page