+/**
+ * Detects if mailbox is the Inbox folder or subfolder of the Inbox
+ *
+ * @param string $box The mailbox name to test
+ * @param boolean $include_subs If true, subfolders of system folders
+ * are special. If false, subfolders are
+ * not special mailboxes.
+ *
+ * @return boolean Whether this is the Inbox or a child thereof.
+ *
+ * @since 1.4.22
+ */
+function isInboxMailbox($box, $include_subs=TRUE) {
+ return ((strtolower($box) == 'inbox')
+ || ($include_subs && isBoxBelow(strtolower($box), 'inbox')));
+}
+