0

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: <87ty8n1qbz.fsf@mylocalmachine.localdomain>

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 <gphilip@mylocalmachine.localdomain>

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 '("myfirstaddress@gmail.com" "myotheraddress@gmail.com")))

..

(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 "myemailaddress@gmail.com" 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")
gphilip
  • 399
  • 1
  • 2
  • 11

1 Answers1

0

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.

db48x
  • 3,108
  • 24
  • 16
  • Thank you, but this is already the case: gnus-visible-headers is non-nil: "^From:\\|^Newsgroups:\\|^Subject:\\|^Date:\\|^Followup-To:\\|^Reply-To:\\|^Organization:\\|^Summary:\\|^Keywords:\\|^To:\\|^[BGF]?Cc:\\|^Posted-To:\\|^Mail-Copies-To:\\|^Mail-Followup-To:\\|^Apparently-To:\\|^Gnus-Warning:\\|^Resent-From:\\|^X-Sent:" , and, FWIW, gnus-ignored-headers contains a reference to "References" : ("^Path:" "^Expires:" "^Date-Received:" "^References:" "^Xref:" ...) But that doesn't seem to deter gnus! – gphilip Sep 08 '11 at 16:00
  • `gnus-ignored-headers` should be a single string containing a regex, the same style as `gnus-visible-headers`. However, this doesn't matter because `gnus-ignored-headers` is only used if `gnus-visible-headers` is nil. You might double-check the value of `gnus-visible-headers` by going to your message buffer and doing `C-h v gnus-visible-headers`. That'll show you the current value (as well as the documentation for the variable). – db48x Sep 08 '11 at 17:29
  • Double-checking the value of `gnus-visible-headers` in the manner you suggested gave the exact same result as before. I have resigned to deleting the pesky `Fcc:` field every time. – gphilip Oct 02 '11 at 14:49