Gnus with maildir:回复标头中的奇怪字段

发布于 2024-12-03 11:53:27 字数 3416 浏览 0 评论 0原文

我正在使用 Gnus 和 Offlineimap 来阅读 GMail。 Offlineimap 从 GMail 获取邮件并将其存储在我本地计算机上的 Maildir 文件夹中,位置为 /mnt/Mail/ 。我将 Gnus 指向这些文件夹,它从那里读取邮件并将其显示给我。

当我尝试回复邮件时(当光标位于摘要缓冲区中的邮件主题上时键入“r”)时,我遇到以下问题:

(i) “Fcc:”字段填充了不存在的目录,并且我被告知该目录不存在(它不存在)。系统还会提示我是否要创建此目录作为新的 maildir 目录:

/mnt/Mail/sent 不是邮件目录。创建它? (是或否)

由于我不想保存已发送邮件的本地副本(因为 Gmail SMTP 和 IMAP 无论如何都会为我获取它),因此在继续之前我必须始终说“不”。当每次都发生这种情况时,这是一个巨大的不便。

如何摆脱此字段?不想以这种方式将已发送的邮件保存在本地计算机上的任何位置。

我已在我的 .gnus 文件中尝试了以下设置,但无济于事:

(setq gnus-author-copy nil) (setq gnus-author-copy-saver nil)

..

(setq mail-yank-ignored-headers "Fcc:")

(ii) 邮件标头中有一个“References:”字段,内容如下:

参考文献:<[电子邮件受保护]>

如何去掉这个字段?这看起来很难看,而且在普通电子邮件中毫无用处。

(iii) 邮件标头中的“发件人:”字段指的是我的本地计算机:

来自:G Philip <[电子邮件受保护]>

我每次都必须编辑此字段,以便它包含我正确的电子邮件 地址。

由于我在 gmail 帐户中使用了几个电子邮件地址,因此我在 .gnus 文件中尝试了以下操作,以使此字段使用我要回复的电子邮件的“收件人:”地址,但这两种方法都不起作用:

(setq 消息-替代-电子邮件 (regexp-opt '("[电子邮件受保护]" "[电子邮件受保护]")))

..

(setq gnus-posting-styles '(((标题“至”“myfirstaddress gmail.com”) (地址“myfirstaddress gmail.com”)) ((标头“至”“myotheraddress gmail.com”) (地址“myotheraddress gmail.com”))))

如何设置才能使“发件人:”字段自动填充原始电子邮件的“收件人:”字段?

我的 . gnus 文件如下所示:

;;使用Gnus从offlineimap同步的本地目录中读取gmail

(setq gnus-select-method

 '(nnmaildir“Gmail”

             (目录“/mnt/Mail”)

             (永不过期)))

;;不要隐藏已读电子邮件

(setq gnus-fetch-old-headers t)

;;按日期排序,最新的排在前面。

(setq gnus-thread-sort-functions

 '(gnus 线程按编号排序

         gnus 线程按最近日期排序))

;;不要每次都寻找新的“群体”。

(setq gnus-check-new-newsgroups nil)

;;使用更好(但更慢)的函数来提取信息

;;来自邮件标头。

(setq gnus-extract-address-components

 '邮件提取地址组件)

;;使用 gmail SMTP 服务器发送电子邮件。

(setq 发送邮件函数 'smtpmail-send-it

 消息发送邮件功能 'smtpmail-send-it

  smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil))

  smtpmail-auth-credentials '(("smtp.gmail.com" 587 "[电子邮件受保护]" nil))

  smtpmail-默认-smtp-服务器“smtp.gmail.com”

  smtpmail-smtp-服务器“smtp.gmail.com”

  smtpmail-smtp-服务 587

  smtpmail-调试信息 t

  smtpmail-本地域“gmail.com”)

I am using Gnus with Offlineimap to read GMail. Offlineimap fetches the mail from GMail and stores in in Maildir folders on my local machine at /mnt/Mail/ . I point Gnus to these folders, from where it reads the mail and displays it to me.

