Commit cbe4137b authored by Claudemir Todo Bom's avatar Claudemir Todo Bom

* more user friendly messages on junkrelease procedure

parent 64d4ad62
......@@ -3,7 +3,11 @@
USER=$1
GUID=$2
doveadm fetch -u "${USER}" guid mailbox Junk guid "${GUID}" | grep -q "${GUID}" || exit 1
(doveadm fetch -u "${USER}" guid mailbox Junk guid "${GUID}" | grep -q "${GUID}") 2>&1
if [ $? -gt 0 ] ; then
echo -e "\nMensagem ${GUID}\n não encontrada na caixa de spam de ${USER}"
exit 1
fi
doveadm move -u "${USER}" INBOX mailbox Junk guid "${GUID}"
doveadm move -u "${USER}" INBOX mailbox Junk guid "${GUID}" 2>&1
exit $?
......@@ -54,11 +54,14 @@ if ($pathinfo) {
$valid = $validatecaptcha["success"];
}
if ($valid) {
echo "<p>Liberação solicitada, verifique sua caixa de entrada.</p>";
$command = 'sudo -u mail /usr/local/bin/junkrelease.sh ' . $pathinfo[0] . ' ' . $pathinfo[1] . '';
echo "<p>Autorizando o envio:</p>";
exec($command,$response);
echo "<pre>".htmlspecialchars(implode("\n",$response))."</pre>";
exec($command,$response,$exitcode);
if ($exitcode === 0) {
echo "<p>Liberação solicitada, verifique sua caixa de entrada.</p>";
} else {
echo "<p>Erro ao solicitar liberação da mensagem:</p>";
echo "<pre>"."Exitcode: ".$exitcode."\n".htmlspecialchars(implode("\n",$response))."</pre>";
}
} else {
echo "\n<b>Verificação falhou</b>\n";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment