
{
    $OUT = '';

    my $status = $fetchmail{"status"};

    if (defined $status && $status eq "enabled")
    {
	my $method = $fetchmail{'Method'};
	if (($method eq 'etrn') || ($method eq 'multidrop'))
	{
	    $OUT .= "\n";
	    $OUT .= "# fetchmail times during office hours\n";
	    $OUT .= "\n";

	    my $FetchmailFreqOffice = $fetchmail{'FreqOffice'};
	    if ($FetchmailFreqOffice)
	    {
		if ($FetchmailFreqOffice eq 'every5min')
		{
		    $OUT .= "*/5\t8-17\t*\t*\t1-5\troot\t/etc/startmail\n";
		}
		elsif ($FetchmailFreqOffice eq 'every15min')
		{
		    $OUT .= "*/15\t8-17\t*\t*\t1-5\troot\t/etc/startmail\n";
		}
		elsif ($FetchmailFreqOffice eq 'every30min')
		{
		    $OUT .= "*/30\t8-17\t*\t*\t1-5\troot\t/etc/startmail\n";
		}
		elsif ($FetchmailFreqOffice eq 'everyhour')
		{
		    $OUT .= "0\t8-17\t*\t*\t1-5\troot\t/etc/startmail\n";
		}
		elsif ($FetchmailFreqOffice eq 'every2hrs')
		{
		    $OUT .= "0\t8-17/2\t*\t*\t1-5\troot\t/etc/startmail\n";
		}
		else
		{
		    $OUT .= "# FetchmailFreqOffice - never\n";
		}
	    }
	    else
	    {
		$OUT .= "# FetchmailFreqOffice - not defined\n";
	    }

	    $OUT .= "\n";
	    $OUT .= "# fetchmail times outside office hours\n";
	    $OUT .= "\n";

	    my $FetchmailFreqOutside = $fetchmail{'FreqOutside'};
	    if ($FetchmailFreqOutside)
	    {
		if ($FetchmailFreqOutside eq 'every5min')
		{
		    $OUT .= "*/5\t0-7\t*\t*\t1-5\troot\t/etc/startmail\n";
		    $OUT .= "*/5\t18-23\t*\t*\t1-5\troot\t/etc/startmail\n";
		}
		elsif ($FetchmailFreqOutside eq 'every15min')
		{
		    $OUT .= "*/15\t0-7\t*\t*\t1-5\troot\t/etc/startmail\n";
		    $OUT .= "*/15\t18-23\t*\t*\t1-5\troot\t/etc/startmail\n";
		}
		elsif ($FetchmailFreqOutside eq 'every30min')
		{
		    $OUT .= "*/30\t0-7\t*\t*\t1-5\troot\t/etc/startmail\n";
		    $OUT .= "*/30\t18-23\t*\t*\t1-5\troot\t/etc/startmail\n";
		}
		elsif ($FetchmailFreqOutside eq 'everyhour')
		{
		    $OUT .= "0\t0-7\t*\t*\t1-5\troot\t/etc/startmail\n";
		    $OUT .= "0\t18-23\t*\t*\t1-5\troot\t/etc/startmail\n";
		}
		elsif ($FetchmailFreqOutside eq 'every2hrs')
		{
		    $OUT .= "0\t0-7/2\t*\t*\t1-5\troot\t/etc/startmail\n";
		    $OUT .= "0\t18-23/2\t*\t*\t1-5\troot\t/etc/startmail\n";
		}
		else
		{
		    $OUT .= "# FetchmailFreqOutside - never\n";
		}
	    }
	    else
	    {
		$OUT .= "# FetchmailFreqOutside - not defined\n";
	    }

	    $OUT .= "\n";
	    $OUT .= "# fetchmail times during the weekend\n";
	    $OUT .= "\n";

	    my $FetchmailFreqWeekend = $fetchmail{'FreqWeekend'};
	    if ($FetchmailFreqWeekend)
	    {
		if ($FetchmailFreqWeekend eq 'every5min')
		{
		    $OUT .= "*/5\t*\t*\t*\t6-7\troot\t/etc/startmail\n";
		}
		elsif ($FetchmailFreqWeekend eq 'every15min')
		{
		    $OUT .= "*/15\t*\t*\t*\t6-7\troot\t/etc/startmail\n";
		}
		elsif ($FetchmailFreqWeekend eq 'every30min')
		{
		    $OUT .= "*/30\t*\t*\t*\t6-7\troot\t/etc/startmail\n";
		}
		elsif ($FetchmailFreqWeekend eq 'everyhour')
		{
		    $OUT .= "0\t*\t*\t*\t6-7\troot\t/etc/startmail\n";
		}
		elsif ($FetchmailFreqWeekend eq 'every2hrs')
		{
		    $OUT .= "0\t*/2\t*\t*\t6-7\troot\t/etc/startmail\n";
		}
		else
		{
		    $OUT .= "# FetchmailFreqWeekend - never\n";
		}
	    }
	    else
	    {
		$OUT .= "# FetchmailFreqWeekend - not defined\n";
	    }
	}
    }
}

