Koozali.org: home of the SME Server

Obsolete Releases => SME 7.x Contribs => Topic started by: femc on February 04, 2009, 02:36:14 PM

Title: fetchmail from schirrms.net - ssl port setting
Post by: femc on February 04, 2009, 02:36:14 PM
I am using fetchmail 1.3.6, and need to use ssl pop ( experimental ).

My em provider wants to introduce now the ssl pop, but with some port numbers not according to gemail.

I cannot find the 'fetchmailrc' on my box. Please give an advise where to change the port numbers. Is there a config file for this ? where ?

hdmueller
Title: Re: fetchmail from schirrms.net - ssl port setting
Post by: Stefano on February 04, 2009, 04:06:43 PM
Hi

if you are referring to smeserver-fetchmail, I think you should look at /etc/e-smith/templates/etc/fetchmail/90fetchmail fragment and, after creating a copy in /etc/e-smith/templates-custom/etc/fetchmail/, modify it according to your needs..

ciao
Stefano

Title: Re: fetchmail from schirrms.net - ssl port setting
Post by: femc on February 08, 2009, 09:51:20 AM
i looked in the file 90fetchmail - could not find any reference to the port setting ???? - but I am not so familiar with these scripts

please explain more

hdmueller
Title: Re: fetchmail from schirrms.net - ssl port setting
Post by: Stefano on February 08, 2009, 10:02:26 AM
ok..

all you have to do is look at fetchmail file conf (on google for example), then customize your file according to your needs.. there are no references to port? well, you could do everything you wish..

I've changed my 90fetchmail to use with freepops..

thisi is the modified part
Code: [Select]
foreach my $FetchMailAcount ( @FetchMailAccounts )
                {
                    $i++ ;
                    my ( $mserv, $mtype, $mname, $mpass ) = split FS, $FetchMailAcount ;
                if(not defined $mserv ) { $mserv='';}
                if(not defined $mname ) { $mname='';}
                if(not defined $mpass ) { $mpass='';}
                if(not defined $mtype ) { $mtype='';}
    my $mport = '';
   
                my $dnstyp = " and options no dns ";
   
                if ($mserv ne '')
                {
                $dnstyp = " and options no dns ";

if ($mserv eq "my.lan") {
$mport=' port 2000';
$mserv=' 192.168.0.90';
}
   
                if($mtype eq "IMAP") { $dnstyp= ""; }
   
                my $mdbg="-d0 --silent --syslog ";
                if($Debug eq "YES") { $mdbg="-d0 --verbose --syslog "; }
   
                my $staticvalue  = "/usr/bin/fetchmail " . $mdbg . "--fetchmailrc - <<EOF\n" ;
                        $staticvalue .= "set postmaster \"postmaster\"\n" ;
                        $staticvalue .= "set bouncemail\nset properties \"\"\n" ;

                        # we need to convert the name and the password from HEX to text
                        $mname = pack( "H*", $mname ) ;
                        $mpass = pack( "H*", $mpass ) ;

                        # special case : the \ must be changed to \x5c !
                        $mname =~ s/[\\]/\\x5c/g ;
                        $mpass =~ s/[\\]/\\x5c/g ;
                        # escape some odd characters by \ (just add them between the [] if needed
                        $mname =~ s/([\^\$\@\'\"\`])/\\$1/g ;
                        $mpass =~ s/([\^\$\@\'\"\`])/\\$1/g ;
 # special case : the ' must be quoted another way
                        $mname =~ s/[\']/\\x27/g ;
                        $mpass =~ s/[\']/\\x27/g ;

                $OUT .= "#\n";
                        $OUT .= "#   Mail N".$i." Account for : ".$comment."\n";
$OUT .= "logger -p mail.info ".$comment." ".$mname."\n";
                        $OUT .= $staticvalue;
                        $OUT .= "poll ".$mserv." with proto ".$mtype."".$mport."".$dnstyp." user '" ;
                        $OUT .= $mname."' smtpaddress ".$dom." with password '" ;
                        $OUT .= $mpass."' is ".$name." here".$keep." \n" ;
                    $OUT .="EOF\n";
                }
            }
            }
        }

NOTE this is only a part of the file

as you can see, I use a non standard port and ip if I use "my.lan" as the remote server..

HTH
Ciao

Stefano