| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
You tell Gnus how to fetch mail by setting mail-sources
(see section 6.3.4.4 Fetching Mail) to a mail source specifier.
Here's an example:
(pop :server "pop3.mailserver.com" :user "myname") |
As can be observed, a mail source specifier is a list where the first element is a mail source type, followed by an arbitrary number of keywords. Keywords that are not explicitly specified are given default values.
The mail-sources is global for all mail groups. You can specify
an additional mail source for a particular group by including the
group mail specifier in mail-sources, and setting a
mail-source group parameter (see section 2.10 Group Parameters) specifying
a single mail source. When this is used, mail-sources is
typically just (group); the mail-source parameter for a
group might look like this:
(mail-source . (file :path "home/user/spools/foo.spool")) |
This means that the group's (and only this group's) messages will be fetched from the spool file `/user/spools/foo.spool'.
The following mail source types are available:
file
Keywords:
:path
MAIL
environment variable or the value of rmail-spool-directory
(usually something like `/usr/mail/spool/user-name').
:prescript
:postscript
An example file mail source:
(file :path "/usr/spool/mail/user-name") |
Or using the default file name:
(file) |
If the mail spool file is not located on the local machine, it's best to use POP or IMAP or the like to fetch the mail. You can not use ange-ftp file names here--it has no way to lock the mail spool while moving the mail.
If it's impossible to set up a proper server, you can use ssh instead.
(setq mail-sources
'((file :prescript "ssh host bin/getmail >%t")))
|
The `getmail' script would look something like the following:
#!/bin/sh # getmail - move mail from spool to stdout # flu@iki.fi MOVEMAIL=/usr/lib/emacs/20.3/i386-redhat-linux/movemail TMP=$HOME/Mail/tmp rm -f $TMP; $MOVEMAIL $MAIL $TMP >/dev/null && cat $TMP |
Alter this script to fit the `movemail' and temporary file you want to use.
directory
foo.bar. (You can change the suffix
to be used instead of .spool.) Setting
nnmail-scan-directory-mail-source-once to non-nil forces
Gnus to scan the mail source only once. This is particularly useful
if you want to scan mail groups at a specified level.
There is also the variable nnmail-resplit-incoming, if you set
that to a non-nil value, then the normal splitting process is
applied to all the files from the directory, 6.3.3 Splitting Mail.
Keywords:
:path
:suffix
:predicate
nil are returned.
The default is identity. This is used as an additional
filter--only files that have the right suffix and satisfy this
predicate are considered.
:prescript
:postscript
An example directory mail source:
(directory :path "/home/user-name/procmail-dir/"
:suffix ".prcml")
|
pop
Keywords:
:server
MAILHOST environment variable.
:port
:user
:password
:program
format-like string. Here's an example:
fetchmail %u@%s -P %p %t |
The valid format specifier characters are:
The values used for these specs are taken from the values you give the corresponding keywords.
:prescript
:program keyword. This can also be a function to be run.
:postscript
:program keyword. This can also be a function to be run.
:function
:authentication
password or the symbol apop
and says what authentication scheme to use. The default is
password.
If the :program and :function keywords aren't specified,
pop3-movemail will be used. If pop3-leave-mail-on-server
is non-nil the mail is to be left on the POP server
after fetching when using pop3-movemail. Note that POP servers
maintain no state information between sessions, so what the client
believes is there and what is actually there may not match up. If they
do not, then you may get duplicate mails or the whole thing can fall
apart and leave you with a corrupt mailbox.
Here are some examples for getting mail from a POP server. Fetch from the default POP server, using the default user name, and default fetcher:
(pop) |
Fetch from a named server with a named user and password:
(pop :server "my.pop.server"
:user "user-name" :password "secret")
|
Use `movemail' to move the mail:
(pop :program "movemail po:%u %t %p") |
maildir
Keywords:
:path
MAILDIR environment variable or
`~/Maildir/'.
:subdirs
You can also get mails from remote hosts (because maildirs don't suffer from locking problems).
Two example maildir mail sources:
(maildir :path "/home/user-name/Maildir/"
:subdirs ("cur" "new"))
|
(maildir :path "/user@remotehost.org:~/Maildir/"
:subdirs ("new"))
|
imap
Note that for the Kerberos, GSSAPI, TLS/SSL and STARTTLS support you may need external programs and libraries, See section 6.5 IMAP.
Keywords:
:server
MAILHOST environment variable.
:port
:user
:password
:stream
imap-stream-alist. Right now, this means
`gssapi', `kerberos4', `starttls', `tls',
`ssl', `shell' or the default `network'.
:authentication
imap-authenticator-alist. Right now,
this means `gssapi', `kerberos4', `digest-md5',
`cram-md5', `anonymous' or the default `login'.
:program
imap-shell-program variable. This should be a
format-like string (or list of strings). Here's an example:
ssh %s imapd |
Make sure nothing is interfering with the output of the program, e.g., don't forget to redirect the error output to the void. The valid format specifier characters are:
imap-default-user.
The values used for these specs are taken from the values you give the corresponding keywords.
:mailbox
:predicate
:fetchflag
:dontexpunge
nil, don't remove all articles marked as deleted in the
mailbox after finishing the fetch.
An example IMAP mail source:
(imap :server "mail.mycorp.com"
:stream kerberos4
:fetchflag "\\Seen")
|
webmail
NOTE: Webmail largely depends on cookies. A "one-line-cookie" patch is required for url "4.0pre.46".
WARNING: Mails may be lost. NO WARRANTY.
Keywords:
:subtype
hotmail. The
alternatives are netscape, netaddress, my-deja.
:user
:password
:dontexpunge
nil, only fetch unread articles and don't move them to
trash folder after finishing the fetch.
An example webmail source:
(webmail :subtype 'hotmail
:user "user-name"
:password "secret")
|
group
mail-source group parameter,
See section 2.10 Group Parameters.
Keywords:
:plugged
nil, fetch the mail even when Gnus is unplugged. If you
use directory source to get mail, you can specify it as in this
example:
(setq mail-sources
'((directory :path "/home/pavel/.Spool/"
:suffix ""
:plugged t)))
|
Gnus will then fetch your mail even when you are unplugged. This is useful when you use local mail and news.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |