// : $label;
// }
+
/**
* Mark a mailbox as read-only.
*
/**
+ * Determine whether to prompt a user to send a Message Disposition
+ * Notification (MDN; a/k/a read-receipt) if their preferences require
+ * a prompt. Useful if MDNs should automatically be sent for a certain
+ * subset of messages, e.g. e-mail addresses within the domain.
+ *
+ * @param Horde_Mime_Headers $headers A headers object.
+ *
+ * @return boolean Should the user be prompted to send a MDN?
+ */
+// public function mdn_check($headers)
+// {
+// // Example #1: Don't require MDN prompt if the message is sent by
+// // someone within the same domain (NOTE: this does no checking on
+// // spoofed e-mail addresses; further verification should probably
+// // be done before automatically sending out a MDN).
+// $from = $headers->getOb('from');
+// return (strcasecmp($from['host'], 'example.com') !== 0);
+// }
+
+
+ /**
* Allow additional information to be added/edited from the data that is
* passed to the mailbox display template:
* imp: imp/templates/mailbox/mailbox.html
// return array($quota[1] * 1024, $quota[2] * 1024);
// }
+
/**
* Retrieves public S/MIME keys of message recipients.
*
// return $information[0][$attribute][0];
// }
+
/**
* Retrieves public PGP keys of message recipients.
*
// return $information[0][$attribute][0];
// }
+
/**
* DIMP: Allow additional information to be added to the array that is
* passed to the message text display template:
* second element is an array of javascript commands, one
* command per array value.
*/
-// public function dimp_previewview($msg) {
+// public function dimp_previewview($msg)
+// {
// // Example #1: Alter the subject
// $msg['subject'] .= 'test';
//
/**
* Check if we need to send a MDN, and send if needed.
*
- * @param string $mailbox The mailbox of the message.
- * @param integer $uid The UID of the message.
- * @param array $headers The headers of the message.
- * @param boolean $confirmed Has the MDN request been confirmed?
+ * @param string $mailbox The mailbox of the message.
+ * @param integer $uid The UID of the message.
+ * @param Horde_Mime_Headers $headers The headers of the message.
+ * @param boolean $confirmed Has the MDN request been confirmed?
*
* @return boolean True if the MDN request needs to be confirmed.
*/
if (!$confirmed &&
((intval($pref_val) == 1) ||
$mdn->userConfirmationNeeded())) {
- return true;
+ try {
+ if (Horde::callHook('mdn_check', array($headers), 'imp')) {
+ return true;
+ }
+ } catch (Horde_Exception_HookNotSet $e) {
+ return true;
+ }
}
/* Send out the MDN now. */