From: Andrey Igoshin Date: Sun, 6 May 2018 16:56:25 +0000 (+0300) Subject: adding MTA hostname X-Git-Tag: 1.7.5~63^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2cad90243ce03cd2cda7ea9e123b418553e57131;p=rspamd.git adding MTA hostname --- 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,