summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorAndrey Igoshin <ai@vsu.ru>2018-05-06 19:56:25 +0300
committerAndrey Igoshin <ai@vsu.ru>2018-05-06 19:56:25 +0300
commit2cad90243ce03cd2cda7ea9e123b418553e57131 (patch)
tree60ca00916d31ba7ebbd82dd5620eba62f908f1b6 /utils
parent4ae3fe9af874de5e040762f3070eb74d5b1e7db0 (diff)
downloadrspamd-2cad90243ce03cd2cda7ea9e123b418553e57131.tar.gz
rspamd-2cad90243ce03cd2cda7ea9e123b418553e57131.zip
adding MTA hostname
Diffstat (limited to 'utils')
-rw-r--r--utils/cgp_rspamd.pl15
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,