Gord,

You have a mysql database and a PHP script.  You should not be using
sendmail or cat but rather something like:

$dbhost = "localhost";
$dbuser = "imauser";
$dbpass = "imapassword";
$dbname = "md_quarantine";

$link = mysql_connect("$dbhost", "$dbuser", "$dbpass")
        or die ("Could not connect");
mysql_select_db ("$dbname")
        or die ("Could not select database");

$cmd = "select * from emails where email_id = <some variable you are taking
care of'";

$result = mysql_query($cmd);

while($row=mysql_fetch_array($result)) {
  mail($row[email_address], $row[email_subject], $row[email_body]);
}

Depending on how you are storing the data in the database, you might need to
rebuild a mime-email (beyond me in php), etc. but this should be some
framework to get started.

KAM

----- Original Message ----- 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 12, 2004 5:16 PM
Subject: [Mimedefang] PHP and Releasing a message


> Hello,
>
> This is my first post on this list.
>
> At my work place we have dumped all quarantined emails to a mysql
database.
>
> A little background is that our Mail server is just an email gateway and
> hands off messages to the internal mail server.
>
> We are attempting to release the messages fromt he web interface but are
> having problems witht he command. Every time we try it trys to send it to
> localhost and not to the internal mail server. Anyone tried to build a
> 'release of quarantined emails' script?
>
> I tried the 'sendmail -f `cat SENDER` `cat RECIPIENTS` < ENTIRE_MESSAGE'
>
> Thanks,
>
> Gord
>
>
>
>
> _______________________________________________
> Visit http://www.mimedefang.org and http://www.canit.ca
> MIMEDefang mailing list
> [EMAIL PROTECTED]
> http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
>

_______________________________________________
Visit http://www.mimedefang.org and http://www.canit.ca
MIMEDefang mailing list
[EMAIL PROTECTED]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

Reply via email to