[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Re : fetchmail dependencies



I know replying own mails is lame but
i just made a console fetchmail configurating program
to finish problem which i think exist
program uses perl-base and is 1.6 kB big
its name is fetchmailsetup and it works
i attach it here(its not big)
in hope someone will join it to fetchmail.deb
licence is the same as perl etc.

#!/usr/bin/perl -w

$DEFAULT_POSTMASTER = 'root';
$DEFAULT_PROTO      = 'POP3';
$CONFIG_FILENAME    = '.fetchmailrc';

print "Welcome to fetchmail configuration program\n\n";
open FHCONFIG,">$ENV{HOME}/$CONFIG_FILENAME";
($date = `date`) =~ s/\n//;
print FHCONFIG "# Configuration created $date by fetchmailsetup\n";

print "who do you want to be a postmaster (default = $DEFAULT_POSTMASTER)?\n";
($postmaster = <STDIN>) =~ s/\n//;
unless($postmaster){$postmaster = $DEFAULT_POSTMASTER}
print FHCONFIG "set postmaster $postmaster\n";
server_config();
close FHCONFIG;

sub server_config{
print "enter name of computer which stores your mail (none to finish)\n";
($server = <STDIN>) =~ s/\n//;
unless($server){return}
print "what proto do you want me to use (POP3 IMAP APOP) (default $DEFAULT_PROTO)\n";
($proto = <STDIN>) =~ s/\n//;
unless($proto){$proto = $DEFAULT_PROTO};
print FHCONFIG "\npoll $server with proto $proto\n";
user_config();
print "do you have accounts on another computers (y|[n])?\n";
(<STDIN> eq "y\n")and server_config();
}

sub user_config{
print "enter your login on $server\n";
($remotename = <STDIN>) =~ s/\n//;
print "enter your passwd on $server\n";
($remotepass = <STDIN>) =~ s/\n//;
print "enter your login here(default $postmaster)\n";
($localname  = <STDIN>) =~ s/\n//;
unless($localname) {$localname = $postmaster};
print FHCONFIG "\tuser \"$remotename\" there with password \"$remotepass\" is $localname here warnings 3600\n";
print "do you have more accounts on this computer (y|[n])?\n";
(<STDIN> eq "y\n")and user_config();
}



Reply to: