Hi,
I have been having some fun and games with pop mail collection or lack of it on a couple of 5.1.2 SP3 servers and I wondered if someone could enlighten me a little.
I know that this is a subject that has been covered a lot before and I have read vast amounts of posts. However there is something bugging me that I can't figure out and haven't found an answer for.
In office hours are set to 15 mins and out of hours to 2 hours, weekends at not all. Seems like anytime I am outside office hours, email-ipup returns returns without triggering fetch mail. As I am no perl programmer, I put some simple flags in the file to see where it returned - you can see the echo lines. Where it seems to return is at the line
my $EmailRetrieval = db_get_prop(\%conf, "fetchmail", 'Method');
I get a response of status enabled, but not method. It jumps straight out.
Should fetchmail have double quotes ? I have tried single ones but to no avail.
If I # out the 3 lines with EmailRetrieval in them, it works a treat.
Can someone shed some light on this ?
/etc/e-smith/actions/email-ipup
sub fetchmailIfRequired()
{
tie my %conf, 'esmith::config';
my ($type, %properties) = db_get(\%conf, 'fetchmail');
system("echo before ipup > /root/start.txt");
return if (exists $properties{'NoIPUP'});
system("echo past ip up >/root/start.txt");
return unless (defined $properties{'status'});
return unless ($properties{'status'} eq "enabled");
system("echo enabled > /root/start.txt");
my $EmailRetrieval = db_get_prop(\%conf, 'fetchmail', 'Method');
system("echo method >start.txt");
return unless (defined $properties{'EmailRetrieval'});
system("echo retrieval > /root/start.txt");
return unless ($properties{'EmailRetrieval'} =~ /^(etrn|multidrop)$/);
system("echo etrn/multi > /root/start.txt");
return if ( ($properties{'FreqOffice'} eq 'never') and
($properties{'FreqOutside'} eq 'never') and
($properties{'FreqWeekend'} eq 'never') );
system("echo fetchmail > /root/start.txt");
system("/etc/fetchmail");
Many thanks
B. Rgds
John