Ok, I redid chapter 5 of the FAQ, moving the general mail section to the
beginning and incorporating the non-VM- and non-GNUS-specific questions. I
also rewrote the movemail questions using your text. Could you look over
this? Also, could you help me with Q5.0.1 and Q5.0.2, which are partially
unwritten? The current version of the relevant questions is attached.
@node Q5.0.8, Q5.0.9, Q5.0.7, Internet
@unnumberedsubsec Q5.0.8: An MUA gets an error incorporating new mail.
rmail and VM, and probably other MUA's as well, get new mail from
your mailbox (called @file{/var/mail/$USER} or @file{/var/spool/mail/$USER}
or something similar) using a program called @code{movemail}.
This program interlocks with @code{/bin/mail} using the protocol
defined by @code{/bin/mail}.
There are various different protocols in general use, which you need to
specify using the @samp{--mail-locking} option to @file{configure}:
@table @samp
@item lockf
POSIX file locking with @code{lockf()}
@item flock
BSD file locking with @code{flock()}
@item dot
To manipulate mail file @file{foo}, first create file @file{foo.lock}
@item locking
Use @code{locking()}, Microsoft's renamed @code{flock()}
@item mmdf
Use @code{lk_open()} and @code{lk_close()} as defined by the Multi-channel
Memo Distribution Facility
@item pop
Retrieve mail using POP (the Post Office Protocol). This is the
default for Cygwin/MinGW.
@end itemize
@strong{IF YOU DON'T USE THE FORM OF INTERLOCKING THAT IS NORMAL ON YOUR
SYSTEM, YOU CAN LOSE MAIL!}
Usually the value is correctly determined automatically:
@file{configure} tries to detect the method in use, and defaults exist
on systems for which this doesn't work.
However, if you run into problems incorporating new mail, it may be
because an incorrect method is being used.
If your system uses the lock file protocol, and permissions are set
so that ordinary users cannot write lock files in the mail spool
directory, you may need to make @file{movemail} setgid to a
suitable group such as @samp{mail}. You can use these commands (as
root):
@example
chgrp mail movemail
chmod 2755 movemail
@end example
If you are using the @samp{pop} locking method, @file{movemail} must
be setuid root.
Installation normally copies movemail from the build directory to an
installation directory which is usually under @file{/usr/local/lib}.
The installed copy of @file{movemail} is usually in the directory
@file{/usr/local/lib/xemacs-VERSION/TARGET} (for example,
@file{/usr/local/lib/xemacs-21.4.15/i686-pc-cygwin}). You must change
the group and mode of the installed copy; changing the group and mode
of the build directory copy is ineffective.
@node Q5.0.9, Q5.0.10, Q5.0.8, Internet
@unnumberedsubsec Q5.0.9: Why isn't @file{movemail} working?
@xref{Q5.0.8}.
Note also that older versions of Mozilla came with a @file{movemail}
program that is @strong{not} compatible with XEmacs. Do not use it.
Always use the @file{movemail} installed with your XEmacs. Failure to
do so can result in lost mail.
@node Q5.0.1, Q5.0.2, Internet, Internet
@unnumberedsubsec Q5.0.1: What are the various packages for reading mail?
#### Write me.
@node Q5.0.2, Q5.0.3, Q5.0.1, Internet
@unnumberedsubsec Q5.0.2: How can I send mail?
Under Unix and Mac OS X, the @samp{sendmail} package is normally used
for this.
#### Write me.
Under Windows, you need to use @samp{smtpmail}, which communicates
directly with the mail server, as there is no @file{sendmail} program
running. To get it working, use code like the following in your
@file{init.el} file:
@lisp
;; Get mail working under Windows.
(setq message-send-mail-function 'smtpmail-send-it) ; for message/Gnus
(setq send-mail-function 'smtpmail-send-it) ; for C-x m, etc.
;; the following ensures that mail problems can be debugged: it logs a
trace
;; of the SMTP conversation to *trace of SMTP session to <somewhere>*.
(setq smtpmail-debug-info t)
;; Substitute your info here.
;(setq user-mail-address "ben@(a)xemacs.org")
;(setq user-full-name "Ben Wing")
;(setq smtpmail-default-smtp-server "smtp.myserver.myisp.com")
;; The following two aren't completely necessary but may help.
;(setq smtpmail-local-domain "666.com")
;(setq smtpmail-sendto-domain "666.com")
;; If your SMTP server requires a username/password to authenticate, as
;; many do nowadays, set them like this:
;(setq smtpmail-auth-credentials ; or use ~/.authinfo
; '(("smtp.myserver.myisp.com" 25 "USER@@SOMEWHERE"
"PASSWORD")))
;; Other possibilities for getting smtpmail to work:
;;
;; If for some reason you need to authenticate using the STARTTLS
protocol
;; (don't look into this unless you know what it is), use
;; (setq smtpmail-starttls-credentials
;; '(("YOUR SMTP HOST" 25 "~/.my_smtp_tls.key"
"~/.my_smtp_tls.cert")))
;; Requires external program
;;
ftp://ftp.opaopa.org/pub/elisp/starttls-*.tar.gz.
;; See
http://www.ietf.org/rfc/rfc2246.txt,
;;
http://www.ietf.org/rfc/rfc2487.txt
@end lisp
The lines you need to care about are those that set
@code{user-mail-address}, @code{user-full-name},
@code{smtpmail-default-smtp-server}, and
@code{smtpmail-auth-credentials}. You need to set these with,
respectively, your email address, your full name, the SMTP server you
use for outgoing mail, and the username and password you need to log
in to your SMTP server. (If for some reason your SMTP server doesn't
require logging in to send mail, don't uncomment this last line.)
The other settings may be useful in specific cases, but you should know what
you're doing before enabling them.