Eli Zaretskii
a7183d7c46
Rmail: support citations with non-ASCII letters in names
...
lisp/mail/rmail.el (rmail-font-lock-keywords): Accept non-ASCII
letters in cite-prefix.
2012-01-04 20:51:47 +02:00
Eli Zaretskii
8d43f3cd8a
Decode message headers of non-MIME messages in Rmail.
...
lisp/mail/rmail.el (rmail-show-message-1): Decode any RFC2047 encoded
headers of non-MIME messages, when rmail-enable-mime is non-nil.
2011-12-31 12:06:21 +02:00
Glenn Morris
59ff373bd6
Auto-commit of loaddefs files.
2011-12-19 06:21:17 -05:00
Eli Zaretskii
2ce2526364
Commit auto-generated files.
2011-12-10 15:48:35 +02:00
Glenn Morris
82727ea451
Auto-commit of loaddefs files.
2011-11-24 06:24:59 -05:00
Glenn Morris
17fe5af5b3
Auto-commit of loaddefs files.
2011-11-23 06:20:43 -05:00
Glenn Morris
9aac4de2aa
Doc fixes related to rmail-automatic-folder-directives.
...
* mail/rmail.el (rmail-message-filter, rmail-auto-file): Doc fixes.
(rmail-auto-file): Ignore case in the "special" field names,
as mail-fetch-field does for all others.
2011-11-23 00:29:08 -08:00
Glenn Morris
8038d2d290
Rmail trivia: give explicit errors for empty folders.
...
* mail/rmail.el (rmail-forward):
* mail/rmailkwd.el (rmail-set-label):
* mail/rmailout.el (rmail-output, rmail-output-as-seen)
(rmail-output-body-to-file): Give error if no message.
Fixes: debbugs:10082
2011-11-22 23:41:17 -08:00
Glenn Morris
f3fe222a82
* lisp/mail/rmail.el (rmail-current-message): Doc fix.
2011-11-22 23:31:39 -08:00
Glenn Morris
50419064d4
* lisp/mail/rmail.el (rmail-message-filter): Mark as obsolete.
...
* etc/NEWS: Mention this.
Fixes: debbugs:2624
2011-11-22 23:17:48 -08:00
Glenn Morris
b5afc20930
Auto-commit of loaddefs files.
2011-11-22 06:35:26 -05:00
Glenn Morris
09f5d05492
Auto-commit of loaddefs files.
2011-11-20 06:27:56 -05:00
Juanma Barranquero
cd1181dbec
Fix typos.
2011-11-20 04:48:53 +01:00
Glenn Morris
7fb18e9ef9
Small rmail fixes.
...
* lisp/mail/rmail.el (rmail-enable-mime-composing): Make it a defcustom.
(rmail-insert-mime-forwarded-message-function, rmail-mime-feature):
Doc fixes.
(rmail-decode-mime-charset): Mark as obsolete.
* lisp/mail/rmailsum.el (rmail-message-regexp-p-1):
* lisp/mail/rmail.el (rmail-search-message, rmail-forward, rmail-resend):
Before using mime functions, check they are set.
Fixes: debbugs:10077
2011-11-19 18:23:48 -08:00
Glenn Morris
110490118e
Auto-commit of loaddefs files.
2011-11-16 06:22:17 -05:00
Chong Yidong
ce7ddba001
* autoconf.el (autoconf-mode): Fix comment-start-skip regexp.
...
Fixes: debbugs:10033
2011-11-16 11:17:29 +08:00
Glenn Morris
dcecfb4cb4
Auto-commit of loaddefs files.
2011-11-15 06:23:14 -05:00
Glenn Morris
45261b503c
Small rmail and rmailmm changes, many doc fixes.
...
* lisp/mail/rmail.el (rmail-file-coding-system): It's only ever used
in a boolean sense, so just make it a boolean, and fix the doc.
(rmail-show-mime-function, rmail-mime-feature)
(rmail-require-mime-maybe): Doc fixes.
(rmail-show-message-1): Check rmail-show-mime-function is non-nil.
* lisp/mail/rmailmm.el (rmail-show-mime): Doc fix.
2011-11-15 00:23:03 -08:00
Juanma Barranquero
0b381c7eb8
Fix typos.
2011-11-14 22:00:24 +01:00
Paul Eggert
8350f087ef
Spelling fixes.
2011-11-14 12:23:26 -08:00
Glenn Morris
a9a75fac5e
Auto-commit of loaddefs files.
2011-11-14 12:45:14 -05:00
Glenn Morris
d3cfca6027
* lisp/mail/rmail.el (rmail-no-mail-p): Remove mode-line N/M indicator.
2011-11-13 18:01:00 -08:00
Mark Lillibridge
3c6702ef8a
Fix rmail-mbox handling of terminating newlines.
...
* lisp/mail/rmail.el (rmail-get-new-mail, rmail-insert-inbox-text):
Ensure that mbox format messages end in two newlines.
Fixes: debbugs:9974
2011-11-07 10:52:29 +08:00
Eli Zaretskii
53479029f7
Fix rmail-next/prev-same-subject.
...
lisp/mail/rmail.el (rmail-simplified-subject): Decode subject with
rfc2047-decode-string.
(rmail-mime-toggle-hidden): Declare to avoid byte-compilation
warnings.
2011-11-05 00:07:12 +02:00
Mark Lillibridge
b0c4cdcf10
* lisp/mail/rmail.el (rmail-mode-map): Add M-C-f as in rmailsum.
...
Fixes: debbugs:9802
2011-10-27 22:47:43 -04:00
Chong Yidong
ce3cefcca3
Change scroll-up/down bindings to Emacs 24's scroll-*-command.
...
* cus-edit.el (custom-mode-map):
* epa.el (epa-key-list-mode-map):
* man.el (Man-mode-map):
* startup.el (splash-screen-keymap):
* simple.el (special-mode-map): Use scroll-up-command and
scroll-down-command.
* progmodes/idlw-help.el (idlwave-help-mode-map):
* progmodes/ebrowse.el (ebrowse-electric-position-mode-map):
* net/newst-plainview.el (newsticker-mode-map):
* emulation/ws-mode.el (wordstar-mode-map):
* emulation/vi.el (vi-com-map):
* calc/calc-graph.el (calc-graph-show-dumb):
* term/sun.el (terminal-init-sun):
* term/ns-win.el (global-map):
* progmodes/grep.el (grep-mode-map):
* progmodes/ebrowse.el (ebrowse-electric-list-mode-map):
* mail/rmail.el (rmail-mode-map):
* progmodes/cpp.el (cpp-edit-mode-map): Likewise.
2011-10-01 16:32:01 -04:00
Richard M. Stallman
e08b633bd6
Don't allow killing Rmail view buffer by itself.
...
It gets killed only when its Rmail buffer gets killed.
2011-09-23 19:44:32 -04:00
Eli Zaretskii
14a29deb45
Fix bug #9392 with rmail-forward.
...
lisp/simple.el (mail-encode-mml): New defvar.
lisp/mail/rmail.el (mail-encode-mml): Add a defvar.
(rmail-enable-mime-composing): Default to t.
(rmail-forward): Use MIME method of forwarding only if both
rmail-enable-mime-composing and rmail-enable-mime are non-nil.
Set mail-encode-mml non-nil if the MIME method was used.
lisp/mail/sendmail.el (mml-to-mime): Add autoload form.
(mail-encode-mml): Add a defvar.
(mail-mode): Make mail-encode-mml buffer-local and initialize it
to nil.
(mail-send): If mail-encode-mml is non-nil, run the outgoing
message through mml-to-mime, and reset mail-encode-mml to nil.
2011-09-09 11:59:51 +03:00
Eli Zaretskii
fd59d131bb
Fix rmail-forward.
2011-09-03 13:00:13 +03:00
Eli Zaretskii
a3cf097fd0
Fix display by Rmail of bidirectional text in MIME email messages.
...
lisp/mail/rmailmm.el (rmail-mime-insert-tagline): Insert an extra
newline before and after the tag line, so it doesn't interfere
with determining the paragraph direction of bidirectional text.
2011-09-03 11:44:16 +03:00
Richard M. Stallman
d65e4c159b
Properly handle splitting of Rmail buffer and message view buffer.
2011-08-31 16:49:24 -04:00
Richard M. Stallman
177549d04c
Add rmail-epa-decrypt command.
2011-08-15 22:29:15 -04:00
Richard M. Stallman
c2f9aec8b4
Fix bugs finding grep hits in Rmail buffers.
2011-07-07 06:35:43 -04:00
Kenichi Handa
023e7b416b
chartab.c (sub_char_table_set_range): Fix previous change.
2011-07-07 13:16:52 +09:00
Glenn Morris
4a834b86ce
Auto-commit of loaddefs files.
2011-06-27 06:23:19 -04:00
Stefan Monnier
c206f5b0f7
* lisp/mail/rmail.el (rmail-show-message-1): Use restore-buffer-modified-p.
2011-06-25 09:38:32 -04:00
Richard M. Stallman
14b4e83d62
Going to grep hit in Rmail buffer finds the message.
2011-06-23 13:08:15 -04:00
Richard M. Stallman
8050daa1d0
Work with changes in mail-bury.
2011-06-23 13:03:59 -04:00
Richard M. Stallman
f444564c73
Marking message as "seen" should not mark buffer as changed.
2011-06-23 12:38:40 -04:00
Richard M. Stallman
56c2cc9a95
Don't reuse previous Message-id when resending.
2011-06-23 12:33:05 -04:00
Martin Rudalics
02cfc6d6fc
Fix display-buffer related bugs reported by Thierry Volpiatto.
...
* window.el (get-lru-window, get-mru-window)
(get-largest-window): Never return a minibuffer window.
(display-buffer-pop-up-window): Fix a bug that could lead to
reusing the minibuffer window.
(display-buffer): Pass original specifier argument to
display-buffer-function instead of the normalized one.
Reported by Thierry Volpiatto <thierry.volpiatto@gmail.com>.
2011-06-23 10:58:45 +02:00
Glenn Morris
ccb55d277a
* lisp/mail/rmail.el (rmail-msgend, rmail-msgbeg): Doc fixes.
2011-03-09 19:41:17 -08:00
Glenn Morris
2b0c733045
Merge from emacs-23; up to 2010-06-03T05:41:49Z!rgm@gnu.org.
2011-02-27 17:07:29 -08:00
Andreas Schwab
b9eed2f259
Regenerate autoloads
2011-02-26 10:48:22 +01:00
Juanma Barranquero
8307f92370
Fix typos.
2011-02-23 20:56:30 +01:00
Glenn Morris
97610156f4
Fix spelling of "precede".
2011-02-22 23:08:12 -08:00
Glenn Morris
cce7d53002
Merge from emacs-23; up to 2010-06-02T00:10:42Z!yamaoka@jpl.org.
2011-02-22 20:19:28 -08:00
Kenichi Handa
2e15a2cf4d
merge emacs-23
2011-02-22 09:22:09 +09:00
Kenichi Handa
1f459fa46c
Decode "encoded-words" of header components on replying.
2011-02-22 09:19:08 +09:00
Andreas Schwab
652db9c009
Update autoloads
2011-02-20 12:59:44 +01:00
Glenn Morris
67ab0163d6
Merge from emacs-23; up to 2010-06-01T01:49:15Z!monnier@iro.umontreal.ca
2011-02-19 11:40:59 -08:00
Kenichi Handa
16bc9688d8
Fix setting of buffer-file-coding-system for MIME message.
2011-02-19 18:22:24 +09:00
Chong Yidong
38a7165591
Make rmail-default-dont-reply-to-names nil (Bug#7888); rename rmail-dont-reply-*.
...
* lisp/mail/mail-utils.el (mail-dont-reply-to-names): New variable,
from rmail-dont-reply-to-names. Callers changed.
(mail-dont-reply-to): Rename from mail-dont-reply-to.
(rmail-dont-reply-to): Make it an obsolete alias.
* lisp/mail/rmail.el (rmail-default-dont-reply-to-names): Default to
nil, and make obsolete.
(rmail-dont-reply-to-names): Alias to mail-dont-reply-to-names.
* lisp/mail/rmailsum.el (rmail-summary-sort-by-correspondent): Doc fix.
* lisp/mail/rmailsort.el (rmail-sort-by-correspondent)
(rmail-select-correspondent): Doc fix. Use mail-dont-reply-to.
* lisp/mail/rmail.el (rmail-reply): Use mail-dont-reply-to.
2011-02-12 16:45:42 -05:00
Stefan Monnier
b016851cb1
Move keymap initialization into declaration.
...
* lisp/textmodes/enriched.el (enriched-mode-map):
* lisp/textmodes/bib-mode.el (bib-mode-map):
* lisp/term/lk201.el (lk201-function-map):
* lisp/tar-mode.el (tar-mode-map):
* lisp/replace.el (occur-mode-map):
* lisp/progmodes/idlwave.el (idlwave-rinfo-mouse-map, idlwave-rinfo-map):
* lisp/progmodes/idlw-help.el (idlwave-help-mode-map):
* lisp/progmodes/gdb-mi.el (gdb-memory-format-menu, gdb-memory-unit-menu):
* lisp/play/solitaire.el (solitaire-mode-map):
* lisp/play/snake.el (snake-mode-map, snake-null-map):
* lisp/play/pong.el (pong-mode-map):
* lisp/play/handwrite.el (menu-bar-handwrite-map):
* lisp/play/gametree.el (gametree-mode-map):
* lisp/net/rcirc.el (rcirc-mode-map, rcirc-browse-url-map
(rcirc-multiline-minor-mode-map, rcirc-track-minor-mode-map):
* lisp/net/newst-plainview.el (newsticker-menu, newsticker-mode-map)
(newsticker--url-keymap):
* lisp/net/net-utils.el (nslookup-mode-map, ftp-mode-map):
* lisp/menu-bar.el (menu-bar-file-menu, menu-bar-i-search-menu)
(menu-bar-search-menu, menu-bar-replace-menu, menu-bar-goto-menu)
(menu-bar-edit-menu, menu-bar-custom-menu)
(menu-bar-showhide-fringe-ind-menu, menu-bar-showhide-fringe-menu)
(menu-bar-showhide-scroll-bar-menu, menu-bar-showhide-menu)
(menu-bar-line-wrapping-menu, menu-bar-options-menu)
(menu-bar-games-menu, menu-bar-encryption-decryption-menu)
(menu-bar-tools-menu, menu-bar-describe-menu)
(menu-bar-search-documentation-menu, menu-bar-manuals-menu)
(menu-bar-help-menu):
* lisp/mail/rmailsum.el (rmail-summary-mode-map):
* lisp/kmacro.el (kmacro-step-edit-map):
* lisp/ibuffer.el (ibuffer-mode-groups-popup, ibuffer-mode-map)
(ibuffer-mode-operate-map):
* lisp/hi-lock.el (hi-lock-menu, hi-lock-map):
* lisp/emulation/vip.el (vip-mode-map):
* lisp/emacs-lisp/re-builder.el (reb-lisp-mode-map):
* lisp/bookmark.el (bookmark-bmenu-mode-map):
* lisp/help-mode.el (help-mode-map):
* lisp/erc/erc-list.el (erc-list-menu-mode-map):
* lisp/org/org-remember.el (org-remember-mode-map):
* lisp/org/org-src.el (org-src-mode-map): Move initialization into declaration.
2011-02-10 11:56:00 -05:00
Chong Yidong
2e804fc7e7
Update autoloads.
2011-01-28 11:58:04 -05:00
Glenn Morris
73b0cd5003
Convert consecutive FSF copyright years to ranges.
2011-01-24 20:08:28 -08:00
Andreas Schwab
44ec06d43e
Update md5 checksums
2011-01-18 20:08:00 +01:00
Paul Eggert
61f74651c4
Merge from mainline.
2011-01-17 11:47:38 -08:00
Paul Eggert
a3e44e7937
Merge from mainline.
2011-01-17 11:01:01 -08:00
Chong Yidong
9f19b8ddfe
Bump version to 23.2.92.
...
Regenerate AUTHORS, configure, and ldefs-boot.el.
2011-01-14 22:50:47 -05:00
Stefan Monnier
f80aa5bfa9
Update md5 checksums
2011-01-14 13:06:07 -05:00
Stefan Monnier
77ab81d054
Merge from emacs-23
2011-01-14 12:18:41 -05:00
Chong Yidong
25ca2e6140
New arg RETURN-ACTION for compose-mail, and related functions.
...
* lisp/mail/sendmail.el (mail-return-action): New var.
(mail-mode): Make it buffer-local.
(mail-bury): Obey it. Move special Rmail window handling to
rmail-mail-return.
(mail, mail-setup): New arg RETURN-ACTION.
(sendmail-user-agent-compose): Move from simple.el.
* lisp/simple.el (sendmail-user-agent-compose): Move to sendmail.el.
(compose-mail): New arg RETURN-ACTION.
(compose-mail-other-window, compose-mail-other-frame): Likewise.
* lisp/gnus/gnus-msg.el (gnus-msg-mail): New arg RETURN-ACTION. Pass it to
message-mail.
* lisp/gnus/message.el (message-mail): New arg RETURN-ACTION.
(message-return-action): New var.
(message-bury): Use it.
(message-mode): Make it buffer-local.
(message-send-and-exit): Always call message-bury.
(message-tool-bar-gnome): Tweak tool-bar items. Add :vert-only tags.
* lisp/mail/rmail.el (rmail-mail-return): New function.
(rmail-start-mail): Pass it to compose-mail.
* lisp/mh-e/mh-comp.el (mh-user-agent-compose): New arg RETURN-ACTION.
2011-01-12 23:23:41 -05:00
Lennart Borgman
320912fb3d
Fix permanancy of BUFFER-LIST arg to list-buffers-noselect (Bug#7749).
...
* buff-menu.el (Buffer-menu-buffer-list): New var.
(Buffer-menu-revert-function, list-buffers-noselect): Use it, so a
restricted buffer list is not lost on revert (Bug#7749).
2011-01-08 17:15:51 -05:00
Glenn Morris
5df4f04cd3
Add 2011 to FSF/AIST copyright years.
2011-01-02 15:50:46 -08:00
Chong Yidong
7c420169ba
Merge changes from emacs-23 branch
2011-01-02 15:31:19 -05:00
Andreas Schwab
b0eab0848b
Update autoloads in rmail.el
2010-12-24 10:07:39 +01:00
Kenichi Handa
186f7f0b7f
Enable display mode of MIME message in rmail.
2010-12-24 13:38:22 +09:00
Chong Yidong
5614fd5608
Delete long unused functions and variables in rect.el.
...
lisp/rect.el (operate-on-rectangle-lines, string-rectangle-string):
Delete unused variables.
(move-to-column-force): Remove function obsolete since 21.2.
2010-12-15 10:05:38 +08:00
Stefan Monnier
f49d1f52b2
Merge from emacs-23
2010-12-13 10:27:36 -05:00
Chong Yidong
d8b2a96214
Fix crash with invisible text and overlays (Bug#7016).
...
* src/dispextern.h (struct it): New member overlay_strings_charpos.
* src/xdisp.c (next_overlay_string, load_overlay_strings): Record the
charpos where we computed n_overlay_strings.
(next_overlay_string): Load overlay strings at recorded position,
which may not be the same as the iterator's charpos (Bug#7016).
2010-12-06 01:54:52 -05:00
Chong Yidong
088c8c092b
Fix error in last merge.
...
src/gtkutil.c (menubar_map_cb): Use xg_height_or_width_changed.
2010-11-30 12:01:18 -05:00
Chong Yidong
07976ae3b8
Merge changes from emacs-23 branch
2010-11-27 15:04:57 -05:00
Kenichi Handa
3d9ee611b8
mail/rmail.el: Require rfc2047.
2010-11-26 16:58:35 +09:00
Kenichi Handa
d1be4ec274
Improve rmail's MIME handling.
2010-11-26 13:06:59 +09:00
Juanma Barranquero
220d91b834
Merge changes from emacs-23 branch.
2010-10-14 16:32:27 +02:00
Kenichi Handa
9650fc6190
mail/rmail.el (rmail-show-message-1): Catch an error of base64-decode-region and just show an error message (bug#7165).
2010-10-14 13:23:36 +09:00
Glenn Morris
58d1ac6d6d
Reduce rmail.el's use of sendmail.el
...
* lisp/mail/rmail.el (mail-sendmail-delimit-header, mail-header-end)
(mail-position-on-field): Remove declarations.
(mail-position-on-field): Autoload it.
(rmail-retry-failure): Replace use of mail-sendmail-delimit-header
and mail-header-end. Don't require sendmail.
2010-10-06 19:42:30 -07:00
Chong Yidong
bd78fa1d54
Add "Package:" file headers to denote built-in packages.
2010-08-29 12:17:13 -04:00
Glenn Morris
fb89a65490
Fix rmail-forward with non-sendmail sending function.
...
* lisp/mail/rmail.el (rmail-forward): Replace mail-text-start with its
expansion, so as not to need sendmail.
(mail-text-start): Remove declaration.
(rmail-retry-failure): Require sendmail.
2010-08-20 00:11:35 -07:00
Juanma Barranquero
a096f9fe86
lisp/mail/rmail.el: Update autoload checksum.
2010-07-21 13:31:22 +02:00
Glenn Morris
f454672ba3
Restore user option rmail-highlight-face.
...
* mail/rmail.el (rmail-highlight-face): Restore option deleted
2008-02-13 without comment; mark it obsolete.
(rmail-highlight-headers): Use rmail-highlight-face once more.
2010-03-17 21:49:35 -07:00
Glenn Morris
a03ae20dc6
* mail/rmail.el (rmail-show-message-1): Handle malformed
...
quoted-printable text. (Bug#5441)
2010-02-03 21:10:21 -08:00
Juanma Barranquero
7709e61e9a
* mail/rmail.el: Update autoload checksum.
2010-01-23 13:38:02 +01:00
Stefan Monnier
c893016b07
* mail/rmailmm.el (rmail-mime-handle): Don't set the buffer to unibyte
...
just because we see "encoding: 8bit".
* mail/rmail.el (rmail-show-message-1): Decode the body's QP into bytes.
2010-01-22 11:43:54 -05:00
Juanma Barranquero
d77b5977da
Update autoload checksums.
2010-01-13 13:34:53 +01:00
Glenn Morris
114f9c9679
Add 2010 to copyright years.
2010-01-13 00:35:10 -08:00
Eli Zaretskii
5e7a90229a
Prevent save-buffer in Rmail buffers from using the coding-system
...
of the current message, and from clobbering the encoding mnemonics
in the mode line (Bug#4623).
(rmail-swap-buffers): Swap encoding and modified flag, too.
(rmail-message-encoding): New variable.
(rmail-write-region-annotate): Record the encoding of the current message
in rmail-message-encoding.
(rmail-after-save-hook): New function, restores the encoding of the current
message after the message collection is saved.
2009-12-07 19:21:57 +00:00
Glenn Morris
a67972b794
Regenerate autoloads.
2009-12-04 05:00:44 +00:00
Glenn Morris
c920f22245
(rmail-pop-to-buffer): New function. (Bug#2282)
...
(rmail-select-summary): Use rmail-pop-to-buffer.
2009-12-02 03:04:43 +00:00
Chong Yidong
9d5005602d
Update md5sum.
2009-11-21 20:19:15 +00:00
Chong Yidong
ae6c627429
Update md5sum.
2009-11-07 19:39:39 +00:00
Stefan Monnier
fae4e5b9f5
* emacs-lisp/autoload.el (generated-autoload-feature): Remove.
...
(autoload-rubric): Don't use any more.
* cedet/semantic/fw.el (semantic/loaddefs):
* cedet/srecode.el (srecode/loaddefs):
* cedet/ede.el (ede/loaddefs): Load rather than require.
* lisp/cedet/ede/cpp-root.el:
* lisp/cedet/ede/emacs.el:
* lisp/cedet/ede/files.el:
* lisp/cedet/ede/linux.el:
* lisp/cedet/ede/locate.el:
* lisp/cedet/ede/make.el:
* lisp/cedet/ede/shell.el:
* lisp/cedet/ede/speedbar.el:
* lisp/cedet/ede/system.el:
* lisp/cedet/ede/util.el:
* lisp/cedet/semantic/analyze.el:
* lisp/cedet/semantic/bovine.el:
* lisp/cedet/semantic/complete.el:
* lisp/cedet/semantic/ctxt.el:
* lisp/cedet/semantic/db-file.el:
* lisp/cedet/semantic/db-find.el:
* lisp/cedet/semantic/db-global.el:
* lisp/cedet/semantic/db-mode.el:
* lisp/cedet/semantic/db-typecache.el:
* lisp/cedet/semantic/db.el:
* lisp/cedet/semantic/debug.el:
* lisp/cedet/semantic/dep.el:
* lisp/cedet/semantic/doc.el:
* lisp/cedet/semantic/edit.el:
* lisp/cedet/semantic/find.el:
* lisp/cedet/semantic/format.el:
* lisp/cedet/semantic/html.el:
* lisp/cedet/semantic/ia-sb.el:
* lisp/cedet/semantic/ia.el:
* lisp/cedet/semantic/idle.el:
* lisp/cedet/semantic/lex-spp.el:
* lisp/cedet/semantic/lex.el:
* lisp/cedet/semantic/mru-bookmark.el:
* lisp/cedet/semantic/scope.el:
* lisp/cedet/semantic/senator.el:
* lisp/cedet/semantic/sort.el:
* lisp/cedet/semantic/symref.el:
* lisp/cedet/semantic/tag-file.el:
* lisp/cedet/semantic/tag-ls.el:
* lisp/cedet/semantic/tag-write.el:
* lisp/cedet/semantic/tag.el:
* lisp/cedet/semantic/util-modes.el:
* lisp/cedet/semantic/analyze/complete.el:
* lisp/cedet/semantic/analyze/refs.el:
* lisp/cedet/semantic/bovine/c.el:
* lisp/cedet/semantic/bovine/gcc.el:
* lisp/cedet/semantic/bovine/make.el:
* lisp/cedet/semantic/bovine/scm.el:
* lisp/cedet/semantic/decorate/include.el:
* lisp/cedet/semantic/decorate/mode.el:
* lisp/cedet/semantic/symref/cscope.el:
* lisp/cedet/semantic/symref/global.el:
* lisp/cedet/semantic/symref/grep.el:
* lisp/cedet/semantic/symref/idutils.el:
* lisp/cedet/semantic/symref/list.el:
* lisp/cedet/semantic/wisent/java-tags.el:
* lisp/cedet/semantic/wisent/javascript.el:
* lisp/cedet/srecode/compile.el:
* lisp/cedet/srecode/cpp.el:
* lisp/cedet/srecode/document.el:
* lisp/cedet/srecode/el.el:
* lisp/cedet/srecode/expandproto.el:
* lisp/cedet/srecode/getset.el:
* lisp/cedet/srecode/insert.el:
* lisp/cedet/srecode/java.el:
* lisp/cedet/srecode/map.el:
* lisp/cedet/srecode/mode.el:
* lisp/cedet/srecode/template.el:
* lisp/cedet/srecode/texi.el: Remove the file-local setting of
generated-autoload-feature.
2009-11-03 21:45:31 +00:00
Dan Nicolaescu
a7610c523c
* textmodes/tex-mode.el (tex-dvi-view-command)
...
(tex-show-queue-command, tex-open-quote):
* progmodes/ruby-mode.el (auto-mode-alist)
(interpreter-mode-alist): Purecopy strings.
* emacs-lisp/lisp-mode.el (emacs-lisp-mode-map): Purecopy item names.
* emacs-lisp/derived.el (define-derived-mode): Purecopy the doc
string for the hook, keymap and abbrev table.
* emacs-lisp/byte-run.el (make-obsolete): Purecopy the current name.
* x-dnd.el (x-dnd-xdnd-to-action):
* startup.el (fancy-startup-text, fancy-about-text): Change to
defconst from defvar.
* ps-print.el (ps-page-dimensions-database): Purecopy initial value.
* mouse.el (mouse-buffer-menu-mode-groups, x-fixed-font-alist):
Purecopy initialization strings.
* mail/sendmail.el (mail-header-separator)
(mail-personal-alias-file):
* mail/rmail.el (rmail-default-dont-reply-to-names)
(rmail-ignored-headers, rmail-retry-ignored-headers)
(rmail-highlighted-headers, rmail-secondary-file-directory)
(rmail-secondary-file-regexp):
* files.el (null-device, file-name-invalid-regexp)
(locate-dominating-stop-dir-regexp)
(inhibit-first-line-modes-regexps): Purecopy initialization
strings.
(interpreter-mode-alist): Use mapcar instead of mapc.
* buff-menu.el (Buffer-menu-mode-map): Purecopy name.
* bindings.el (mode-line-major-mode-keymap): Purecopy name.
(completion-ignored-extensions):
(debug-ignored-errors): Purecopy strings.
2009-10-26 06:43:36 +00:00
Glenn Morris
fd7dd48c19
(rmail-write-region-annotate): Prevent viewing different
...
messages from messing up the file coding. (Bug#4623)
2009-10-17 03:11:54 +00:00
Glenn Morris
eac4b19656
Regenerate.
2009-10-15 06:31:51 +00:00
Glenn Morris
353f2607c2
Regenerate.
2009-10-06 06:40:40 +00:00
Glenn Morris
ac3c593c97
(rmail-generate-viewer-buffer): Be more careful about reusing existing
...
buffers, in case we happen to visit two files with the same basename.
(Bug#4593)
2009-10-03 02:07:28 +00:00
Glenn Morris
1861d81ed3
Regenerate.
2009-09-26 19:21:07 +00:00
Glenn Morris
f146e75f8d
Regenerate.
2009-09-25 06:15:30 +00:00
Glenn Morris
6892b117c9
Regenerate.
2009-09-25 03:39:23 +00:00
Juanma Barranquero
4561f7e0f3
Update.
2009-09-25 00:30:31 +00:00
Glenn Morris
4f02f0c989
(rmail-reply): Don't try to add a References header when replying to
...
mail without References or Message-Id. (Bug#4525)
2009-09-23 06:20:23 +00:00
Juanma Barranquero
a2c145f68f
Update.
2009-09-15 08:11:42 +00:00
Juanma Barranquero
7e0aa125bc
Update.
2009-09-11 12:05:45 +00:00
Glenn Morris
6c82bad232
(rmail-user-mail-address-regexp): Move here from rmailsum.el.
...
Regenerate with extracted autoloads.
2009-09-10 06:19:34 +00:00
Glenn Morris
597e2240ab
Use default-value rather than default-enable-multibyte-characters.
2009-09-03 06:54:57 +00:00
Glenn Morris
d6261cc1a2
(rmail-obsolete): Delete custom group.
...
(rmail-pop-password, rmail-pop-password-required): Make into aliases.
(rmail-remote-password, rmail-remote-password-required):
Remove unneeded :set-after and :set properties.
2009-08-21 07:02:28 +00:00
Richard M. Stallman
76e1e40b4e
* mail/rmail.el (rmail-set-message-counters):
...
Call rmail-set-message-counters-counter just once.
It returns # msgs after point.
(rmail-set-message-counters-counter):
Arg is now SPOT-TO-FIND. Return # messages after that one.
* mail/rmail.el (rmail-forget-messages):
Ignore nil elt in rmail-message-vector. Use dotimes.
2009-08-13 01:13:09 +00:00
Richard M. Stallman
5c9509238d
* mail/rmail.el (rmail-get-attr-names):
...
Accept an attribute header that is too short.
2009-08-13 01:04:37 +00:00
Eli Zaretskii
0e9aba0f37
(rmail-add-mbox-headers): Restore error message about invalid RFC2822 format.
2009-08-08 10:26:44 +00:00
Eli Zaretskii
0f25a27764
(rmail-add-mbox-headers, rmail-set-message-counters-counter): Search for
...
rmail-unix-mail-delimiter instead of just "From ". (Bug#4076)
2009-08-08 10:05:53 +00:00
Chong Yidong
a4f6970146
* mail/rmailedit.el (rmail-edit-mode): Use auto-save-include-big-deletions.
...
* mail/rmail.el (rmail-variables): Use auto-save-include-big-deletions.
* files.el (auto-save-mode): Revert 2009-07-21 and 2009-07-16 changes.
2009-07-21 23:34:33 +00:00
Glenn Morris
4ed32706c7
(rmail-retry-ignored-headers): Bump :version.
2009-07-21 04:42:55 +00:00
Richard M. Stallman
7a907299a2
* files.el (auto-save-mode): If buffer-saved-size is -2, don't clobber it.
...
* mail/rmail.el (rmail-variables): Set buffer-saved-size to -2.
(rmail-retry-ignored-headers): Add more uninteresting fields.
2009-07-16 01:52:32 +00:00
Richard M. Stallman
4df49ff1d2
* mail/rmail.el (rmail-expunge-confirmed): Return nil if nothing to do.
...
Don't call rmail-modify-format here.
(rmail-expunge): Call it here after expunge is confirmed.
(rmail-confirm-expunge): Doc fix. Mark as risky.
(rmail-convert-babyl-to-mbox): Call rmail-modify-format.
(rmail-set-attribute): Call rmail-dont-modify-format only for `unseen'.
For other attributes, call `rmail-modify-format',
and propagate the modified flag to rmail-buffer.
2009-05-18 16:26:57 +00:00
Eli Zaretskii
910348651b
(rmail-unrmail-new-mail, rmail-unrmail-new-mail-maybe): New functions.
...
(rmail-insert-inbox-text): Use rmail-unrmail-new-mail-maybe to convert
Babyl-formatted new mail to mbox format. (Bug#2942)
2009-04-10 10:42:07 +00:00
Richard M. Stallman
9aadce2568
Don't query before visiting a Babyl file.
...
Instead, query before modifications that would save it.
* mail/rmail.el (rmail-was-converted): New variable.
(rmail-seriously-modified): New variable.
(rmail-perm-variables): Set them to nil.
(rmail-convert-babyl-to-mbox): Don't query about converting Babyl file.
Instead, set rmail-was-converted.
(rmail-modify-format): New function. Query if save will change format.
(rmail-dont-modify-format): New function.
(rmail-duplicate-message, rmail-get-new-mail):
Call rmail-modify-format.
(rmail-set-header): Call rmail-dont-modify-format.
(rmail-set-attribute): Likewise.
(rmail-expunge-confirmed): Call rmail-modify-format.
* mail/rmailout.el (rmail-output-to-rmail-buffer):
Call rmail-modify-format.
2009-04-09 16:43:51 +00:00
Eli Zaretskii
92655f6c69
(rmail-simplified-subject): Normalize whitespace in subject. This
...
resurrects a feature, lost in transition to mbox, whereby Subject is
matched even if it's broken into several lines at arbitrary places.
2009-04-08 12:43:40 +00:00
Glenn Morris
384b53ab0f
(rmail-expunge-and-save): Let rmail-expunge show the message.
...
(rmail-quit): Mark summary unmodified.
(rmail-expunge): Doc fix. Always show a message. (Bug#2763)
2009-04-07 03:01:08 +00:00
Richard M. Stallman
8882002ae5
(rmail-expunge): Without DONT-SHOW, show the message even after
...
updating summary.
2009-03-22 14:51:17 +00:00
Richard M. Stallman
551fd0c448
(rmail-expunge): Update summary buffer even if NO-SHOW.
2009-03-22 14:12:47 +00:00
Glenn Morris
33e38fa1c8
(rmail-retry-ignored-headers): Add :version tag.
2009-03-19 06:20:27 +00:00
Richard M. Stallman
b6de883825
(rmail-retry-ignored-headers): Add usual mime headers.
...
(rmail-retry-failure): Undo previous change.
2009-03-18 21:47:23 +00:00
Richard M. Stallman
b79c90313e
Fix previous change.
2009-03-16 14:10:47 +00:00
Richard M. Stallman
0b9b4ab99a
(rmail-expunge): Show the message only once, and only if needed.
...
If the current message was current before, just re-swap.
2009-03-16 14:04:28 +00:00
Richard M. Stallman
a6cf3c4e36
(rmail-retry-failure): Discard rmail-ignored-headers.
2009-03-16 13:42:31 +00:00
Glenn Morris
4ad1654a90
(rmail-font-lock-keywords): Treat "Mail-Reply-To" like "Reply-To".
2009-03-15 21:09:30 +00:00
Glenn Morris
26eb677a6e
(rmail-perm-variables): rmail-overlay-list needs to be buffer-local in
...
the view buffer, not the rmail buffer.
(rmail-ensure-blank-line): New function.
2009-03-05 03:43:32 +00:00
Glenn Morris
66be413e7a
(rmail-highlighted-headers, rmail-highlight, rmail-header-name): Doc fixes.
...
(rmail-show-message-verbose-min): Add :version.
(rmail-highlight-headers): Add doc string. Simplify.
2009-03-03 04:08:09 +00:00
Glenn Morris
37aca7a833
(rmail-delete-headers): New function.
...
(rmail-retry-failure): Restore yet another feature mbox Rmail removed
without telling anyone, namely rmail-retry-ignored-headers.
2009-03-02 08:03:41 +00:00
Glenn Morris
925d658277
(rmail-retry-failure): Use rmail-get-header rather than a magical
...
save-excursion/restriction combination that does nothing.
2009-03-02 07:36:03 +00:00
Glenn Morris
c9a81e054f
(rmail-dont-reply-to-names, rmail-default-dont-reply-to-names): Doc fixes.
...
(rmail-reply): Avoid extraneous leading whitespace.
2009-03-02 07:23:57 +00:00
Glenn Morris
5f3b706381
(rmail-reply): Use rmail-apply-in-message so that this function has
...
access to all the headers, not just the visible ones.
2009-03-02 02:19:24 +00:00
Glenn Morris
017166cefc
(rmail-mode-map): Add explicit keybinding for rmail-resend in the menu.
2009-03-01 00:56:18 +00:00
Glenn Morris
dec5f46d73
(rmail-primary-inbox-list): Doc fix. Fix custom choice to match default.
...
(rmail-mode-map): Bind rmail-mime to `v'.
(rmail-get-new-mail): Doc fix.
(rmail-beginning-of-message, rmail-end-of-message): Preserve the current
header style.
2009-02-28 03:25:32 +00:00
Glenn Morris
592465ca38
(rmail-speedbar-move-message): Preserve the directory part against
...
rmail-output's oddness.
2009-02-27 04:00:45 +00:00
Glenn Morris
433c16523a
(rmail): Don't show a message if rmail-get-new-mail already did. (Bug#2440)
...
(rmail-quit): Don't swap buffers. (Bug#2441)
(rmail-list-to-menu): Don't globally bind `name'.
2009-02-24 03:31:39 +00:00
Glenn Morris
bd26454c24
Comment.
2009-02-20 05:07:49 +00:00
Glenn Morris
788c1fc9e1
(rmail-speedbar-buttons): Only add regular files.
...
(rmail-speedbar-find-file): Use rmail rather than find-file.
2009-02-20 04:35:00 +00:00
Glenn Morris
25833b8cd8
(rsf-beep, rsf-sleep-after-message, rmail-spam-filter): Don't declare.
...
(rmail-get-new-mail-filter-spam): Declare. Move definition to
rmail-spam-filter.el.
(rmail-get-new-mail-1): Move the beep and sleep to
rmail-get-new-mail-filter-spam.
2009-02-19 03:30:41 +00:00
Glenn Morris
134859bc3c
(rmail-get-new-mail-filter-spam): Show a message rather than the raw
...
mbox while prompting.
2009-02-18 08:02:56 +00:00
Glenn Morris
8e7a0f839f
(rmail-get-new-mail-1): Fix the spam beep test.
...
(rmail-get-new-mail-filter-spam): Simplify. Don't mess with
rmail-deleted-vector.
(rmail-insert-inbox-text, rmail-collect-deleted)
(rmail-set-message-deleted-p, rmail-only-expunge)
(rmail-make-in-reply-to-field): Replace ?\ with ?\s.
(rmail-get-labels): Remove unused local `blurb'.
(rmail-message-attr-p, rmail-message-unseen-p, rmail-message-labels-p)
(rmail-msgend, rmail-msgbeg, rmail-message-deleted-p)
(rmail-set-message-deleted-p): Doc fixes.
2009-02-18 04:34:04 +00:00
Richard M. Stallman
5a34da0465
(rmail-copy-headers): When copying full headers,
...
correctly put point at the end.
2009-02-17 18:10:32 +00:00
Glenn Morris
f58faced4e
(rmail-get-attr-names): Give a warning rather than an error if the
...
header is corrupt.
2009-02-17 02:37:40 +00:00
Glenn Morris
40f9db320d
(rmail): When reverting, swap buffers before setting counters. (Bug#2229)
...
(rmail-revert): Swap buffers before replacing contents.
2009-02-14 03:40:39 +00:00
Richard M. Stallman
c7eb0ba1f8
(rmail-convert-file-maybe): Turn off case-fold-search.
...
(rmail-add-mbox-headers): Likewise.
2009-02-14 02:52:17 +00:00
Glenn Morris
809f3af083
(rmail-show-message): New name for the old rmail-show-message-maybe.
...
Update callers.
2009-02-13 07:46:14 +00:00
Glenn Morris
574bc51d39
(rmail-show-message-1): New name for the old rmail-show-message.
...
Update callers.
2009-02-13 07:43:50 +00:00
Glenn Morris
95ca567f4d
(rmail-summary-vector, rmail-mode-map): Add doc string.
...
(rmail-set-header-1): If VALUE is nil, remove the header altogether.
(rmail-set-header): Doc fix.
2009-02-13 03:51:16 +00:00
Richard M. Stallman
51584624ee
(rmail-show-message-verbose-min): New option.
...
(rmail-show-message): Conditionally show start and finish in echo area.
2009-02-12 04:01:11 +00:00
Glenn Morris
4de724b067
(rmail-unix-mail-delimiter): Doc fix.
...
(rmail-enable-multibyte): Don't really define, only for compiler.
2009-02-12 03:29:19 +00:00
Glenn Morris
44baa8ce8f
(rmail-set-attribute): Allow ATTR to be a string.
2009-02-10 03:57:10 +00:00
Glenn Morris
75790248f0
(rmail-automatic-folder-directives): Doc fix.
...
(rmail-current-message, rmail-total-messages)
(rmail-message-vector, rmail-deleted-vector): Add doc strings.
(rmail-duplicate-message): Doc fix.
(rmail-get-header-1, rmail-set-header-1, rmail-set-attribute-1):
New functions.
(rmail-get-header, rmail-set-header, rmail-set-attribute):
Use rmail-apply-in-message.
(rmail-message-attr-p): Use rmail-get-header, hence no longer requires
unswapped-ness.
(rmail-get-attr-names): Check for missing or corrupt attribute headers.
(rmail-auto-file): Set the filed attribute, rather than explicitly not
doing so. (Bug#2231)
2009-02-10 03:33:27 +00:00
Eli Zaretskii
634b455a37
(rmail): Bind coding-system-for-read to no-conversion before calling
...
find-file-noselect. (Bug#2015)
2009-02-07 18:35:56 +00:00
Eli Zaretskii
fc9682ad97
(rmail-redecode-body): Don't encode/decode the message; instead, just rewrite
...
the X-Coding-System header with the new encoding, and let rmail-show-message
do the rest. Remove unused argument RAW. Fix doc string to be consistent
with the new implementation.
(rmail-show-message): Honor X-Coding-System header, if present, in preference
to Content-Type header.
2009-02-07 16:46:27 +00:00
Glenn Morris
50dcb7845f
(rmail-duplicate-message): Make it work.
2009-02-05 07:38:56 +00:00
Glenn Morris
6b6a84a15b
(rmail-what-message): Unbreak it.
2009-02-05 06:40:01 +00:00
Glenn Morris
a4e80191c2
No need for mule-util when compiling.
...
(rmail-first-message): Unbreak it.
2009-02-04 03:38:26 +00:00
Glenn Morris
bad4f1fd32
(rmail-convert-babyl-to-mbox): Disable undo while
...
inserting the converted mailbox.
(rmail-get-new-mail): Restore the loop over inboxes when two or more
have the same basename. (Bug#2164)
Set the return value according to whether any mail was found,
not just in the last inbox. Only show a message and run the hook after
checking all inboxes.
(rmail-get-new-mail-1): Move message display and running the hook to
rmail-get-new-mail.
2009-02-03 04:07:25 +00:00
Glenn Morris
236ab005f7
(rmail-ignored-headers, rmail-displayed-headers)
...
(rmail-retry-ignored-headers, rmail-highlighted-headers):
Restore autoloads.
2009-02-02 07:55:04 +00:00
Stefan Monnier
2dc00ad0c3
(rmail-view-buffer): Make buffer-local.
...
(rmail-select-summary, rmail-perm-variables, rmail-redecode-body)
(rmail-undelete-previous-message, rmail-mark-message)
(rmail-speedbar-buttons): Use with-current-buffer.
(rmail-mode-map): Move initialization into declaration.
(rmail-swap-buffers, rmail-unfontify-buffer-function)
(rmail-fontify-message): Use restore-buffer-modified-p.
(rmail-expunge-and-save): Don't swap buffer.
(rmail-get-header, rmail-set-header, rmail-set-attribute)
(rmail-apply-in-message): Swap save-excursion and save-restriction.
2009-02-01 03:39:37 +00:00
Eli Zaretskii
062ca6f69a
(rmail-redecode-body): Use eight-bit instead of obsolete
...
eight-bit-control and eight-bit-graphic.
2009-01-31 18:53:50 +00:00
Eli Zaretskii
6e9db169a3
(rmail-automatic-folder-directives, rmail): Doc fixes.
...
(rmail-swap-buffers): New function.
(rmail-change-major-mode-hook, rmail-swap-buffers-maybe, rmail-show-message):
Use rmail-swap-buffers.
(rmail-decode-region): If DESTINATION is a buffer, set the encoding of that
buffer, rather than the current buffer.
(rmail-show-message): Make error message about uuencoded mail more explicit.
(rmail-show-message-maybe): Simplify code. Doc fix.
(rmail-show-message): Doc fix.
2009-01-31 13:32:48 +00:00
Eli Zaretskii
0300c3390a
(rmail-redecode-body): Don't change EOL conversion of the new encoding if
...
the old one left it unspecified.
2009-01-31 10:10:02 +00:00
Eli Zaretskii
aa8c69584f
(rmail-convert-babyl-to-mbox): Set Rmail's buffer encoding to `raw-text-unix'.
...
(rmail-perm-variables): Set encoding of rmail-view-buffer to `undecided-unix'.
2009-01-31 09:32:45 +00:00
Glenn Morris
603c5d8d67
(rmail-msg-is-pruned): New (restored) function.
...
(rmail-toggle-header): Doc fix. Use rmail-msg-is-pruned.
(rmail-reply): Set up to yank from the decoded message rather than the
raw one. (Bug#2104).
2009-01-31 02:51:18 +00:00
Eli Zaretskii
2f6e377467
(rmail-resent-attr-index): Fix index value.
2009-01-30 18:29:48 +00:00
Eli Zaretskii
3951477883
(rmail-convert-babyl-to-mbox): Bind coding-system-for-read to `raw-text', and
...
use insert-file-contents instead of insert-file-contents-literally.
Fixes bug #2019 .
2009-01-30 14:37:32 +00:00
Glenn Morris
4ddca2c57f
(rmail-speedbar-buttons, rmail-speedbar-move-message-to-folder-on-line):
...
Use line-end-position.
2009-01-30 07:23:01 +00:00
Glenn Morris
df75fdb70d
(rmail-reply): Handle empty folders.
2009-01-30 03:46:31 +00:00
Chong Yidong
00c6f62e66
(rmail-toggle-header): Determine current header
...
style using the buffer-local value of rmail-header-style in the
view buffer.
(rmail-show-message): Set a buffer-local value of
rmail-header-style in the view buffer.
2009-01-29 14:09:36 +00:00
Glenn Morris
0954b0aa0e
(rmail-file-name): Remove duplicate definition.
...
(rmail-set-header): Ensure header changes get saved.
2009-01-29 03:41:57 +00:00
Chong Yidong
ace0f471fb
(rmail-show-message): Unquote From lines.
2009-01-29 03:01:44 +00:00
Chong Yidong
2e55c1b7bb
(rmail-redecode-body): New function, based on old version removed in
...
2009-01-22 change.
2009-01-29 02:46:21 +00:00
Chong Yidong
8372c367bd
(rmail-toggle-header): Don't reset
...
rmail-header-style permanently (bug#2016).
2009-01-28 15:54:46 +00:00
Glenn Morris
9940a3eca7
(rmail-expunge-and-save): Always show a message,
...
even when called from the summary. (Bug#2075)
(rmail-no-mail-p): New func, extracted from rmail-show-message-maybe.
(rmail-show-message-maybe): Use rmail-no-mail-p.
(rmail-show-message): If empty folder, do nothing. (Bug#2076)
2009-01-28 02:50:41 +00:00
Chong Yidong
eb7f6f5b5c
(rmail-convert-babyl-to-mbox): Prompt user before converting.
2009-01-27 23:02:00 +00:00
Glenn Morris
4546235fc9
Tweak previous doc fix.
2009-01-27 08:32:56 +00:00
Glenn Morris
3b5ad65462
(rmail-copy-headers): Doc fix. Leave point at the end
...
of the headers in the full header case. (Bug#2073)
2009-01-27 08:29:35 +00:00
Kenichi Handa
6b0c98f550
(rmail-get-coding-system): Fix previous change.
2009-01-27 04:49:33 +00:00
Kenichi Handa
fe83a3004e
(rmail-get-coding-system): Re-search
...
rmail-mime-charset-pattern directly instead of using
mail-fetch-field. Use coding-system-from-name.
2009-01-27 04:48:56 +00:00
Glenn Morris
778ef2ef07
Remove leading `*' from defcustom docs.
...
Remove needless autoloads of many defcustoms and hooks.
(rmail-enable-mime, rmail-insert-mime-resent-message-function)
(rmail-search-mime-message-function, rmail-search-mime-header-function)
(rmail-decode-mime-charset): Doc fix.
(rmail-search-message, rmail-resend): Check functions set before use.
2009-01-27 03:43:04 +00:00
Glenn Morris
ac120e6dbf
(rmail-reply): Don't include Resent-To and Resent-Cc in replies. (Bug#512)
2009-01-26 02:06:58 +00:00
Glenn Morris
38291a39bc
(rmail-insert-inbox-text): Revert replacement of "popmail" by "pormail".
2009-01-24 03:35:50 +00:00
Chong Yidong
eec86b015f
(rmail-buffer-swapped): Fix last change.
2009-01-23 22:33:43 +00:00
Chong Yidong
a8f67b0483
(rmail-get-labels): Obey the MSG argument.
2009-01-23 19:02:24 +00:00
Chong Yidong
e6d76715eb
(rmail-generate-viewer-buffer): Fix typo.
2009-01-23 15:10:16 +00:00
Stefan Monnier
87248b4462
(rmail-write-region-annotate): Only switch buffer if
...
start is nil, as was done in tar-mode.el.
2009-01-23 08:00:23 +00:00
Glenn Morris
51aca0f521
Sync a final change from pmail.el:
...
Chong Yidong <cyd at stupidchicken.com>
(rmail-buffer-swapped): Mark as permanent local.
2009-01-23 03:57:00 +00:00
Chong Yidong
23c039d851
Remove local var.
2009-01-23 03:34:00 +00:00
Bastien Guerry
537ab246b2
Renamed all pmail* files to rmail*.
2009-01-22 17:09:23 +00:00
Bastien Guerry
13847f7970
Removed rmail.el, rmailedit.el, rmailkwd.el, rmailmm.el, rmailmsc.el, rmailout.el, rmailsort.el, rmailsum.el.
2009-01-22 17:01:40 +00:00
Glenn Morris
ae940284fa
Add 2009 to copyright years.
2009-01-05 03:18:22 +00:00
Juanma Barranquero
2364df5cff
* international/mule-cmds.el (select-safe-coding-system):
...
* mail/rmail.el (rmail-require-mime-maybe):
Fix arguments of `display-warning'.
2008-12-15 15:44:13 +00:00
John Paul Wallington
6da54b82e4
(rmail-insert-inbox-text): Ensure that the filename of `tofile'
...
doesn't contain any colons so that it works on Windows, Cygwin, and
MS-DOS systems.
2008-08-21 12:24:48 +00:00
Glenn Morris
b1fc2b5014
Switch to recommended form of GPLv3 permissions notice.
2008-05-06 07:25:26 +00:00
Stefan Monnier
cbee283dd7
Fix up comment convention on the arch-tag lines.
2008-04-10 14:10:46 +00:00
Glenn Morris
6052846bdd
(rmail-autodetect): Add .exe extension to movemail on Windows.
2008-02-20 06:00:13 +00:00
Bastien Guerry
765e147aa1
;;; smtpmail.el --- simple SMTP protocol (RFC 821) for sending mail
...
;; Copyright (C) 1995, 1996, 2001, 2002, 2003, 2004, 2005,
;; 2006, 2007, 2008 Free Software Foundation, Inc.
;; Author: Tomoji Kagatani <kagatani@rbc.ncl.omron.co.jp>
;; Maintainer: Simon Josefsson <simon@josefsson.org>
;; w32 Maintainer: Brian D. Carlstrom <bdc@ai.mit.edu>
;; ESMTP support: Simon Leinen <simon@switch.ch>
;; Hacked by Mike Taylor, 11th October 1999 to add support for
;; automatically appending a domain to RCPT TO: addresses.
;; AUTH=LOGIN support: Stephen Cranefield <scranefield@infoscience.otago.ac.nz>
;; Keywords: mail
;; This file is part of GNU Emacs.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING. If not, write to the
;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
;; Boston, MA 02110-1301, USA.
;;; Commentary:
;; Send Mail to smtp host from smtpmail temp buffer.
;; Please add these lines in your .emacs(_emacs) or use customize.
;;
;;(setq send-mail-function 'smtpmail-send-it) ; if you use `mail'
;;(setq message-send-mail-function 'smtpmail-send-it) ; if you use message/Gnus
;;(setq smtpmail-default-smtp-server "YOUR SMTP HOST")
;;(setq smtpmail-local-domain "YOUR DOMAIN NAME")
;;(setq smtpmail-sendto-domain "YOUR DOMAIN NAME")
;;(setq smtpmail-debug-info t) ; only to debug problems
;;(setq smtpmail-auth-credentials ; or use ~/.authinfo
;; '(("YOUR SMTP HOST" 25 "username" "password")))
;;(setq smtpmail-starttls-credentials
;; '(("YOUR SMTP HOST" 25 "~/.my_smtp_tls.key" "~/.my_smtp_tls.cert")))
;; Where the 25 equals the value of `smtpmail-smtp-service', it can be an
;; integer or a string, just as long as they match (eq).
;; To queue mail, set smtpmail-queue-mail to t and use
;; smtpmail-send-queued-mail to send.
;; Modified by Stephen Cranefield <scranefield@infoscience.otago.ac.nz>,
;; 22/6/99, to support SMTP Authentication by the AUTH=LOGIN mechanism.
;; See http://help.netscape.com/products/server/messaging/3x/info/smtpauth.html
;; Rewritten by Simon Josefsson to use same credential variable as AUTH
;; support below.
;; Modified by Simon Josefsson <jas@pdc.kth.se>, 22/2/99, to support SMTP
;; Authentication by the AUTH mechanism.
;; See http://www.ietf.org/rfc/rfc2554.txt
;; Modified by Simon Josefsson <simon@josefsson.org>, 2000-10-07, to support
;; STARTTLS. 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
;;; Code:
(require 'sendmail)
(autoload 'starttls-open-stream "starttls")
(autoload 'starttls-negotiate "starttls")
(autoload 'mail-strip-quoted-names "mail-utils")
(autoload 'message-make-date "message")
(autoload 'message-make-message-id "message")
(autoload 'rfc2104-hash "rfc2104")
(autoload 'netrc-parse "netrc")
(autoload 'netrc-machine "netrc")
(autoload 'netrc-get "netrc")
;;;
(defgroup smtpmail nil
"SMTP protocol for sending mail."
:group 'mail)
(defcustom smtpmail-default-smtp-server nil
"*Specify default SMTP server.
This only has effect if you specify it before loading the smtpmail library."
:type '(choice (const nil) string)
:group 'smtpmail)
(defcustom smtpmail-smtp-server
(or (getenv "SMTPSERVER") smtpmail-default-smtp-server)
"*The name of the host running SMTP server."
:type '(choice (const nil) string)
:group 'smtpmail)
(defcustom smtpmail-smtp-service 25
"*SMTP service port number.
The default value would be \"smtp\" or 25."
:type '(choice (integer :tag "Port") (string :tag "Service"))
:group 'smtpmail)
(defcustom smtpmail-local-domain nil
"*Local domain name without a host name.
If the function `system-name' returns the full internet address,
don't define this value."
:type '(choice (const nil) string)
:group 'smtpmail)
(defcustom smtpmail-sendto-domain nil
"*Local domain name without a host name.
This is appended (with an @-sign) to any specified recipients which do
not include an @-sign, so that each RCPT TO address is fully qualified.
\(Some configurations of sendmail require this.)
Don't bother to set this unless you have get an error like:
Sending failed; SMTP protocol error
when sending mail, and the *trace of SMTP session to <somewhere>*
buffer includes an exchange like:
RCPT TO: <someone>
501 <someone>: recipient address must contain a domain
"
:type '(choice (const nil) string)
:group 'smtpmail)
(defcustom smtpmail-debug-info nil
"Whether to print info in buffer *trace of SMTP session to <somewhere>*.
See also `smtpmail-debug-verb' which determines if the SMTP protocol should
be verbose as well."
:type 'boolean
:group 'smtpmail)
(defcustom smtpmail-debug-verb nil
"Whether this library sends the SMTP VERB command or not.
The commands enables verbose information from the SMTP server."
:type 'boolean
:group 'smtpmail)
(defcustom smtpmail-code-conv-from nil ;; *junet*
"*smtpmail code convert from this code to *internal*..for tiny-mime.."
:type 'boolean
:group 'smtpmail)
(defcustom smtpmail-queue-mail nil
"*If set, mail is queued; otherwise it is sent immediately.
If queued, it is stored in the directory `smtpmail-queue-dir'
and sent with `smtpmail-send-queued-mail'."
:type 'boolean
:group 'smtpmail)
(defcustom smtpmail-queue-dir "~/Mail/queued-mail/"
"*Directory where `smtpmail.el' stores queued mail."
:type 'directory
:group 'smtpmail)
(defcustom smtpmail-auth-credentials "~/.authinfo"
"Specify username and password for servers, directly or via .netrc file.
This variable can either be a filename pointing to a file in netrc(5)
format, or list of four-element lists that contain, in order,
`servername' (a string), `port' (an integer), `user' (a string) and
`password' (a string, or nil to query the user when needed). If you
need to enter a `realm' too, add it to the user string, so that it
looks like `user@realm'."
:type '(choice file
(repeat (list (string :tag "Server")
(integer :tag "Port")
(string :tag "Username")
(choice (const :tag "Query when needed" nil)
(string :tag "Password")))))
:version "22.1"
:group 'smtpmail)
(defcustom smtpmail-starttls-credentials '(("" 25 "" ""))
"Specify STARTTLS keys and certificates for servers.
This is a list of four-element list with `servername' (a string),
`port' (an integer), `key' (a filename) and `certificate' (a
filename).
If you do not have a certificate/key pair, leave the `key' and
`certificate' fields as `nil'. A key/certificate pair is only
needed if you want to use X.509 client authenticated
connections."
:type '(repeat (list (string :tag "Server")
(integer :tag "Port")
(file :tag "Key")
(file :tag "Certificate")))
:version "21.1"
:group 'smtpmail)
(defcustom smtpmail-warn-about-unknown-extensions nil
"*If set, print warnings about unknown SMTP extensions.
This is mainly useful for development purposes, to learn about
new SMTP extensions that might be useful to support."
:type 'boolean
:version "21.1"
:group 'smtpmail)
(defvar smtpmail-queue-index-file "index"
"File name of queued mail index.
This is relative to `smtpmail-queue-dir'.")
(defvar smtpmail-address-buffer)
(defvar smtpmail-recipient-address-list)
(defvar smtpmail-queue-counter 0)
;; Buffer-local variable.
(defvar smtpmail-read-point)
(defvar smtpmail-queue-index (concat smtpmail-queue-dir
smtpmail-queue-index-file))
(defconst smtpmail-auth-supported '(cram-md5 plain login)
"List of supported SMTP AUTH mechanisms.")
;;;
;;;
;;;
(defvar smtpmail-mail-address nil
"Value to use for envelope-from address for mail from ambient buffer.")
;;;###autoload
(defun smtpmail-send-it ()
(let ((errbuf (if mail-interactive
(generate-new-buffer " smtpmail errors")
0))
(tembuf (generate-new-buffer " smtpmail temp"))
(case-fold-search nil)
delimline
(mailbuf (current-buffer))
;; Examine this variable now, so that
;; local binding in the mail buffer will take effect.
(smtpmail-mail-address
(or (and mail-specify-envelope-from (mail-envelope-from))
user-mail-address))
(smtpmail-code-conv-from
(if enable-multibyte-characters
(let ((sendmail-coding-system smtpmail-code-conv-from))
(select-message-coding-system)))))
(unwind-protect
(save-excursion
(set-buffer tembuf)
(erase-buffer)
;; Use the same buffer-file-coding-system as in the mail
;; buffer, otherwise any write-region invocations (e.g., in
;; mail-do-fcc below) will annoy with asking for a suitable
;; encoding.
(set-buffer-file-coding-system smtpmail-code-conv-from nil t)
(insert-buffer-substring mailbuf)
(goto-char (point-max))
;; require one newline at the end.
(or (= (preceding-char) ?\n)
(insert ?\n))
;; Change header-delimiter to be what sendmail expects.
(mail-sendmail-undelimit-header)
(setq delimline (point-marker))
;; (sendmail-synch-aliases)
(if mail-aliases
(expand-mail-aliases (point-min) delimline))
(goto-char (point-min))
;; ignore any blank lines in the header
(while (and (re-search-forward "\n\n\n*" delimline t)
(< (point) delimline))
(replace-match "\n"))
(let ((case-fold-search t))
;; We used to process Resent-... headers here,
;; but it was not done properly, and the job
;; is done correctly in smtpmail-deduce-address-list.
;; Don't send out a blank subject line
(goto-char (point-min))
(if (re-search-forward "^Subject:\\([ \t]*\n\\)+\\b" delimline t)
(replace-match "")
;; This one matches a Subject just before the header delimiter.
(if (and (re-search-forward "^Subject:\\([ \t]*\n\\)+" delimline t)
(= (match-end 0) delimline))
(replace-match "")))
;; Put the "From:" field in unless for some odd reason
;; they put one in themselves.
(goto-char (point-min))
(if (not (re-search-forward "^From:" delimline t))
(let* ((login smtpmail-mail-address)
(fullname (user-full-name)))
(cond ((eq mail-from-style 'angles)
(insert "From: " fullname)
(let ((fullname-start (+ (point-min) 6))
(fullname-end (point-marker)))
(goto-char fullname-start)
;; Look for a character that cannot appear unquoted
;; according to RFC 822.
(if (re-search-forward "[^- !#-'*+/-9=?A-Z^-~]"
fullname-end 1)
(progn
;; Quote fullname, escaping specials.
(goto-char fullname-start)
(insert "\"")
(while (re-search-forward "[\"\\]"
fullname-end 1)
(replace-match "\\\\\\&" t))
(insert "\""))))
(insert " <" login ">\n"))
((eq mail-from-style 'parens)
(insert "From: " login " (")
(let ((fullname-start (point)))
(insert fullname)
(let ((fullname-end (point-marker)))
(goto-char fullname-start)
;; RFC 822 says \ and nonmatching parentheses
;; must be escaped in comments.
;; Escape every instance of ()\ ...
(while (re-search-forward "[()\\]" fullname-end 1)
(replace-match "\\\\\\&" t))
;; ... then undo escaping of matching parentheses,
;; including matching nested parentheses.
(goto-char fullname-start)
(while (re-search-forward
"\\(\\=\\|[^\\]\\(\\\\\\\\\\)*\\)\\\\(\\(\\([^\\]\\|\\\\\\\\\\)*\\)\\\\)"
fullname-end 1)
(replace-match "\\1(\\3)" t)
(goto-char fullname-start))))
(insert ")\n"))
((null mail-from-style)
(insert "From: " login "\n")))))
;; Insert a `Message-Id:' field if there isn't one yet.
(goto-char (point-min))
(unless (re-search-forward "^Message-Id:" delimline t)
(insert "Message-Id: " (message-make-message-id) "\n"))
;; Insert a `Date:' field if there isn't one yet.
(goto-char (point-min))
(unless (re-search-forward "^Date:" delimline t)
(insert "Date: " (message-make-date) "\n"))
;; Possibly add a MIME header for the current coding system
(let (charset)
(goto-char (point-min))
(and (eq mail-send-nonascii 'mime)
(not (re-search-forward "^MIME-version:" delimline t))
(progn (skip-chars-forward "\0-\177")
(/= (point) (point-max)))
smtpmail-code-conv-from
(setq charset
(coding-system-get smtpmail-code-conv-from
'mime-charset))
(goto-char delimline)
(insert "MIME-version: 1.0\n"
"Content-type: text/plain; charset="
(symbol-name charset)
"\nContent-Transfer-Encoding: 8bit\n")))
;; Insert an extra newline if we need it to work around
;; Sun's bug that swallows newlines.
(goto-char (1+ delimline))
(if (eval mail-mailer-swallows-blank-line)
(newline))
;; Find and handle any FCC fields.
(goto-char (point-min))
(if (re-search-forward "^FCC:" delimline t)
;; Force mail-do-fcc to use the encoding of the mail
;; buffer to encode outgoing messages on FCC files.
(let ((coding-system-for-write smtpmail-code-conv-from))
(mail-do-fcc delimline)))
(if mail-interactive
(with-current-buffer errbuf
(erase-buffer))))
;;
;;
;;
(setq smtpmail-address-buffer (generate-new-buffer "*smtp-mail*"))
(setq smtpmail-recipient-address-list
(smtpmail-deduce-address-list tembuf (point-min) delimline))
(kill-buffer smtpmail-address-buffer)
(smtpmail-do-bcc delimline)
; Send or queue
(if (not smtpmail-queue-mail)
(if (not (null smtpmail-recipient-address-list))
(if (not (smtpmail-via-smtp
smtpmail-recipient-address-list tembuf))
(error "Sending failed; SMTP protocol error"))
(error "Sending failed; no recipients"))
(let* ((file-data
(expand-file-name
(format "%s_%i"
(format-time-string "%Y-%m-%d_%H:%M:%S")
(setq smtpmail-queue-counter
(1+ smtpmail-queue-counter)))
smtpmail-queue-dir))
(file-data (convert-standard-filename file-data))
(file-elisp (concat file-data ".el"))
(buffer-data (create-file-buffer file-data))
(buffer-elisp (create-file-buffer file-elisp))
(buffer-scratch "*queue-mail*"))
(unless (file-exists-p smtpmail-queue-dir)
(make-directory smtpmail-queue-dir t))
(with-current-buffer buffer-data
(erase-buffer)
(set-buffer-file-coding-system smtpmail-code-conv-from nil t)
(insert-buffer-substring tembuf)
(write-file file-data)
(set-buffer buffer-elisp)
(erase-buffer)
(insert (concat
"(setq smtpmail-recipient-address-list '"
(prin1-to-string smtpmail-recipient-address-list)
")\n"))
(write-file file-elisp)
(set-buffer (generate-new-buffer buffer-scratch))
(insert (concat file-data "\n"))
(append-to-file (point-min)
(point-max)
smtpmail-queue-index)
)
(kill-buffer buffer-scratch)
(kill-buffer buffer-data)
(kill-buffer buffer-elisp))))
(kill-buffer tembuf)
(if (bufferp errbuf)
(kill-buffer errbuf)))))
;;;###autoload
(defun smtpmail-send-queued-mail ()
"Send mail that was queued as a result of setting `smtpmail-queue-mail'."
(interactive)
(with-temp-buffer
;;; Get index, get first mail, send it, update index, get second
;;; mail, send it, etc...
(let ((file-msg ""))
(insert-file-contents smtpmail-queue-index)
(goto-char (point-min))
(while (not (eobp))
(setq file-msg (buffer-substring (point) (line-end-position)))
(load file-msg)
;; Insert the message literally: it is already encoded as per
;; the MIME headers, and code conversions might guess the
;; encoding wrongly.
(with-temp-buffer
(let ((coding-system-for-read 'no-conversion))
(insert-file-contents file-msg))
(let ((smtpmail-mail-address
(or (and mail-specify-envelope-from (mail-envelope-from))
user-mail-address)))
(if (not (null smtpmail-recipient-address-list))
(if (not (smtpmail-via-smtp smtpmail-recipient-address-list
(current-buffer)))
(error "Sending failed; SMTP protocol error"))
(error "Sending failed; no recipients"))))
(delete-file file-msg)
(delete-file (concat file-msg ".el"))
(delete-region (point-at-bol) (point-at-bol 2)))
(write-region (point-min) (point-max) smtpmail-queue-index))))
;(defun smtpmail-via-smtp (host,port,sender,destination,smtpmail-text-buffer)
(defun smtpmail-fqdn ()
(if smtpmail-local-domain
(concat (system-name) "." smtpmail-local-domain)
(system-name)))
(defsubst smtpmail-cred-server (cred)
(nth 0 cred))
(defsubst smtpmail-cred-port (cred)
(nth 1 cred))
(defsubst smtpmail-cred-key (cred)
(nth 2 cred))
(defsubst smtpmail-cred-user (cred)
(nth 2 cred))
(defsubst smtpmail-cred-cert (cred)
(nth 3 cred))
(defsubst smtpmail-cred-passwd (cred)
(nth 3 cred))
(defun smtpmail-find-credentials (cred server port)
(catch 'done
(let ((l cred) el)
(while (setq el (pop l))
(when (and (equal server (smtpmail-cred-server el))
(equal port (smtpmail-cred-port el)))
(throw 'done el))))))
(defun smtpmail-maybe-append-domain (recipient)
(if (or (not smtpmail-sendto-domain)
(string-match "@" recipient))
recipient
(concat recipient "@" smtpmail-sendto-domain)))
(defun smtpmail-intersection (list1 list2)
(let ((result nil))
(dolist (el2 list2)
(when (memq el2 list1)
(push el2 result)))
(nreverse result)))
(defvar starttls-extra-args)
(defvar starttls-extra-arguments)
(defun smtpmail-open-stream (process-buffer host port)
(let ((cred (smtpmail-find-credentials
smtpmail-starttls-credentials host port)))
(if (null (and cred (condition-case ()
(with-no-warnings
(require 'starttls)
(call-process (if starttls-use-gnutls
starttls-gnutls-program
starttls-program)))
(error nil))))
;; The normal case.
(open-network-stream "SMTP" process-buffer host port)
(let* ((cred-key (smtpmail-cred-key cred))
(cred-cert (smtpmail-cred-cert cred))
(starttls-extra-args
(append
starttls-extra-args
(when (and (stringp cred-key) (stringp cred-cert)
(file-regular-p
(setq cred-key (expand-file-name cred-key)))
(file-regular-p
(setq cred-cert (expand-file-name cred-cert))))
(list "--key-file" cred-key "--cert-file" cred-cert))))
(starttls-extra-arguments
(append
starttls-extra-arguments
(when (and (stringp cred-key) (stringp cred-cert)
(file-regular-p
(setq cred-key (expand-file-name cred-key)))
(file-regular-p
(setq cred-cert (expand-file-name cred-cert))))
(list "--x509keyfile" cred-key "--x509certfile" cred-cert)))))
(starttls-open-stream "SMTP" process-buffer host port)))))
(defun smtpmail-try-auth-methods (process supported-extensions host port)
(let* ((mechs (cdr-safe (assoc 'auth supported-extensions)))
(mech (car (smtpmail-intersection smtpmail-auth-supported mechs)))
(cred (if (stringp smtpmail-auth-credentials)
(let* ((netrc (netrc-parse smtpmail-auth-credentials))
(port-name (format "%s" (or port "smtp")))
(hostentry (netrc-machine netrc host port-name
port-name)))
(when hostentry
(list host port
(netrc-get hostentry "login")
(netrc-get hostentry "password"))))
(smtpmail-find-credentials
smtpmail-auth-credentials host port)))
(passwd (when cred
(or (smtpmail-cred-passwd cred)
(read-passwd
(format "SMTP password for %s:%s: "
(smtpmail-cred-server cred)
(smtpmail-cred-port cred))))))
ret)
(when (and cred mech)
(cond
((eq mech 'cram-md5)
(smtpmail-send-command process (upcase (format "AUTH %s" mech)))
(if (or (null (car (setq ret (smtpmail-read-response process))))
(not (integerp (car ret)))
(>= (car ret) 400))
(throw 'done nil))
(when (eq (car ret) 334)
(let* ((challenge (substring (cadr ret) 4))
(decoded (base64-decode-string challenge))
(hash (rfc2104-hash 'md5 64 16 passwd decoded))
(response (concat (smtpmail-cred-user cred) " " hash))
;; Osamu Yamane <yamane@green.ocn.ne.jp>:
;; SMTP auth fails because the SMTP server identifies
;; only the first part of the string (delimited by
;; new line characters) as a response from the
;; client, and the rest as distinct commands.
;; In my case, the response string is 80 characters
;; long. Without the no-line-break option for
;; base64-encode-sting, only the first 76 characters
;; are taken as a response to the server, and the
;; authentication fails.
(encoded (base64-encode-string response t)))
(smtpmail-send-command process (format "%s" encoded))
(if (or (null (car (setq ret (smtpmail-read-response process))))
(not (integerp (car ret)))
(>= (car ret) 400))
(throw 'done nil)))))
((eq mech 'login)
(smtpmail-send-command process "AUTH LOGIN")
(if (or (null (car (setq ret (smtpmail-read-response process))))
(not (integerp (car ret)))
(>= (car ret) 400))
(throw 'done nil))
(smtpmail-send-command
process (base64-encode-string (smtpmail-cred-user cred) t))
(if (or (null (car (setq ret (smtpmail-read-response process))))
(not (integerp (car ret)))
(>= (car ret) 400))
(throw 'done nil))
(smtpmail-send-command process (base64-encode-string passwd t))
(if (or (null (car (setq ret (smtpmail-read-response process))))
(not (integerp (car ret)))
(>= (car ret) 400))
(throw 'done nil)))
((eq mech 'plain)
;; We used to send an empty initial request, and wait for an
;; empty response, and then send the password, but this
;; violate a SHOULD in RFC 2222 paragraph 5.1. Note that this
;; is not sent if the server did not advertise AUTH PLAIN in
;; the EHLO response. See RFC 2554 for more info.
(smtpmail-send-command process
(concat "AUTH PLAIN "
(base64-encode-string
(concat "\0"
(smtpmail-cred-user cred)
"\0"
passwd) t)))
(if (or (null (car (setq ret (smtpmail-read-response process))))
(not (integerp (car ret)))
(not (equal (car ret) 235)))
(throw 'done nil)))
(t
(error "Mechanism %s not implemented" mech)))
;; Remember the password.
(when (and (not (stringp smtpmail-auth-credentials))
(null (smtpmail-cred-passwd cred)))
(setcar (cdr (cdr (cdr cred))) passwd)))))
(defun smtpmail-via-smtp (recipient smtpmail-text-buffer)
(let ((process nil)
(host (or smtpmail-smtp-server
(error "`smtpmail-smtp-server' not defined")))
(port smtpmail-smtp-service)
;; smtpmail-mail-address should be set to the appropriate
;; buffer-local value by the caller, but in case not:
(envelope-from (or smtpmail-mail-address
(and mail-specify-envelope-from
(mail-envelope-from))
user-mail-address))
response-code
greeting
process-buffer
(supported-extensions '()))
(unwind-protect
(catch 'done
;; get or create the trace buffer
(setq process-buffer
(get-buffer-create (format "*trace of SMTP session to %s*" host)))
;; clear the trace buffer of old output
(with-current-buffer process-buffer
(setq buffer-undo-list t)
(erase-buffer))
;; open the connection to the server
(setq process (smtpmail-open-stream process-buffer host port))
(and (null process) (throw 'done nil))
;; set the send-filter
(set-process-filter process 'smtpmail-process-filter)
(with-current-buffer process-buffer
(set-buffer-process-coding-system 'raw-text-unix 'raw-text-unix)
(make-local-variable 'smtpmail-read-point)
(setq smtpmail-read-point (point-min))
(if (or (null (car (setq greeting (smtpmail-read-response process))))
(not (integerp (car greeting)))
(>= (car greeting) 400))
(throw 'done nil)
)
(let ((do-ehlo t)
(do-starttls t))
(while do-ehlo
;; EHLO
(smtpmail-send-command process (format "EHLO %s" (smtpmail-fqdn)))
(if (or (null (car (setq response-code
(smtpmail-read-response process))))
(not (integerp (car response-code)))
(>= (car response-code) 400))
(progn
;; HELO
(smtpmail-send-command
process (format "HELO %s" (smtpmail-fqdn)))
(if (or (null (car (setq response-code
(smtpmail-read-response process))))
(not (integerp (car response-code)))
(>= (car response-code) 400))
(throw 'done nil)))
(dolist (line (cdr (cdr response-code)))
(let ((name
(with-case-table ascii-case-table
(mapcar (lambda (s) (intern (downcase s)))
(split-string (substring line 4) "[ ]")))))
(and (eq (length name) 1)
(setq name (car name)))
(and name
(cond ((memq (if (consp name) (car name) name)
'(verb xvrb 8bitmime onex xone
expn size dsn etrn
enhancedstatuscodes
help xusr
auth=login auth starttls))
(setq supported-extensions
(cons name supported-extensions)))
(smtpmail-warn-about-unknown-extensions
(message "Unknown extension %s" name)))))))
(if (and do-starttls
(smtpmail-find-credentials smtpmail-starttls-credentials host port)
(member 'starttls supported-extensions)
(numberp (process-id process)))
(progn
(smtpmail-send-command process (format "STARTTLS"))
(if (or (null (car (setq response-code (smtpmail-read-response process))))
(not (integerp (car response-code)))
(>= (car response-code) 400))
(throw 'done nil))
(starttls-negotiate process)
(setq do-starttls nil))
(setq do-ehlo nil))))
(smtpmail-try-auth-methods process supported-extensions host port)
(if (or (member 'onex supported-extensions)
(member 'xone supported-extensions))
(progn
(smtpmail-send-command process (format "ONEX"))
(if (or (null (car (setq response-code (smtpmail-read-response process))))
(not (integerp (car response-code)))
(>= (car response-code) 400))
(throw 'done nil))))
(if (and smtpmail-debug-verb
(or (member 'verb supported-extensions)
(member 'xvrb supported-extensions)))
(progn
(smtpmail-send-command process (format "VERB"))
(if (or (null (car (setq response-code (smtpmail-read-response process))))
(not (integerp (car response-code)))
(>= (car response-code) 400))
(throw 'done nil))))
(if (member 'xusr supported-extensions)
(progn
(smtpmail-send-command process (format "XUSR"))
(if (or (null (car (setq response-code (smtpmail-read-response process))))
(not (integerp (car response-code)))
(>= (car response-code) 400))
(throw 'done nil))))
;; MAIL FROM:<sender>
(let ((size-part
(if (or (member 'size supported-extensions)
(assoc 'size supported-extensions))
(format " SIZE=%d"
(with-current-buffer smtpmail-text-buffer
;; size estimate:
(+ (- (point-max) (point-min))
;; Add one byte for each change-of-line
;; because of CR-LF representation:
(count-lines (point-min) (point-max)))))
""))
(body-part
(if (member '8bitmime supported-extensions)
;; FIXME:
;; Code should be added here that transforms
;; the contents of the message buffer into
;; something the receiving SMTP can handle.
;; For a receiver that supports 8BITMIME, this
;; may mean converting BINARY to BASE64, or
;; adding Content-Transfer-Encoding and the
;; other MIME headers. The code should also
;; return an indication of what encoding the
;; message buffer is now, i.e. ASCII or
;; 8BITMIME.
(if nil
" BODY=8BITMIME"
"")
"")))
; (smtpmail-send-command process (format "MAIL FROM:%s@%s" (user-login-name) (smtpmail-fqdn)))
(smtpmail-send-command process (format "MAIL FROM:<%s>%s%s"
envelope-from
size-part
body-part))
(if (or (null (car (setq response-code (smtpmail-read-response process))))
(not (integerp (car response-code)))
(>= (car response-code) 400))
(throw 'done nil)
))
;; RCPT TO:<recipient>
(let ((n 0))
(while (not (null (nth n recipient)))
(smtpmail-send-command process (format "RCPT TO:<%s>" (smtpmail-maybe-append-domain (nth n recipient))))
(setq n (1+ n))
(setq response-code (smtpmail-read-response process))
(if (or (null (car response-code))
(not (integerp (car response-code)))
(>= (car response-code) 400))
(throw 'done nil)
)
))
;; DATA
(smtpmail-send-command process "DATA")
(if (or (null (car (setq response-code (smtpmail-read-response process))))
(not (integerp (car response-code)))
(>= (car response-code) 400))
(throw 'done nil)
)
;; Mail contents
(smtpmail-send-data process smtpmail-text-buffer)
;;DATA end "."
(smtpmail-send-command process ".")
(if (or (null (car (setq response-code (smtpmail-read-response process))))
(not (integerp (car response-code)))
(>= (car response-code) 400))
(throw 'done nil)
)
;;QUIT
; (smtpmail-send-command process "QUIT")
; (and (null (car (smtpmail-read-response process)))
; (throw 'done nil))
t ))
(if process
(with-current-buffer (process-buffer process)
(smtpmail-send-command process "QUIT")
(smtpmail-read-response process)
; (if (or (null (car (setq response-code (smtpmail-read-response process))))
; (not (integerp (car response-code)))
; (>= (car response-code) 400))
; (throw 'done nil)
; )
(delete-process process)
(unless smtpmail-debug-info
(kill-buffer process-buffer)))))))
(defun smtpmail-process-filter (process output)
(with-current-buffer (process-buffer process)
(goto-char (point-max))
(insert output)))
(defun smtpmail-read-response (process)
(let ((case-fold-search nil)
(response-strings nil)
(response-continue t)
(return-value '(nil ()))
match-end)
(catch 'done
(while response-continue
(goto-char smtpmail-read-point)
(while (not (search-forward "\r\n" nil t))
(unless (memq (process-status process) '(open run))
(throw 'done nil))
(accept-process-output process)
(goto-char smtpmail-read-point))
(setq match-end (point))
(setq response-strings
(cons (buffer-substring smtpmail-read-point (- match-end 2))
response-strings))
(goto-char smtpmail-read-point)
(if (looking-at "[0-9]+ ")
(let ((begin (match-beginning 0))
(end (match-end 0)))
(if smtpmail-debug-info
(message "%s" (car response-strings)))
(setq smtpmail-read-point match-end)
;; ignore lines that start with "0"
(if (looking-at "0[0-9]+ ")
nil
(setq response-continue nil)
(setq return-value
(cons (string-to-number
(buffer-substring begin end))
(nreverse response-strings)))))
(if (looking-at "[0-9]+-")
(progn (if smtpmail-debug-info
(message "%s" (car response-strings)))
(setq smtpmail-read-point match-end)
(setq response-continue t))
(progn
(setq smtpmail-read-point match-end)
(setq response-continue nil)
(setq return-value
(cons nil (nreverse response-strings)))))))
(setq smtpmail-read-point match-end))
return-value))
(defun smtpmail-send-command (process command)
(goto-char (point-max))
(if (= (aref command 0) ?P)
(insert "PASS <omitted>\r\n")
(insert command "\r\n"))
(setq smtpmail-read-point (point))
(process-send-string process command)
(process-send-string process "\r\n"))
(defun smtpmail-send-data-1 (process data)
(goto-char (point-max))
(if (and (multibyte-string-p data)
smtpmail-code-conv-from)
(setq data (string-as-multibyte
(encode-coding-string data smtpmail-code-conv-from))))
(if smtpmail-debug-info
(insert data "\r\n"))
(setq smtpmail-read-point (point))
;; Escape "." at start of a line
(if (eq (string-to-char data) ?.)
(process-send-string process "."))
(process-send-string process data)
(process-send-string process "\r\n")
)
(defun smtpmail-send-data (process buffer)
(let ((data-continue t) sending-data)
(with-current-buffer buffer
(goto-char (point-min)))
(while data-continue
(with-current-buffer buffer
(setq sending-data (buffer-substring (point-at-bol) (point-at-eol)))
(end-of-line 2)
(setq data-continue (not (eobp))))
(smtpmail-send-data-1 process sending-data))))
(defun smtpmail-deduce-address-list (smtpmail-text-buffer header-start header-end)
"Get address list suitable for smtp RCPT TO: <address>."
(unwind-protect
(with-current-buffer smtpmail-address-buffer
(erase-buffer)
(let
((case-fold-search t)
(simple-address-list "")
this-line
this-line-end
addr-regexp)
(insert-buffer-substring smtpmail-text-buffer header-start header-end)
(goto-char (point-min))
;; RESENT-* fields should stop processing of regular fields.
(save-excursion
(setq addr-regexp
(if (re-search-forward "^Resent-\\(to\\|cc\\|bcc\\):"
header-end t)
"^Resent-\\(to\\|cc\\|bcc\\):"
"^\\(To:\\|Cc:\\|Bcc:\\)")))
(while (re-search-forward addr-regexp header-end t)
(replace-match "")
(setq this-line (match-beginning 0))
(forward-line 1)
;; get any continuation lines
(while (and (looking-at "^[ \t]+") (< (point) header-end))
(forward-line 1))
(setq this-line-end (point-marker))
(setq simple-address-list
(concat simple-address-list " "
(mail-strip-quoted-names (buffer-substring this-line this-line-end))))
)
(erase-buffer)
(insert " " simple-address-list "\n")
(subst-char-in-region (point-min) (point-max) 10 ? t);; newline --> blank
(subst-char-in-region (point-min) (point-max) ?, ? t);; comma --> blank
(subst-char-in-region (point-min) (point-max) 9 ? t);; tab --> blank
(goto-char (point-min))
;; tidyness in case hook is not robust when it looks at this
(while (re-search-forward "[ \t]+" header-end t) (replace-match " "))
(goto-char (point-min))
(let (recipient-address-list)
(while (re-search-forward " \\([^ ]+\\) " (point-max) t)
(backward-char 1)
(setq recipient-address-list (cons (buffer-substring (match-beginning 1) (match-end 1))
recipient-address-list))
)
(setq smtpmail-recipient-address-list recipient-address-list))
)
)
)
)
(defun smtpmail-do-bcc (header-end)
"Delete [Resent-]BCC: and their continuation lines from the header area.
There may be multiple BCC: lines, and each may have arbitrarily
many continuation lines."
(let ((case-fold-search t))
(save-excursion
(goto-char (point-min))
;; iterate over all BCC: lines
(while (re-search-forward "^\\(RESENT-\\)?BCC:" header-end t)
(delete-region (match-beginning 0)
(progn (forward-line 1) (point)))
;; get rid of any continuation lines
(while (and (looking-at "^[ \t].*\n") (< (point) header-end))
(replace-match ""))))))
(provide 'smtpmail)
;;; arch-tag: a76992df-6d71-43b7-9e72-4bacc6c05466
;;; smtpmail.el ends here
2008-02-13 20:58:26 +00:00