From f7532b0adaea3c90c2f6036537a1fbce457e6ab1 Mon Sep 17 00:00:00 2001 From: Alan Garcia Date: Thu, 7 Feb 2013 16:06:41 +0000 Subject: [PATCH] Pour #1350 Squirrelmail OK Roundcube TODO --- roundcube/class/m_roundcube.php | 3 +-- squirrelmail/class/m_squirrelmail.php | 28 +++++++++++++++++++++++---- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/roundcube/class/m_roundcube.php b/roundcube/class/m_roundcube.php index 8b1e9007..71b0cdb0 100644 --- a/roundcube/class/m_roundcube.php +++ b/roundcube/class/m_roundcube.php @@ -73,10 +73,9 @@ class m_roundcube { * @return boolean */ function hook_mail_delete_for_real($mail_id, $fullmail) { - // FIXME do something ! // Include Roundcube configuration // Delete from the roundcube configuration - // Use cleandb.sh filled by roundcube ? + // Use cleandb.sh filled by roundcube ? http://trac.roundcube.net/browser/github/bin/cleandb.sh printvar($mail_id); printvar($fullmail); } diff --git a/squirrelmail/class/m_squirrelmail.php b/squirrelmail/class/m_squirrelmail.php index 7897af22..5259e20c 100644 --- a/squirrelmail/class/m_squirrelmail.php +++ b/squirrelmail/class/m_squirrelmail.php @@ -65,9 +65,29 @@ class m_squirrelmail { } + + /* ----------------------------------------------------------------- */ + /** Hook called when an email is REALLY deleted (by the cron, not just in the panel) + * @param mail_id integer the ID of the mail in the AlternC database + * @param fullmail string the deleted mail himself in the form of john@domain.tld + * @return boolean + */ + function hook_mail_delete_for_real($mail_id, $fullmail) { + $fullmail2 = str_replace('@','_',$fullmail); // fullname with _ instead of @ (compatibility) + $todel = array ( + "$fullmail.abook", + "$fullmail.pref", + "$fullmail2.abook", + "$fullmail2.pref"); + + foreach ( $todel as $t ) { + if (file_exists($t) ) { + @unlink("/var/lib/squirrelmail/data/$t"); + } + } + } // hook_mail_delete_for_real + + + } /* Class Squirrelmail */ - - - -