
Hi, A more specific question now... I can't get PostMasterMailbox.pl to retrieve mail from the cron job. If I run the script manually, it works fine. If I click on "Run Now" in the PostMaster Mail Account page, it also works. But, when run from the cronjob, nothing is retrieved. I can see the cronjob is running: Jul 14 00:53:01 rax crond[29489]: (otrs) CMD ($HOME/bin/PostMasterMailbox.pl >> /dev/null) Jul 14 00:54:01 rax crond[29500]: (otrs) CMD ($HOME/bin/PostMasterMailbox.pl >> /dev/null) But, it doesn't seem to do anything. Any ideas? R.

Den 14/07/2008 kl. 09.54 skrev Robin Bowes:
I can see the cronjob is running:
Jul 14 00:53:01 rax crond[29489]: (otrs) CMD ($HOME/bin/PostMasterMailbox.pl >> /dev/null) Jul 14 00:54:01 rax crond[29500]: (otrs) CMD ($HOME/bin/PostMasterMailbox.pl >> /dev/null)
But, it doesn't seem to do anything.
Af few things to look into: 1: Execute the job manually as the OTRS user, not root. 2: Is $HOME pointing to the right place? 3: Try and remove the ">> /dev/null" to get the output from the cron job. -- Lars

Lars Jørgensen wrote:
Den 14/07/2008 kl. 09.54 skrev Robin Bowes:
I can see the cronjob is running:
Jul 14 00:53:01 rax crond[29489]: (otrs) CMD ($HOME/bin/PostMasterMailbox.pl >> /dev/null) Jul 14 00:54:01 rax crond[29500]: (otrs) CMD ($HOME/bin/PostMasterMailbox.pl >> /dev/null)
But, it doesn't seem to do anything.
Af few things to look into:
1: Execute the job manually as the OTRS user, not root.
Ah, that got it. It's a permissions issue. When I ran it as the otrs user I got this error: -bash-3.1$ bin/PostMasterMailbox.pl Can't locate Kernel/Config.pm in @INC (@INC contains: /var/www/otrs/Kernel/cpan-lib /var/www/otrs /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.6/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at bin/PostMasterMailbox.pl line 36. BEGIN failed--compilation aborted at bin/PostMasterMailbox.pl line 36. On checking, /var/www/otrs/Kernel/Config.pm was owned by apache:root and chmod 640 so the otrs user couldn't read it. Changing Config.pm to 644 caused the cron to work, but that's not secure (don't want Config.pm to be world-readable). It needs to be owned by apache so the web interface can change settings. I wonder if apache group ownership will be enough, i.e. chown otrs:apache Confg.pm ? R.

Den 14/07/2008 kl. 19.39 skrev Robin Bowes:
Changing Config.pm to 644 caused the cron to work, but that's not secure (don't want Config.pm to be world-readable).
Just checked and my Config.pm is 664. You should run bin/SetPermissions.sh to make sure your files have the right permissions. If you're anxious about having a world-readable Config.pm maybe you should think about building a separate machine for OTRS that only a few select people have access to. -- Lars

Lars Jørgensen wrote:
Den 14/07/2008 kl. 19.39 skrev Robin Bowes:
Changing Config.pm to 644 caused the cron to work, but that's not secure (don't want Config.pm to be world-readable).
Just checked and my Config.pm is 664.
You should run bin/SetPermissions.sh to make sure your files have the right permissions.
If you're anxious about having a world-readable Config.pm maybe you should think about building a separate machine for OTRS that only a few select people have access to.
I'm not particularly "anxious" but it's not good practise to have a config file containing security information world-readable. It seems to work when chowned to otrs:apache and chmod 640. R.
participants (2)
-
Lars Jørgensen
-
Robin Bowes