aboutsummaryrefslogtreecommitdiffstats
path: root/doc/misc
diff options
context:
space:
mode:
authorKenichi Handa2012-02-17 16:33:15 +0900
committerKenichi Handa2012-02-17 16:33:15 +0900
commit48dd1e399f41aa349e8651d049cb4a707ffd0bb0 (patch)
tree54a1d0b537b697ca2cb0bb420d125eafbbbb534c /doc/misc
parentc406be4337317c4ff4e60dc74a10921bd1102cac (diff)
parentbcc657043df41514ec80c3e172c6872b88221005 (diff)
downloademacs-48dd1e399f41aa349e8651d049cb4a707ffd0bb0.tar.gz
emacs-48dd1e399f41aa349e8651d049cb4a707ffd0bb0.zip
merge trunk
Diffstat (limited to 'doc/misc')
-rw-r--r--doc/misc/ChangeLog5
-rw-r--r--doc/misc/smtpmail.texi211
2 files changed, 124 insertions, 92 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index adad93ef89c..a88ac5f0bd4 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,8 @@
12012-02-15 Glenn Morris <rgm@gnu.org>
2
3 * smtpmail.texi (Emacs Speaks SMTP): General update for 24.1.
4 (Encryption): New chapter, split out from previous.
5
12012-02-13 Lars Ingebrigtsen <larsi@gnus.org> 62012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
2 7
3 * gnus.texi (Customizing the IMAP Connection): Mention 8 * gnus.texi (Customizing the IMAP Connection): Mention
diff --git a/doc/misc/smtpmail.texi b/doc/misc/smtpmail.texi
index af09783f445..4e4df3f0bbb 100644
--- a/doc/misc/smtpmail.texi
+++ b/doc/misc/smtpmail.texi
@@ -47,6 +47,7 @@ developing GNU and promoting software freedom.''
47* How Mail Works:: Brief introduction to mail concepts. 47* How Mail Works:: Brief introduction to mail concepts.
48* Emacs Speaks SMTP:: How to use the SMTP library in Emacs. 48* Emacs Speaks SMTP:: How to use the SMTP library in Emacs.
49* Authentication:: Authenticating yourself to the server. 49* Authentication:: Authenticating yourself to the server.
50* Encryption:: Protecting your connection to the server.
50* Queued delivery:: Sending mail without an internet connection. 51* Queued delivery:: Sending mail without an internet connection.
51* Server workarounds:: Mail servers with special requirements. 52* Server workarounds:: Mail servers with special requirements.
52* Debugging:: Tracking down problems. 53* Debugging:: Tracking down problems.
@@ -129,24 +130,37 @@ be useful if you don't have a MTA set up on your host, or if your
129machine is often disconnected from the internet. 130machine is often disconnected from the internet.
130 131
131 Sending mail via SMTP requires configuring your mail user agent 132 Sending mail via SMTP requires configuring your mail user agent
132(@pxref{Mail Methods,,,emacs}) to use the SMTP library. How to do 133(@pxref{Mail Methods,,,emacs}) to use the SMTP library. If you
133this should be described for each mail user agent; for the default 134have not configured anything, then in Emacs 24.1 and later the first
134mail user agent the variable @code{send-mail-function} (@pxref{Mail 135time you try to send a mail Emacs will ask how you want to send
135Sending,,,emacs}) is used; for the Message and Gnus user agents the 136mail. To use this library, answer @samp{smtp} when prompted. Emacs
136variable @code{message-send-mail-function} (@pxref{Mail 137then asks for the name of the SMTP server.
137Variables,,,message}) is used. 138
138 139 If you prefer, or if you are using a non-standard mail user agent,
139@example 140you can configure this yourself. The normal way to do this is to set
140;; If you use the default mail user agent. 141the variable @code{send-mail-function} (@pxref{Mail
142Sending,,,emacs}) to the value you want to use. To use this library:
143
144@smallexample
141(setq send-mail-function 'smtpmail-send-it) 145(setq send-mail-function 'smtpmail-send-it)
142;; If you use Message or Gnus. 146@end smallexample
143(setq message-send-mail-function 'smtpmail-send-it) 147
144@end example 148@noindent
149The default value for this variable is @code{sendmail-query-once},
150which interactively asks how you want to send mail.
151
152Your mail user agent might use a different variable for this purpose.
153It should inherit from @code{send-mail-function}, but if it does not,
154or if you prefer, you can set that variable directly. Consult your
155mail user agent's documentation for more details. For example,
156(@pxref{Mail Variables,,,message}).
145 157
146 Before using SMTP you must find out the hostname of the SMTP server 158 Before using SMTP you must find out the hostname of the SMTP server
147to use. Your system administrator should provide you with this 159to use. Your system administrator or mail service provider should
148information, but often it is the same as the server you receive mail 160supply this information. Often it is some variant of the server you
149from. 161receive mail from. If your email address is
162@samp{yourname@@example.com}, then the name of the SMTP server is
163may be something like @samp{smtp.example.com}.
150 164
151@table @code 165@table @code
152@item smtpmail-smtp-server 166@item smtpmail-smtp-server
@@ -201,101 +215,114 @@ The following example illustrates what you could put in
201@node Authentication 215@node Authentication
202@chapter Authentication 216@chapter Authentication
203 217
218@cindex password
219@cindex user name
220Most SMTP servers require clients to authenticate themselves before
221they are allowed to send mail. Authentication usually involves
222supplying a user name and password.
223
224If you have not configured anything, then the first time you try to
225send mail via a server, Emacs (version 24.1 and later) prompts you
226for the user name and password to use, and then offers to save the
227information. By default, Emacs stores authentication information in
228a file @file{~/.authinfo}.
229
230@cindex authinfo
231The basic format of the @file{~/.authinfo} file is one line for each
232set of credentials. Each line consists of pairs of variables and
233values. A simple example would be:
234
235@smallexample
236machine mail.example.org port 25 login myuser password mypassword
237@end smallexample
238
239@noindent
240This specifies that when using the SMTP server called @samp{mail.example.org}
241on port 25, Emacs should send the user name @samp{myuser} and the
242password @samp{mypassword}. Either or both of the login and password
243fields may be absent, in which case Emacs prompts for the information
244when you try to send mail. (This replaces the old
245@code{smtpmail-auth-credentials} variable used prior to Emacs 24.1.)
246
247@vindex smtpmail-smtp-user
248 When the SMTP library connects to a host on a certain port, it
249searches the @file{~/.authinfo} file for a matching entry. If an
250entry is found, the authentication process is invoked and the
251credentials are used. If the variable @code{smtpmail-smtp-user} is
252set to a non-@code{nil} value, then only entries for that user are
253considered. For more information on the @file{~/.authinfo}
254file, @pxref{Top,,auth-source, auth, Emacs auth-source Library}.
255
204@cindex SASL 256@cindex SASL
205@cindex CRAM-MD5 257@cindex CRAM-MD5
258@cindex PLAIN
206@cindex LOGIN 259@cindex LOGIN
260The process by which the SMTP library authenticates you to the server
261is known as ``Simple Authentication and Security Layer'' (SASL).
262There are various SASL mechanisms, and this library supports three of
263them: CRAM-MD5, PLAIN, and LOGIN. It tries each of them, in that order,
264until one succeeds. The first uses a form of encryption to obscure
265your password, while the other two do not.
266
267
268@node Encryption
269@chapter Encryption
270
207@cindex STARTTLS 271@cindex STARTTLS
208@cindex TLS 272@cindex TLS
209@cindex SSL 273@cindex SSL
210Many environments require SMTP clients to authenticate themselves 274For greater security, you can encrypt your connection to the SMTP
211before they are allowed to route mail via a server. The two following 275server. If this is to work, both Emacs and the server must support it.
212variables contains the authentication information needed for this. 276
213 277The SMTP library supports the ``Transport Layer Security'' (TLS), and
214The first variable, @code{smtpmail-auth-credentials}, instructs the 278the older ``Secure Sockets Layer'' (SSL) encryption mechanisms.
215SMTP library to use a SASL authentication step, currently only the 279It also supports STARTTLS, which is a variant of TLS in which the
216CRAM-MD5 and LOGIN mechanisms are supported and will be selected in 280initial connection to the server is made in plain text, requesting a
217that order if the server support both. 281switch to an encrypted channel for the rest of the process.
218 282
219The second variable, @code{smtpmail-starttls-credentials}, instructs 283@vindex smtpmail-stream-type
220the SMTP library to connect to the server using STARTTLS. This means 284The variable @code{smtpmail-stream-type} controls what form of
221the protocol exchange may be integrity protected and confidential by 285connection the SMTP library uses. The default value is @code{nil},
222using the Transport Layer Security (TLS) protocol, and optionally also 286which means to use a plain connection, but try to switch to a STARTTLS
223authentication of the client and server. 287encrypted connection if the server supports it. Other possible values
224 288are: @code{starttls} - insist on STARTTLS; @code{ssl} - use TLS/SSL;
225TLS is a security protocol that is also known as SSL, although 289and @code{plain} - no encryption.
226strictly speaking, SSL is an older variant of TLS. TLS is backwards 290
227compatible with SSL. In most mundane situations, the two terms are 291Use of any form of TLS/SSL requires support in Emacs. You can either
228equivalent. 292use the built-in support (in Emacs 24.1 and later), or the
229 293@file{starttls.el} Lisp library. The built-in support uses the GnuTLS
230The TLS feature uses the elisp package @file{starttls.el} (see it for 294@footnote{@url{http://www.gnu.org/software/gnutls/}} library.
231more information on customization), which in turn require that at 295If your Emacs has GnuTLS support built-in, the function
232least one of the following external tools are installed: 296@code{gnutls-available-p} is defined and returns non-@code{nil}.
297Otherwise, you must use the @file{starttls.el} library (see that file for
298more information on customization options, etc.). The Lisp library
299requires one of the following external tools to be installed:
233 300
234@enumerate 301@enumerate
235@item 302@item
236The GnuTLS command line tool @samp{gnutls-cli}, you can get it from 303The GnuTLS command line tool @samp{gnutls-cli}, which you can get from
237@url{http://www.gnu.org/software/gnutls/}. This is the recommended 304@url{http://www.gnu.org/software/gnutls/}. This is the recommended
238tool, mainly because it can verify the server certificates. 305tool, mainly because it can verify server certificates.
239 306
240@item 307@item
241The @samp{starttls} external program, you can get it from 308The @samp{starttls} external program, which you can get from
242@file{starttls-*.tar.gz} from @uref{ftp://ftp.opaopa.org/pub/elisp/}. 309@file{starttls-*.tar.gz} from @uref{ftp://ftp.opaopa.org/pub/elisp/}.
243@end enumerate 310@end enumerate
244 311
245It is not uncommon to use both these mechanisms, e.g., to use STARTTLS 312@cindex certificates
246to achieve integrity and confidentiality and then use SASL for client 313@cindex keys
247authentication. 314The SMTP server may also request that you verify your identity by
315sending a certificate and the associated encryption key to the server.
316If you need to do this, you can use an @file{~/.authinfo} entry like this:
248 317
249@table @code 318@smallexample
250@item smtpmail-auth-credentials 319machine mail.example.org port 25 key "~/.my_smtp_tls.key" cert "~/.my_smtp_tls.cert"
251@vindex smtpmail-auth-credentials 320@end smallexample
252 The variable @code{smtpmail-auth-credentials} contains a list of
253hostname, port, username and password tuples. When the SMTP library
254connects to a host on a certain port, this variable is searched to
255find a matching entry for that hostname and port. If an entry is
256found, the authentication process is invoked and the credentials are
257used.
258
259The hostname field follows the same format as
260@code{smtpmail-smtp-server} (i.e., a string) and the port field the
261same format as @code{smtpmail-smtp-service} (i.e., a string or an
262integer). The username and password fields, which either can be
263@code{nil} to indicate that the user is prompted for the value
264interactively, should be strings with the username and password,
265respectively, information that is normally provided by system
266administrators.
267
268@item smtpmail-starttls-credentials
269@vindex smtpmail-starttls-credentials
270 The variable @code{smtpmail-starttls-credentials} contains a list of
271tuples with hostname, port, name of file containing client key, and
272name of file containing client certificate. The processing is similar
273to the previous variable. The client key and certificate may be
274@code{nil} if you do not wish to use client authentication.
275@end table
276 321
277The following example illustrates what you could put in 322@noindent
278@file{~/.emacs} to enable both SASL authentication and STARTTLS. The 323(This replaces the old @code{smtpmail-starttls-credentials} variable used
279server name (@code{smtpmail-smtp-server}) is @var{hostname}, the 324prior to Emacs 24.1.)
280server port (@code{smtpmail-smtp-service}) is @var{port}, and the
281username and password are @var{username} and @var{password}
282respectively.
283 325
284@example
285;; Authenticate using this username and password against my server.
286(setq smtpmail-auth-credentials
287 '(("@var{hostname}" "@var{port}" "@var{username}" "@var{password}")))
288
289;; Note that if @var{port} is an integer, you must not quote it as a
290;; string. Normally @var{port} should be the integer 25, and the example
291;; become:
292(setq smtpmail-auth-credentials
293 '(("@var{hostname}" 25 "@var{username}" "@var{password}")))
294
295;; Use STARTTLS without authentication against the server.
296(setq smtpmail-starttls-credentials
297 '(("@var{hostname}" "@var{port}" nil nil)))
298@end example
299 326
300@node Queued delivery 327@node Queued delivery
301@chapter Queued delivery 328@chapter Queued delivery