diff options
Diffstat (limited to 'utils')
-rw-r--r-- | utils/cgp_rspamd.pl | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/utils/cgp_rspamd.pl b/utils/cgp_rspamd.pl index 5a4bd109a..b1d30b905 100644 --- a/utils/cgp_rspamd.pl +++ b/utils/cgp_rspamd.pl @@ -33,11 +33,22 @@ GetOptions( pod2usage(1) if $help; pod2usage( -exitval => 0, -verbose => 2 ) if $man; +my $main_domain = cgp_main_domain(); my $scanned = 0; # Turn off bufferization as required by CGP $| = 1; +sub cgp_main_domain { + if ( open(my $fh, 'Settings/Main.settings') ) { + while (<$fh>) { + if ( /^\s+DomainName\s+=\s+([^;]+);/ ) { + return $1; + } + } + } +} + sub cgp_string { my ($in) = @_; @@ -232,10 +243,12 @@ sub rspamd_scan { if ($ip) { $headers->{IP} = $ip; } - if ($user) { $headers->{User} = $user; } + if ($main_domain) { + $headers->{'MTA-Tag'} = $main_domain; + } http_post( "http://$rspamd_host/checkv2", $data, |