title: How to automatically track links in org-mode to gnus messages?
body: <p>I use org-mode + gnus + Gmail for my daily GTD routine. The concept is that treating all incoming messages as tasks, and converting all messages in INBOX into org-mode's tasks using org-capture. Once all new messages are converted into tasks, archive them, and hopefully INBOX is kept zero.</p>
  
  <p>My workflow is as follows:</p>
  
  <ol>
  <li>Open the summary view of gnus INBOX, and select a new message</li>
  <li>Capture the message with org-store-link (C-c l)</li>
  <li>Open my todo file (todo.org), and create a new task for it, and paste the captured link to the task's body with org-insert-link (C-c C-l)</li>
  <li>Go back to gnus summary view and archive the message (B del)</li>
  </ol>
  
  <p>The problem is that when moving a message into the archive folder, the captured link becomes broken, and I cannot follow the link anymore. This is because the captured link includes the IMAP folders' name and archiving message changes the message's IMAP folder name. E.g.,</p>
  
  <ul>
  <li>Captured link: <code>[[gnus:nnimap%2Blocalhost:%5BGmail%5D.Important#1364607772002.9702fb8c@Nodemailer][Email from Geeklist Team: Geekli.st Suggestions &amp; Activi]]</code> (IMAP folder name is <code>"[Gmail]Important"</code>)</li>
  <li>Link to archived message: <code>[[gnus:nnimap%2Blocalhost:%5BGmail%5D.All Mail#1364607772002.9702fb8c@Nodemailer][Email from Geeklist Team: Geekli.st Suggestions &amp; Activi]]</code> (IMAP folder name is <code>"[Gmail]All Mail"</code>)</li>
  </ul>
  
  <p>So my question is: how can I update the captured link automatically when the message is moved to other folders? I guess there are some hooks to do this, but I could not find a good sample for this purpose. Or any simpler solutions for this kind of routine are welcome. TIA.</p>