#!/usr/bin/perl -w # this quick hack helps you generate/maintain .fetchmailrc files from # FS::acct_snarf data. it is run from a shellcommands export as: # create-fetchmailrc $username $dir $snarf_machine1 $snarf_username1 $snarf__password1 $snarf_machine2 $snarf_username2 $snarf__password2 ... use strict; use POSIX qw( setuid setgid ); my $header = <$filename") or die "can't open $filename: $!\n"; chown $uid, $gid, $filename or die "can't chown $uid.$gid $filename: $!\n"; chmod 0600, $filename or die "can't chmod 600 $filename: $!\n"; print FETCHMAILRC $header; while ($ARGV[0]) { my( $s_machine, $s_username, $s_password ) = splice( @ARGV, 0, 3 ); print FETCHMAILRC <