+ if (cmdbuf[strlen(cmdbuf)-1] == '}') {
+ untagged_ok = 0;
+ }
+
+ /* Grab the tag, command, and parameters. */
+ num_parms = imap_parameterize(parms, cmdbuf);
+
+ /* RFC3501 says that we cannot output untagged data during these commands */
+ if (num_parms >= 2) {
+ if ( (!strcasecmp(parms[1], "FETCH"))
+ || (!strcasecmp(parms[1], "STORE"))
+ || (!strcasecmp(parms[1], "SEARCH"))
+ ) {
+ untagged_ok = 0;
+ }
+ }
+
+ if (untagged_ok) {
+
+ /* we can put any additional untagged stuff right here in the future */
+
+ /*
+ * Before processing the command that was just entered... if we happen
+ * to have a folder selected, we'd like to rescan that folder for new
+ * messages, and for deletions/changes of existing messages. This
+ * could probably be optimized better with some deep thought...
+ */
+ if (IMAP->selected) {
+ imap_rescan_msgids();
+ }