(defun my-mh-inc-folder-hook ()
  "Hook to rescan folder after incorporating mail."
  (if (buffer-modified-p)		; if outstanding refiles and deletes,
      (mh-execute-commands))		;   flush them
  (mh-rescan-folder)			; synchronize with +inbox
  (mh-show))				; show the current message

(add-hook 'mh-inc-folder-hook 'my-mh-inc-folder-hook)
