Gnus:如何根据电子邮件的发送帐户来归档电子邮件?[gcc-self 未按预期工作]

Mar*_*ert 6 emacs gnus

我有两个邮件帐户,foo.bar@uni.edu并且foo.bar@gmail.com. 我想将我从任一邮件发送的邮件存档到相应的“已发送邮件”文件夹(nnimap+foo.bar@uni.edu:Sent Itemsfoo.bar@gmail.com:[Google Mail]/Sent Mail)中。

我尝试设置

(setq gnus-message-archive-group
  '(("uni" "nnimap+foo.bar@uni.edu:Sent Items")
    ("gmail" "nnimap+foo.bar@gmail.com:[Google Mail]/Sent Mail")
    ))
Run Code Online (Sandbox Code Playgroud)

但这并没有设置 Gcc(新消息没有 Gcc;这里有什么解决方案吗?)。因此,如果我通过在 *Group* 中打开一条新消息,我会返回(setq gnus-message-archive-group "nnimap+foo.bar@uni.edu:Sent Items")正确设置 Gcc(对于主帐户) 。foo.bar@uni.edum

然后我尝试使用gcc-selfviagnus-parameters正确存档已发送的邮件:

(setq gnus-parameters
       `((,(rx "nnimap+foo.bar@uni.edu")
         (gcc-self . "nnimap+foo.bar@uni.edu:Sent Items"))
         (,(rx "nnimap+foo.bar@gmail.com")
         (gcc-self . "foo.bar@gmail.com:[Google Mail]/Sent Mail"))))
Run Code Online (Sandbox Code Playgroud)

手册(http://www.gnus.org/manual/gnus_28.html)说如果gcc-self是一个字符串,它只是按字面意思插入为Gcc标头。C-u m我有以下经验:无论我在 *Group* 中通过(使用m,Gcc 是“nnimap+foo.bar@uni.edu:Sent Items”,如前所述)开始一条新消息,Gcc 都被视为该点的名称在m被击中之前在*组*中播放。因此,如果点在 上 nnimap+foo.bar@gmail.com:Drafts,Gcc 将是Gcc: nnimap+foo.bar@gmail.com:Drafts(而不是foo.bar@gmail.com:[Google Mail]/Sent Mail)。如果通过 写入,如何解决此问题并将邮件存档在相应的已发送邮件文件夹中C-u m?换句话说,为什么 的Gcc设置不正确?

[这是在 Emacs 24.3.50.1、Gnus v5.13 上]

小智 5

我和你有完全相同的问题。尽管我在发送消息时添加了 gcc-self 参数为“INBOX.Sent”,但它最终以“nnfolder+archive:sent.YYYY-MM”结束

我的设置是我有一个默认帐户(家庭)和一个辅助帐户(工作)都是 imap (但不是 Gmail,希望这个答案仍然适用)

通过大量的试验和错误,我设法让它按照我想要的方式运行:工作电子邮件保存在工作发送文件夹中,家庭电子邮件保存在家庭发送文件夹中。

在 gnus-parameters 中,我只需将gcc-self参数更改为 gcc 就可以了!但是,仅适用于辅助地址。

对于我设置的默认地址gnus-message-archive-group

我的 ~/.gnus 文件的删减

(setq gnus-select-method
      '(nnimap "home"
                (nnimap-address "mail.homeaddress.com")
                (nnimap-server-port 143)
                (nnimap-stream starttls)
                (nnimap-inbox "INBOX")
                 ))

(setq gnus-secondary-select-methods
      '((nnimap "work"
                (nnimap-address "mail.workaddress.com")
                (nnimap-server-port 143)
                (nnimap-stream starttls)
                (nnimap-inbox "INBOX"))))
(setq gnus-parameters
      '(
        ("work"
         (posting-style
          (address "me@workaddress.com")
          (gcc "nnimap+work:INBOX.Sent")))))

(setq gnus-message-archive-group "nnimap:INBOX.Sent")
Run Code Online (Sandbox Code Playgroud)

posting-styles请注意,我家里没有任何东西。

我希望这有帮助。

Emacs 版本 24.3.1、Gnus v5.13