mirror of
https://github.com/darold/sendmailanalyzer.git
synced 2026-05-15 22:02:32 -06:00
Fix delivery direction when only LOCAL_DOMAIN was set. Thanks to enekux for the report.
This commit is contained in:
parent
76cda01d9f
commit
88d501ed24
2 changed files with 14 additions and 0 deletions
|
|
@ -1882,6 +1882,13 @@ sub set_direction
|
|||
} elsif ($CONFIG{MAIL_GW} && $CONFIG{MAIL_HUB}) {
|
||||
# If sender relay is the gateway, it comes from outside
|
||||
$direction = 'Ext_' if (grep($STATS{$id}{sender_relay} =~ /$_/i, split(/[\s\t,;]/, $CONFIG{MAIL_GW})));
|
||||
} else {
|
||||
# if message doesn't come from localhost or user defined loca relay it comes from outside
|
||||
if (exists $CONFIG{LOCAL_HOST_DOMAIN}{$hostname} && ($#{$CONFIG{LOCAL_HOST_DOMAIN}{$hostname}} > -1) ) {
|
||||
$direction = 'Ext_' if (!grep($STATS{$id}{sender_relay} =~ /\b$_$/, 'localhost', @{$CONFIG{LOCAL_HOST_DOMAIN}{$hostname}}));
|
||||
} elsif (exists $CONFIG{LOCAL_DOMAIN} && ($#{$CONFIG{LOCAL_DOMAIN}} > -1)) {
|
||||
$direction = 'Ext_' if (!grep($STATS{$id}{sender_relay} =~ /\b$_$/, 'localhost', @{$CONFIG{LOCAL_DOMAIN}}));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$direction = 'Unk_';
|
||||
|
|
|
|||
7
sa_cache
7
sa_cache
|
|
@ -4158,6 +4158,13 @@ sub set_direction
|
|||
} elsif ($CONFIG{MAIL_GW} && $CONFIG{MAIL_HUB}) {
|
||||
# If sender relay is the gateway, it comes from outside
|
||||
$direction = 'Ext_' if (grep($STATS->{$id}{sender_relay} =~ /$_/i, split(/[\s\t,;]/, $CONFIG{MAIL_GW})));
|
||||
} else {
|
||||
# if message doesn't come from localhost or user defined loca relay it comes from outside
|
||||
if (exists $CONFIG{LOCAL_HOST_DOMAIN}{$hostname} && ($#{$CONFIG{LOCAL_HOST_DOMAIN}{$hostname}} > -1) ) {
|
||||
$direction = 'Ext_' if (!grep($STATS->{$id}{sender_relay} =~ /\b$_$/, 'localhost', @{$CONFIG{LOCAL_HOST_DOMAIN}{$hostname}}));
|
||||
} elsif (exists $CONFIG{LOCAL_DOMAIN} && ($#{$CONFIG{LOCAL_DOMAIN}} > -1)) {
|
||||
$direction = 'Ext_' if (!grep($STATS->{$id}{sender_relay} =~ /\b$_$/, 'localhost', @{$CONFIG{LOCAL_DOMAIN}}));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$direction = 'Unk_';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue