Next: Marking Articles, Previous: Reply Followup and Post, Up: Summary Buffer [Contents][Index]

### 3.6 Delayed Articles

Sometimes, you might wish to delay the sending of a message. For example, you might wish to arrange for a message to turn up just in time to remind your about the birthday of your Significant Other. For this, there is the `gnus-delay` package. Setup is simple:

    (gnus-delay-initialize)

Normally, to send a message you use the `C-c C-c` command from Message mode. To delay a message, use `C-c C-j` (`gnus-delay-article`) instead. This will ask you for how long the message should be delayed. Possible answers are:

- A time span. Consists of an integer and a letter. For example, `42d` means to delay for 42 days. Available letters are `m` (minutes), `h` (hours), `d` (days), `w` (weeks), `M` (months) and `Y` (years).
- A specific date. Looks like `YYYY-MM-DD`. The message will be delayed until that day, at a specific time (eight o’clock by default). See also `gnus-delay-default-hour`.
- A specific time of day. Given in `hh:mm` format, 24h, no am/pm stuff. The deadline will be at that time today, except if that time has already passed, then it’s at the given time tomorrow. So if it’s ten o’clock in the morning and you specify `11:15`, then the deadline is one hour and fifteen minutes hence. But if you specify `9:20`, that means a time tomorrow.

The action of the `gnus-delay-article` command is influenced by a couple of variables:

`gnus-delay-default-hour`

  When you specify a specific date, the message will be due on that hour on the given date. Possible values are integers 0 through 23.

`gnus-delay-default-delay`

  This is a string and gives the default delay. It can be of any of the formats described above.

`gnus-delay-group`

  Delayed articles will be kept in this group on the drafts server until they are due. You probably don’t need to change this. The default value is `"delayed"`.

`gnus-delay-header`

  The deadline for each article will be stored in a header. This variable is a string and gives the header name. You probably don’t need to change this. The default value is `"X-Gnus-Delayed"`.

The way delaying works is like this: when you use the `gnus-delay-article` command, you give a certain delay. Gnus calculates the deadline of the message and stores it in the `X-Gnus-Delayed` header and puts the message in the `nndraft:delayed` group.

And whenever you get new news, Gnus looks through the group for articles which are due and sends them. It uses the `gnus-delay-send-queue` function for this. By default, this function is added to the hook `gnus-get-new-news-hook`. But of course, you can change this. Maybe you want to use the demon to send drafts? Just tell the demon to execute the `gnus-delay-send-queue` function.

`gnus-delay-initialize`

  By default, this function installs `gnus-delay-send-queue` in `gnus-get-new-news-hook`. But it accepts the optional second argument `no-check`. If it is non-`nil`, `gnus-get-new-news-hook` is not changed. The optional first argument is ignored.

  For example, `(gnus-delay-initialize nil t)` means to do nothing. Presumably, you want to use the demon for sending due delayed articles. Just don’t forget to set that up :-)

When delaying an article with `C-c C-j`, Message mode will automatically add a `"Date"` header with the current time. In many cases you probably want the `"Date"` header to reflect the time the message is sent instead. To do this, you have to delete `Date` from `message-draft-headers`.

Next: Marking Articles, Previous: Reply Followup and Post, Up: Summary Buffer [Contents][Index]