;;; nnmail.el --- mail support functions for the Gnus mail backends
-;; Copyright (C) 1995,96 Free Software Foundation, Inc.
+;; Copyright (C) 1995,96,97 Free Software Foundation, Inc.
;; Author: Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
;; Keywords: news, mail
(require 'nnheader)
(require 'timezone)
(require 'message)
-(eval-when-compile (require 'cl))
+(require 'cl)
(require 'custom)
-(defgroup gnus-mail nil
- "Mailreading.."
+(eval-and-compile
+ (autoload 'gnus-error "gnus-util"))
+
+(defgroup nnmail nil
+ "Reading mail with Gnus."
:group 'gnus)
+(defgroup nnmail-retrieve nil
+ "Retrieving new mail."
+ :group 'nnmail)
+
+(defgroup nnmail-prepare nil
+ "Preparing (or mangling) new mail after retrival."
+ :group 'nnmail)
+
+(defgroup nnmail-duplicate nil
+ "Handling of duplicate mail messages."
+ :group 'nnmail)
+
+(defgroup nnmail-split nil
+ "Organizing the incomming mail in folders."
+ :group 'nnmail)
+
+(defgroup nnmail-files nil
+ "Mail files."
+ :group 'gnus-files
+ :group 'nnmail)
+
+(defgroup nnmail-expire nil
+ "Expiring old mail."
+ :group 'nnmail)
+
+(defgroup nnmail-procmail nil
+ "Interfacing with procmail and other mail agents."
+ :group 'nnmail)
+
+(defgroup nnmail-various nil
+ "Various mail options."
+ :group 'nnmail)
+
(defcustom nnmail-split-methods
'(("mail.misc" ""))
"Incoming mail will be split according to this variable.
The last element should always have \"\" as the regexp.
This variable can also have a function as its value."
- :group 'gnus-mail
+ :group 'nnmail-split
:type '(choice (repeat :tag "Alist" (group (string :tag "Name") regexp))
(function-item nnmail-split-fancy)
(function :tag "Other")))
(defcustom nnmail-crosspost t
"If non-nil, do crossposting if several split methods match the mail.
If nil, the first match found will be used."
- :group 'gnus-mail
+ :group 'nnmail-split
:type 'boolean)
;; Added by gord@enci.ucalgary.ca (Gordon Matzigkeit).
(defcustom nnmail-keep-last-article nil
- "If non-nil, nnmail will never delete the last expired article in a directory.
+ "If non-nil, nnmail will never delete the last expired article in a directory.
You may need to set this variable if other programs are putting
new mail into folder numbers that Gnus has marked as expired."
- :group 'gnus-mail
+ :group 'nnmail-procmail
+ :group 'nnmail-various
:type 'boolean)
(defcustom nnmail-use-long-file-names nil
"If non-nil the mail backends will use long file and directory names.
If nil, groups like \"mail.misc\" will end up in directories like
\"mail/misc/\"."
- :group 'gnus-mail
+ :group 'nnmail-files
:type 'boolean)
(defcustom nnmail-default-file-modes 384
"Set the mode bits of all new mail files to this integer."
- :group 'gnus-mail
+ :group 'nnmail-files
:type 'integer)
(defcustom nnmail-expiry-wait 7
This variable can either be a number (which will be interpreted as a
number of days) -- this doesn't have to be an integer. This variable
can also be `immediate' and `never'."
- :group 'gnus-mail
+ :group 'nnmail-expire
:type '(choice (const immediate)
(integer :tag "days")
(const never)))
((string-match \"junk\" newsgroup) 1)
((string-match \"important\" newsgroup) 'never)
(t 7))))"
- :group 'gnus-mail
+ :group 'nnmail-expire
:type '(choice (const :tag "nnmail-expiry-wait" nil)
(function :format "%v" nnmail-)))
-(defcustom nnmail-spool-file
+(defcustom nnmail-cache-accepted-message-ids nil
+ "If non-nil, put Message-IDs of Gcc'd articles into the duplicate cache."
+ :group 'nnmail
+ :type 'boolean)
+
+(defcustom nnmail-spool-file
(or (getenv "MAIL")
(concat "/usr/spool/mail/" (user-login-name)))
"Where the mail backends will look for incoming mail.
used as incoming mailboxes.
If this variable is a directory (i. e., it's name ends with a \"/\"),
treat all files in that directory as incoming spool files."
- :group 'gnus-mail
+ :group 'nnmail-files
:type 'file)
(defcustom nnmail-crash-box "~/.gnus-crash-box"
"File where Gnus will store mail while processing it."
- :group 'gnus-mail
+ :group 'nnmail-files
:type 'file)
(defcustom nnmail-use-procmail nil
"*If non-nil, the mail backends will look in `nnmail-procmail-directory' for spool files.
The file(s) in `nnmail-spool-file' will also be read."
- :group 'gnus-mail
+ :group 'nnmail-procmail
:type 'boolean)
(defcustom nnmail-procmail-directory "~/incoming/"
"*When using procmail (and the like), incoming mail is put in this directory.
The Gnus mail backends will read the mail from this directory."
- :group 'gnus-mail
+ :group 'nnmail-procmail
:type 'directory)
(defcustom nnmail-procmail-suffix "\\.spool"
"*Suffix of files created by procmail (and the like).
This variable might be a suffix-regexp to match the suffixes of
several files - eg. \".spool[0-9]*\"."
- :group 'gnus-mail
+ :group 'nnmail-procmail
:type 'regexp)
(defcustom nnmail-resplit-incoming nil
"*If non-nil, re-split incoming procmail sorted mail."
- :group 'gnus-mail
+ :group 'nnmail-procmail
:type 'boolean)
(defcustom nnmail-delete-file-function 'delete-file
"Function called to delete files in some mail backends."
- :group 'gnus-mail
+ :group 'nnmail-files
:type 'function)
-(defcustom nnmail-crosspost-link-function 'add-name-to-file
+(defcustom nnmail-crosspost-link-function
+ (if (string-match "windows-nt\\|emx" (format "%s" system-type))
+ 'copy-file
+ 'add-name-to-file)
"Function called to create a copy of a file.
This is `add-name-to-file' by default, which means that crossposts
will use hard links. If your file system doesn't allow hard
links, you could set this variable to `copy-file' instead."
- :group 'gnus-mail
+ :group 'nnmail-files
:type '(radio (function-item add-name-to-file)
(function-item copy-file)
(function :tag "Other")))
This can also be