procmail
[Top] [All Lists]

Mail Procesing

2002-10-09 20:49:11
Dear All,

Hi .. I am try to make onfig to mail processing on my qmail+vpopmail server
And I have plan to make the automatic reply in setting with procmail

I have account xxx(_at_)ourmail(_dot_)com own by root
When this account receive email with CERTAIN SUBJECT (ex :"QUIZ") with
body message "Name and , this will automatic reply to sender
by querying to MySQL database.. is this possible using procmail to
process this case?
would you pls give correction / guidance for my procmail

I try to this config but its wont process
its my .promailrc config

/home/afif/.procmail

SENDMAIL=/usr/sbin/sendmail
 :0
 * ^TO_xxx\(_at_)ourmail\(_dot_)com
 * ^Subject:.*QUIZ
 * !^FROM_DAEMON
 * !^X-Loop: xxx\(_at_)ourmail\(_dot_)com
 | ( formail -r -A"X-Loop: xxx(_at_)ourmail(_dot_)com"    \
         -I"From: Quis <xxx(_at_)ourmail(_dot_)com>" ;\
         | /home/quiz/auto/quiz.pl  ) | $SENDMAIL -oi -t

  
and this my quiz.pl file

#/usr/bin/perl

my $servername = "tiger";
my $username   = "quiz";
my $userpass   = "tiger";
my $dbname     = "quiz";
my $tblname    = "quiz";

su show_entry {
my ($dbh, $query ,@row)

$dbh = 
DBI->connect("DBI:mysql:database=$dbname;host=$servername",$username,$useerpass);
$query = $dbh->prepare("SELECT id_quiz, quiz_name, right FROM $tblname ORDER BY 
id_quiz");
$query->execute;
print $query;
    print "Jawabanya ",hr;
     while(@row = $query->fetchrow_array) {
          $row[3] = scalar(localtime($row[3]));
          print "ID Quiz: ", $row[0], br;
          print "Quiz Name: ", $row[1], br;
          print "Right ", $row[2], br;
     }
     $query->finish;
     $dbh->disconnect;

}

thanks for all yr support
-- 
Best regards,
Afif
mailto:afif(_at_)sur(_dot_)ogs-id(_dot_)com


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>
  • Mail Procesing, Afif <=