server-gurus / RCimapSync

Roundcube IMAPSYNC Plugin
4 stars 5 forks source link

imapsync.pl can't load config.conf #6

Closed internethering closed 7 years ago

internethering commented 7 years ago

Hi, on my systemd based System following happens with the cron:

imapsync.pl[10348]: Can't locate config.conf in @INC (@INC contains: /etc/perl /usr/local/lib64/perl5/5.22.3/x86_64-linux-thread-multi /usr/local/lib64/perl5/5.22.3 /usr/lib64/perl5/vendor_perl/5.22.3/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.22.3 /usr/local/lib64/perl5 /usr/lib64/perl5/vendor_perl/5.22.2/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.22.2 /usr/lib64/perl5/vendor_perl /usr/lib64/perl5/5.22.3/x86_64-linux-thread-multi /usr/lib64/perl5/5.22.3 .) at /srv/www/v10002/docroot/roundcube/plugins/imapsync/bin/imapsync.pl line 15.

I fixed it by:

use File::Basename;
my $dirname = dirname(__FILE__);
require $dirname."/config.conf" || log_and_die($!);
chr1sn0 commented 7 years ago

Hi @internethering another solution is to cd into the path like:

cd /path/to/roundcube/plugins/imapsync/bin/ && perl imapsync.pl >/dev/null 2>&1

Greetz