Koozali.org: home of the SME Server

Legacy Forums => Suggestions => Topic started by: Engelmann on March 13, 2001, 05:21:54 PM

Title: fetchmail should be able to fetch from many pop3 boxes!
Post by: Engelmann on March 13, 2001, 05:21:54 PM
hi,
i wondered about the limited email features of e-smith?! multidrop - ok but there should also be a webinterface to configure fetchmail to get mails from different pop3 boxes and route them to a user! in many small bussines firms users have some pop3 boxes hosted by a big provider - u schould be able to fetch those mails and 4ward them to a user....

can u enable this feature?
Title: Re: fetchmail should be able to fetch from many pop3 boxes!
Post by: stephen noble on March 16, 2001, 03:26:22 PM
you can do this fairly easily if you can cp and edit, but no panel exist yet

i created a blank template-custom/fetchmail/50multi-drop
then split the existing file up
you can see what i did from this example,  50multi-dropD
i did this to
* insert a 'set daemon 60' fragment between A and D
* allow for multiple pop3 mail collection

the files must be in order so i called them
50multi-drop
50multi-dropA
50multi-dropB
..
50multi-dropZ


regards
stephen noble


#this is common
{
    use esmith::config;
    use esmith::db;

    $OUT = '';

    local %services = (fetchmail => $fetchmail);

    my $status = db_get_prop(\%services, "fetchmail", "status")
                                                         || 'disabled';

    my $method = db_get_prop(\%services, "fetchmail", "Method")
                                                         || 'standard';


    if ($status eq "enabled" && $method eq 'multidrop')
    {
         # Write a fetchmail command which connects to a POP
         # server, retrieves all mail from a single account,
         # and feeds it to the local SMTP server.

         my $envelopeSpec =
            db_get_prop(\%services, "fetchmail", "SecondaryMailEnvelope");
         my $SecondaryMailServer =
            db_get_prop(\%services, "fetchmail", "SecondaryMailServer");
         my $SecondaryMailAccount =
            db_get_prop(\%services, "fetchmail", "SecondaryMailAccount");
         my $SecondaryMailPassword =
            db_get_prop(\%services, "fetchmail", "SecondaryMailPassword");
         $envelopeSpec = defined $envelopeSpec ?
                 "envelope \"$envelopeSpec\"\n" : "";

         my $verbosity = db_get_prop(\%services, "fetchmail", "Verbosity")
                    || "";


         local %domains;
         tie %domains, 'esmith::config', '/home/e-smith/domains';

         my $locals = join(' ',
                            ("$DomainName",
                                 grep
                                    {db_get_type(\%domains, $_) eq 'domain'}
                                         keys %domains));

#A
#        $OUT .= "# multi-drop configuration; fetchmail ";
#        $OUT .= "retrieves all mail from a remote POP mailbox:\n";
#        $OUT .= "\n";
#        $OUT .= "/usr/bin/fetchmail --syslog $verbosity ";
#        $OUT .= "--fetchmailrc - <#        $OUT .= "\n";
#        $OUT .= "set postmaster \"postmaster\"\n";
#        $OUT .= "set bouncemail\n";

#D
         $OUT .= "set properties \"\"\n";
         $OUT .= "\n";

#G
#          $OUT .= "poll $SecondaryMailServer\n";
#        $OUT .= $envelopeSpec;
#        $OUT .= "    protocol POP3\n";
#        $OUT .= "    localdomains $locals\n";
#        $OUT .= "       username $SecondaryMailAccount ";
#        $OUT .= "password $SecondaryMailPassword to * here\n";
#        $OUT .= "           smtphost localhost\n";
#        $OUT .= "           smtpaddress $DomainName\n";
#        $OUT .= "           fetchall\n";
#        $OUT .= "           forcecr\n";
#        $OUT .= "\n";


#S
#duplicate G except hard code your values for multiple pop3 fetching

#Z
#        $OUT .= "EOF";

    }
}