if (is_file($unix->find_program("msmtp"))) { $msmtp_cmd = $unix->find_program("msmtp"); } $logfile = $unix->FILE_TEMP() . ".log"; chmod($tmpfileConf, 0600); $cmd = "{$msmtp_cmd} --tls-certcheck=off --timeout=10 --file={$tmpfileConf} --syslog=on --logfile={$logfile} -- {$array["to"]} <{$array["file"]}"; writelogs_framework($cmd, __FUNCTION__, __FILE__, __LINE__); shell_exec($cmd); $data = explode("\n", @file_get_contents($logfile)); writelogs_framework(implode("\n", $data), __FUNCTION__, __FILE__, __LINE__); @unlink($logfile); @unlink($tmpfileConf); echo "<articadatascgi>" . base64_encode(serialize($data)) . "</articadatascgi>"; } if (isset($_GET["uninstall-app"])) { application_uninstall(); exit; } function application_uninstall() { $cmdline = base64_decode($_GET["uninstall-app"]); $app = $_GET["app"]; $unix = new unix(); @unlink("/usr/share/artica-postfix/ressources/install/{$app}.ini"); @unlink("/usr/share/artica-postfix/ressources/install/{$app}.dbg"); $tmpstr = "/usr/share/artica-postfix/ressources/logs/UNINSTALL_{$app}"; @file_put_contents($tmpstr, "Scheduled....."); @chmod($tmpstr, 0755); sys_THREAD_COMMAND_SET("/usr/share/artica-postfix/bin/artica-install {$cmdline} >>{$tmpstr} 2>&1"); $results = explode("\n", @file_get_contents($tmpstr)); @unlink($tmpstr);
@file_put_contents($tmpfileConf,implode("\n",$msmtp)); if(is_file("/usr/share/artica-postfix/bin/artica-msmtp")){$msmtp_cmd="/usr/share/artica-postfix/bin/artica-msmtp";} if(is_file($unix->find_program("msmtp"))){$msmtp_cmd=$unix->find_program("msmtp");} $logfile=$unix->FILE_TEMP().".log"; chmod($tmpfileConf,0600); $cmd="$msmtp_cmd --tls-certcheck=off --timeout=10 --file=$tmpfileConf --syslog=on --logfile=$logfile -- {$array["to"]} <{$array["file"]}"; writelogs_framework($cmd,__FUNCTION__,__FILE__,__LINE__); shell_exec($cmd); $data=explode("\n",@file_get_contents($logfile)); writelogs_framework(implode("\n",$data),__FUNCTION__,__FILE__,__LINE__); @unlink($logfile); @unlink($tmpfileConf); echo "<articadatascgi>". base64_encode(serialize($data))."</articadatascgi>"; } if(isset($_GET["uninstall-app"])){application_uninstall();exit;} function application_uninstall(){ $cmdline=base64_decode($_GET["uninstall-app"]); $app=$_GET["app"]; $unix=new unix(); @unlink("/usr/share/artica-postfix/ressources/install/$app.ini"); @unlink("/usr/share/artica-postfix/ressources/install/$app.dbg"); $tmpstr="/usr/share/artica-postfix/ressources/logs/UNINSTALL_$app"; @file_put_contents($tmpstr,"Scheduled....."); @chmod($tmpstr,0755); sys_THREAD_COMMAND_SET("/usr/share/artica-postfix/bin/artica-install $cmdline >>$tmpstr 2>&1"); $results=explode("\n",@file_get_contents($tmpstr)); @unlink($tmpstr); echo "<articadatascgi>". base64_encode(serialize($results))."</articadatascgi>";