PolicydWeight Recipient Whitelist

  • Dear all,

    im migrating my i-mscp installation to a new server. There i have to setup a recipient whitelist within the policyd_weight plugin. On my old Installation (1.2.x) i used a Listener file to do so.

    Here the File:

    1. # i-MSCP - internet Multi Server Control Panel# Copyright (C) 2013-2016 by Sascha Bay## This program is free software; you can redistribute it and/or# modify it under the terms of the GNU General Public License# as published by the Free Software Foundation; either version 2# of the License, or (at your option) any later version.## This program is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU General Public License for more details.## You should have received a copy of the GNU General Public License# along with this program; if not, write to the Free Software# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA .### Allows to setup policyd-weight whilelist maps.#package Listener::Postfix::Policyd::Whitelist;use strict;use warnings;use iMSCP::Debug;use iMSCP::EventManager;use iMSCP::Execute;### Configuration variables#my $policydWeightClientWhitelist = '/etc/postfix/imscp/policyd_weight_client_whi telist';my $policydWeightRecipientWhitelist = '/etc/postfix/imscp/policyd_weight_recipie nt_whitelist';my $checkClientAccess = "\n check_client_access hash:/etc/postfix/imscp/policyd_ weight_client_whitelist,";my $checkRecipientAccess = "\n check_recipient_access hash:/etc/postfix/imscp/po licyd_weight_recipient_whitelist,";### Please, don't edit anything below this line#iMSCP::EventManager->getInstance()->register('afterMtaBuildMainCfFile', sub { my $tplContent = shift; return 0 unless -f $policydWeightClientWhitelist && -f $policydWeightRec ipientWhitelist; my ($stdout, $stderr); my $rs = execute("postmap $policydWeightClientWhitelist", \$stdout, \$st derr); debug($stdout) if $stdout; error($stderr) if $stderr && $rs; return $rs if $rs; $rs = execute("postmap $policydWeightRecipientWhitelist", \$stdout, \$st derr); debug($stdout) if $stdout; error($stderr) if $stderr && $rs; return $rs if $rs; if ($$tplContent !~ /check_client_access/m) { $$tplContent =~ s/(reject_non_fqdn_recipient,)/$1$checkClientAcc ess/; } if ($$tplContent !~ /check_recipient_access/m) { $$tplContent =~ s/(reject_non_fqdn_recipient,)/$1$checkRecipient Access/; } 0;});1;__END__

    When using this in current 1.5.1 version, imscp-reconfigure ist aborted

    1. root@s: /etc/postfix/imscp: /var/www/imscp/engine/setup/imscp-reconfigure -d [FATAL] iMSCP::EventManager::_init: Can't locate iMSCP/EventMaanger.pm in @INC (you may need to install the iMSCP::EventMaanger module) (@INC contains: /var/www/imscp/engine/setup/../PerlLib /var/www/imscp/engine/setup/../PerlVendor /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.24.1 /usr/local/share/perl/5.24.1 /usr/lib/x86_64-linux-gnu/perl5/5.24 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.24 /usr/share/perl/5.24 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at /etc/imscp/listeners.d/20_postfix_policyd_whitelist.pl line 27.
    2. BEGIN failed--compilation aborted at /etc/imscp/listeners.d/20_postfix_policyd_whitelist.pl line 27.
    3. Compilation failed in require at /var/www/imscp/engine/setup/../PerlLib/iMSCP/EventManager.pm line 266.

    I'm not a perl-programmer, so it's difficult to understand the problem. So my question is: How can i configure a whitelist with current version and make this changings persistent?

    Requested information to my installation:
    Debian Stretch, i-mscp 1.5.1, PHP-FPM, Plugin PolicydWeight Version 1.3.0 (Build 2018032000)

    Best regards