Gnus:如何根据他们写的帐户存档电子邮件? [gcc-self未按预期工作]

时间:2013-04-08 20:28:17

标签: emacs gnus

我有两个邮件帐户,foo.bar@uni.edufoo.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")
    ))

但是没有设置Gcc(新消息没有Gcc;这里有任何解决方案吗?)。因此我回到(setq gnus-message-archive-group "nnimap+foo.bar@uni.edu:Sent Items")设置了Gcc 正确(对于主帐户foo.bar@uni.edu)如果我通过m在* Group *中打开新邮件。

然后,我尝试通过gcc-self使用gnus-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"))))

手册(http://www.gnus.org/manual/gnus_28.html)表示如果是gcc-self 一个字符串,它只是简单地插入Gcc标题。我做了以下 体验:无论我通过C-u m(使用m,Gcc在*群组*中开始新消息 是“nnimap+foo.bar@uni.edu:如前所述的已发送物品”,Gcc被认为是 在m被击中之前,该点在* Group *中的名称。所以,如果重点是 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]

2 个答案:

答案 0 :(得分:3)

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

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

经过大量的反复试验,我设法让它按照我的意愿运作:工作电子邮件保存在工作发送文件夹中,家庭电子邮件保存在家庭发送文件夹中。

在gnus-parameters中我只是将我的gcc-self param更改为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")

请注意,我家里没有posting-styles

我希望这会有所帮助。

Emacs Version 24.3.1,Gnus v5.13

答案 1 :(得分:0)

我在安装Gnus时遇到了同样的问题。我将Gmail用于个人资料,将Outlook用于工作环境。我的目标是使用我目前在Gnus中使用的相应帐户来撰写/回复邮件。根据{{​​3}}的建议,我设法使用#!/usr/bin/env scalas /*** scalaVersion := "2.12.6" libraryDependencies += "org.scala-lang.modules" %% "scala-swing" % "2.1.1" */ import scala.swing._ // creates object but doesn't run anything object FirstSwingApp extends SimpleSwingApplication { def top = new MainFrame { title = "First Swing App" contents = new Button { text = "Click me" } } } FirstSwingApp.main(new Array[String](0)) // run main manually, or whatever you prefer 实现了这一目标。这是我使用的示例代码。

gnus-posting-styles

;; Archive outgoing email in Sent folder on imap.gmail.com (setq gnus-message-archive-method '(nnimap "imap.gmail.com") gnus-message-archive-group "[Gmail]/Sent Mail") ;; Set return email address based on incoming email address (setq gnus-posting-styles `((".*" (address "foo.bar@gmail.com") (name "Foo Bar") ("X-Message-SMTP-Method" "smtp smtp.gmail.com 587 foo.bar@gmail.com") ) ("^nnimap[+]outlook:.*" (address "foo.bar@outlook.com") (name "Foo Bar") ("X-Message-SMTP-Method" "smtp smtp-mail.outlook.com 587 foo.bar@outlook.com") (gcc "\"nnimap+outlook:Sent Items\"") ) ) ) gnus-message-archive-method设置了默认的存档行为,该行为将邮件存档到我的Gmail gnus-message-archive-group文件夹中。当我使用Outlook帐户时,Sent中的gcc标记指示Gnus将邮件存档到我的Outlook gnus-posting-styles文件夹中。我还受益于根据使用Sent标签处理的电子邮件帐户自动选择外发邮件服务器的好处。 Outlook似乎在每次发送邮件时都会自动将邮件存档到X-message-SMTP-Method文件夹中,因此我在实际设置中使用了Sent来避免重复。您当然可以将Outlook更改为所使用的任何邮件服务。

相关问题