When I try to reply to a mail (by typing 'r' when the cursor is on the mail's subject in the Summary buffer), I get the following problems:

(i) The "Fcc:" field is populated with a non-existant directory, and I am told that this directory does not exist (it does not). I am also prompted whether I want to create this directory as a new maildir directory:

/mnt/Mail/sent is not a maildir. Create it? (y or n)

Since I don't want to save a local copy of the sent message (because Gmail SMTP and IMAP will get it for me anyway), I have to always say "no" before proceeding. This is a huge inconvenience when it happens every time.

How do I get rid of this field? I do not want to save sent mails anywhere on my local machine in this manner.

I have tried the following settings in my .gnus file, but to no avail:

(setq gnus-author-copy nil)
(setq gnus-author-copy-saver nil)

..

(setq mail-yank-ignored-headers "Fcc:")

(ii) There is a "References:" field in the message header which says something like:

References: <[email protected]>

How do I get rid of this field? This looks ugly, and quite useless in normal emails.

(iii) The "From:" field in the message header refers to my local machine:

From: G Philip <[email protected]>

I have to edit this field also every time so that it contains my proper email
address.

Since I use a couple of email addresses with my gmail account, I have tried the following in my .gnus file to get this field to use the "To:" address of the email to which I am replying, but neither approach works:

(setq message-alternative-emails
(regexp-opt '("[email protected]" "[email protected]")))

..

(setq gnus-posting-styles
'(((header "to" "myfirstaddress gmail.com")
(address "myfirstaddress gmail.com"))
((header "to" "myotheraddress gmail.com")
(address "myotheraddress gmail.com"))))

How do I set things up so that the "From:" field automatically gets filled with the "To:" field of the original email?

My .gnus file looks like this:

;; Use Gnus to read gmail from the local directory to which offlineimap syncs

(setq gnus-select-method

 '(nnmaildir "Gmail"

             (directory "/mnt/Mail")

             (expire-age never)))

;; Don't hide read email

(setq gnus-fetch-old-headers t)

;; Sort by date, newest first.

(setq gnus-thread-sort-functions

       '(gnus-thread-sort-by-number

         gnus-thread-sort-by-most-recent-date))

;; Do not look for new "groups" every time.

(setq gnus-check-new-newsgroups nil)

;; Use the better (but slower) function to extract information

;; from mail headers.

(setq gnus-extract-address-components

 'mail-extract-address-components)

;; Use the gmail SMTP server to send email.

(setq send-mail-function 'smtpmail-send-it

  message-send-mail-function 'smtpmail-send-it

  smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil))

  smtpmail-auth-credentials '(("smtp.gmail.com" 587 "[email protected]" nil))

  smtpmail-default-smtp-server "smtp.gmail.com"

  smtpmail-smtp-server "smtp.gmail.com"

  smtpmail-smtp-service 587

  smtpmail-debug-info t

  smtpmail-local-domain "gmail.com")

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

意中人 2024-12-10 11:53:27

嗯,(ii) 很容易。您可以通过将任何标头添加到 gnus-ignored-headers 来隐藏它(或者通过将其从 gnus-visible-headers 中删除,如果有的话)。请参阅http://www.gnus.org/manual/gnus_142.html#SEC142

(iii) 如果我正确理解了这个问题,也可能很容易。您是在谈论您发送的消息中的“发件人”字段吗?如果是这样,则将 user-mail-address 设置为您想要默认使用的任何值,Gnus 就不必根据您的用户名和计算机的主机名进行猜测。

Well, (ii) is easy enough. You can hide any header by adding it to gnus-ignored-headers (or by removing it from gnus-visible-headers, if it's there). See http://www.gnus.org/manual/gnus_142.html#SEC142

(iii) may also be easy, if I understand the question correctly. Are you talking about the From field in a message that you are sending? If so, then set user-mail-address to whatever value you want to use by default and Gnus won't have to guess based on your username and your machine's hostname.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文