I know it's a little off-topic, but then again DIALD users are the one's
most likely to benefit from such a tool.  So by way of a thank-you to the
group, here's a little perl script that I wrote to run pine and kick
sendmail if outgoing mail is generated during the session.

FWIW,

RL

#!/usr/bin/perl
###################################
#       /usr/local/bin/pern v. 0.0.1
#       Invokes pine and upon
#       pine's demise, checks if there is mail in the queue and
#       if so, kicks sendmail
#
#       copyleft 1999 -- Randy Legault
##########################################

$return_value=fork() ;
if ( $return_value == 0 ) {
        exec "/usr/bin/pine";
}
elsif ( defined $return_value  ) {
        $pid=wait;      # waiting for pine to die

        ####################################################
        ##    Read the mail queue directory to an array   ##    

        opendir(DIR,"/var/spool/mqueue/") || die "Can't open \$";
        @mqueue=readdir(DIR);
        close(DIR);

}
else {
        die "Fork failed: $!\n";
}

##########################################################################################
##    If at least one in addition to parent(..) and current (.) then kick sendmail     
 ##

$no_files=@mqueue;
if ( $no_files > 2 ){
        exec "/usr/sbin/sendmail -q &";
        exit 0;
}
else {
        exit 0;
}       


-
To unsubscribe from this list: send the line "unsubscribe linux-diald" in
the body of a message to [EMAIL PROTECTED]

Reply via email to