info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Is there a better way to reply "Disposition-Notification-To"?


From: id . brep
Subject: Is there a better way to reply "Disposition-Notification-To"?
Date: Thu, 28 Jun 2007 21:33:00 -0700
User-agent: G2/1.0

I want to reply messages with a "Disposition-Notification-To" field in
the header automatically.
Here is a working solution, is there a better soloution?

(add-hook 'gnus-startup-hook
          '(lambda ()
             (setq gnus-visible-headers
                   (concat "^Disposition-Notification-To:\\|"
                           gnus-visible-headers))))

(eval-after-load "gnus-sum"
  '(add-hook 'gnus-mark-article-hook 'my-check-notification))

(defun my-check-notification ()
  (if (gnus-summary-article-unread-p (gnus-summary-article-number))
      (add-hook 'gnus-article-prepare-hook 'my-reply-notification)
    (remove-hook 'gnus-article-prepare-hook 'my-reply-notification)))

(defun my-reply-notification ()
  (save-excursion
    (save-restriction
      (message-narrow-to-headers)
      (if (and (mail-fetch-field "disposition-notification-to")
               (yes-or-no-p "Really send the dispositon notification?"))
          (progn (gnus-summary-reply)
                 (insert "Got it, thanks.")
                 (message-send-and-exit))))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]