Discussion:
send reply email from gnus and archive original
John Kitchin
2014-06-19 13:20:59 UTC
Permalink
Hi everyone,

I am trying to switch from the web interface of gmail to gnus. I have
succeeded in getting gnus to read my mail!

("nnimap gmail:INBOX")

A feature of the web interface I really liked was the ability to reply
to an email, and upon sending it, archive the original email. Is there a
way to do that in gnus? Using a hook or something? Basically I want to
move the replied to email from the INBOX to the [Gmail]/All Mail folder
after I repply to it.

Thanks!
--
-----------------------------------
John Kitchin
Eric Abrahamsen
2014-06-19 23:36:24 UTC
Permalink
Post by John Kitchin
Hi everyone,
I am trying to switch from the web interface of gmail to gnus. I have
succeeded in getting gnus to read my mail!
("nnimap gmail:INBOX")
A feature of the web interface I really liked was the ability to reply
to an email, and upon sending it, archive the original email. Is there a
way to do that in gnus? Using a hook or something? Basically I want to
move the replied to email from the INBOX to the [Gmail]/All Mail folder
after I repply to it.
Thanks!
I guess I'd recommend using the message-sent-hook: that way you know the
message has successfully sent, but you're still in the message buffer.

In the message buffer, you can get the X-Draft-From header, which tells
you how to find the message you're replying to (there's also the
message-reply-headers variable, but that doesn't have the group
information). Then you can ask gnus to move the article. My guess is you
could call `nnimap-request-move-article' directly, but it would probably
be safer to visit the original in its summary buffer and then use
`gnus-summary-move-article'. The following is very, very lightly tested:

(defun archive-original-gmail (&optional to-group)
(save-window-excursion
(save-restriction
(message-narrow-to-headers-or-head)
(let ((draft-from (read (message-fetch-field "X-Draft-From")))
group article-number)
(when draft-from
(setq group (car draft-from)
article-number (cadr draft-from))
(gnus-activate-group group)
(when (member (cadr (gnus-find-method-for-group group))
;; only activate for some servers
'("Applicable" "Server" "Names"))
(gnus-group-read-group t nil group
(list article-number))
(gnus-summary-move-article nil "\[Gmail\]/All Mail")))))))

You'd put that in the message-sent-hook. I'd love to hear if anyone had
a better solution!

E
Ted Zlatanov
2014-09-24 21:00:48 UTC
Permalink
On Thu, 19 Jun 2014 09:20:59 -0400 John Kitchin <***@andrew.cmu.edu> wrote:

JK> Hi everyone,
JK> I am trying to switch from the web interface of gmail to gnus. I have
JK> succeeded in getting gnus to read my mail!

JK> ("nnimap gmail:INBOX")

JK> A feature of the web interface I really liked was the ability to reply
JK> to an email, and upon sending it, archive the original email. Is there a
JK> way to do that in gnus? Using a hook or something? Basically I want to
JK> move the replied to email from the INBOX to the [Gmail]/All Mail folder
JK> after I repply to it.

Can you define "archive" better? I use GMail and don't really
understand the consequences of that action.

(Also, their handling of groups as labels is really frustrating.)

Ted
Steinar Bang
2014-09-25 07:42:16 UTC
Permalink
Post by John Kitchin
Hi everyone,
I am trying to switch from the web interface of gmail to gnus. I have
succeeded in getting gnus to read my mail!
("nnimap gmail:INBOX")
I don't understand this configuration. Could you provide some more
context?

I would have thought you would need something like this...?
(setq gnus-secondary-select-methods '((nnimap "gmail" (nnimap-address "imap.gmail.com"))))

Alternatively, type press '^' (without the quotes) to get to the server
buffer and then do 'a' (again without the quotes) to add a server with
nnimap as the server method, and imap.gmail.com as the server. You can
then do RET to explore the folders on the server, and type 'u' (without
the quotes) to subscribe the ones you want.

When you're finished subscribing, just type 'q' twice (yep, still
without the quotes), and you should be back in the Group buffer, with
the subscribed folders showing up as nnimap groups.

Loading...