Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Re: Delayed messages with "revealing" Date header?
       [not found] <mailman.1097.1265928013.14305.info-gnus-english@gnu.org>
@ 2010-02-12  1:40 ` Katsumi Yamaoka
  2010-02-12 22:36   ` Tim Landscheidt
  2010-02-12 23:45   ` Steven E. Harris
  0 siblings, 2 replies; 4+ messages in thread
From: Katsumi Yamaoka @ 2010-02-12  1:40 UTC (permalink / raw)
  To: info-gnus-english

>>>>> Tim Landscheidt wrote:
>   When I delay a message with C-c C-j, the message gets a
> Date header with the current time (visible in the delayed
> group) that is not filtered when the message is sent. This
> results in a message sent at time Y that is clearly labelled
> as having been written at time X - though in most cases I
> would assume the intention would be to pretend it having
> been written at time Y. Is this an issue with my setup
> (Gnus 5.13) or is my use case so uncommon? :-)

The present behavior seems faithful to RFC2822:

,----
| 3.6.1. The origination date field 3.6.1.
| [...]
| The origination date specifies the date and time at which the
| creator of the message indicated that the message was complete
| and ready to enter the mail delivery system. For instance, this
| might be the time that a user pushes the "send" or "submit"
| button in an application program. In any case, it is
| specifically not intended to convey the time that the message is
| actually transported, but rather the time at which the human or
| other creator of the message has put the message into its final
| form, ready for transport. (For example, a portable computer
| user who is not connected to a network might queue a message for
| delivery. The origination date is intended to contain the date
| and time that the user queued the message, not the time when the
| user connected to the network to send the message.)
`----

You can easily override it though. ;-p

(defadvice gnus-draft-send (around remove-date-header-from-delayed-message
				   activate)
  "Remove Date header from delayed message in order to be redone."
  (if (equal (ad-get-arg 1) "nndraft:delayed")
      (let ((gnus-message-setup-hook
	     (cons (lambda nil
		     (save-restriction
		       (message-narrow-to-headers)
		       (if (re-search-forward "^Date:.*\n" nil t)
			   (replace-match ""))))
		   gnus-message-setup-hook)))
	ad-do-it)
    ad-do-it))

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Delayed messages with "revealing" Date header?
  2010-02-12  1:40 ` Delayed messages with "revealing" Date header? Katsumi Yamaoka
@ 2010-02-12 22:36   ` Tim Landscheidt
  2010-02-12 23:45   ` Steven E. Harris
  1 sibling, 0 replies; 4+ messages in thread
From: Tim Landscheidt @ 2010-02-12 22:36 UTC (permalink / raw)
  To: info-gnus-english

Katsumi Yamaoka <yamaoka@jpl.org> wrote:

>>   When I delay a message with C-c C-j, the message gets a
>> Date header with the current time (visible in the delayed
>> group) that is not filtered when the message is sent. This
>> results in a message sent at time Y that is clearly labelled
>> as having been written at time X - though in most cases I
>> would assume the intention would be to pretend it having
>> been written at time Y. Is this an issue with my setup
>> (Gnus 5.13) or is my use case so uncommon? :-)

> The present behavior seems faithful to RFC2822:

> ,----
> | 3.6.1. The origination date field 3.6.1.
> | [...]
> | The origination date specifies the date and time at which the
> | creator of the message indicated that the message was complete
> | and ready to enter the mail delivery system. For instance, this
> | might be the time that a user pushes the "send" or "submit"
> | button in an application program. In any case, it is
> | specifically not intended to convey the time that the message is
> | actually transported, but rather the time at which the human or
> | other creator of the message has put the message into its final
> | form, ready for transport. (For example, a portable computer
> | user who is not connected to a network might queue a message for
> | delivery. The origination date is intended to contain the date
> | and time that the user queued the message, not the time when the
> | user connected to the network to send the message.)
> `----

Well, it probably depends whether Gnus considers itself a
MUA or a MTA :-). *If* the latter, I would expect a delay
string of "when online on network X" rather than wall-clock
time :-).

> You can easily override it though. ;-p

> (defadvice gnus-draft-send (around remove-date-header-from-delayed-message
> 				   activate)
>   "Remove Date header from delayed message in order to be redone."
>   (if (equal (ad-get-arg 1) "nndraft:delayed")
>       (let ((gnus-message-setup-hook
> 	     (cons (lambda nil
> 		     (save-restriction
> 		       (message-narrow-to-headers)
> 		       (if (re-search-forward "^Date:.*\n" nil t)
> 			   (replace-match ""))))
> 		   gnus-message-setup-hook)))
> 	ad-do-it)
>     ad-do-it))

I *wanted* to ask why not to advise gnus-delay-send-queue,
which seems to be the more "natural" place to do so, then I
wondered how you could then set a Date header if you wanted
to, so I started debugging where the Date header actually
comes from :-). The result was that the Date header gets in-
serted due to message-draft-headers. Deleting Date from that
solved the issue.

  The only downside I could find so far was that the drafts
and delayed groups can no longer be sorted by date; are
there any other disadvantages I overlooked?

Tim

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Delayed messages with "revealing" Date header?
  2010-02-12  1:40 ` Delayed messages with "revealing" Date header? Katsumi Yamaoka
  2010-02-12 22:36   ` Tim Landscheidt
@ 2010-02-12 23:45   ` Steven E. Harris
  1 sibling, 0 replies; 4+ messages in thread
From: Steven E. Harris @ 2010-02-12 23:45 UTC (permalink / raw)
  To: info-gnus-english

Katsumi Yamaoka <yamaoka@jpl.org> writes:

> 		     (save-restriction
> 		       (message-narrow-to-headers)
> 		       (if (re-search-forward "^Date:.*\n" nil t)
> 			   (replace-match "")))

There's also `message-remove-header'. Would that work here?

-- 
Steven E. Harris

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Delayed messages with "revealing" Date header?
@ 2010-02-11 22:39 Tim Landscheidt
  0 siblings, 0 replies; 4+ messages in thread
From: Tim Landscheidt @ 2010-02-11 22:39 UTC (permalink / raw)
  To: info-gnus-english

Hi,

sorry, I previously sent this message by mistake to ding.

  When I delay a message with C-c C-j, the message gets a
Date header with the current time (visible in the delayed
group) that is not filtered when the message is sent. This
results in a message sent at time Y that is clearly labelled
as having been written at time X - though in most cases I
would assume the intention would be to pretend it having
been written at time Y. Is this an issue with my setup
(Gnus 5.13) or is my use case so uncommon? :-)

Tim

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-02-12 23:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.1097.1265928013.14305.info-gnus-english@gnu.org>
2010-02-12  1:40 ` Delayed messages with "revealing" Date header? Katsumi Yamaoka
2010-02-12 22:36   ` Tim Landscheidt
2010-02-12 23:45   ` Steven E. Harris
2010-02-11 22:39 Tim Landscheidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).