// 'r' => read/only
// '' => site down
+ /** Catch-all mode for mails
+ * If set to 1, all emails are sent to admin_email (defined in [Core])
+ * instead of their actual destination (but apparent from and to aren't
+ * modified)
+ */
+ public $catchmail = false;
+
/** Tell smarty to check the timestamps of the templates to decide
* whether recompile the template or not. If this option is false and
* debug mode is not activate, templates won't be recompile if they changed.
$dests[] = "{$a->mailbox}@{$a->host}";
}
+ // Support for "catch-all" mail address : all emails are sent to
+ // admin_email instead of actual recipients
+ global $globals;
+ if($globals->catchmail) {
+ require_once 'Mail/RFC822.php';
+ if(@Mail_RFC822::isValidInetAddress($globals->admin_email)){
+ $dests = array($globals->admin_email);
+ }else if(@Mail_RFC822::isValidInetAddress($globals->core->admin_email)){
+ $dests = array($globals->core->admin_email);
+ }
+ }
+
// very important to do it in THIS order very precisely.
$body = $this->get(array('text_charset' => $this->charset,
'text_encoding' => '8bit',