Spelling fixes.
[bpt/emacs.git] / lisp / mail / feedmail.el
index 3ef8a6c..7167fa5 100644 (file)
@@ -13,9 +13,8 @@
 ;; A replacement for parts of Emacs' sendmail.el (specifically,
 ;; it's what handles your outgoing mail after you hit C-c C-c in mail
 ;; mode).  See below for a list of additional features, including the
-;; ability to queue messages for later sending.  If you are using
-;; fakemail as a subprocess, you can switch to feedmail and eliminate
-;; the use of fakemail.
+;; ability to queue messages for later sending.  This replaces
+;; the standalone fakemail program that used to be distributed with Emacs.
 
 ;; feedmail works with recent versions of Emacs (20.x series) and
 ;; XEmacs (tested with 20.4 and later betas).  It probably no longer
 ;; work properly.  If you don't know what custom is all about and want
 ;; to edit your user option elisp variables the old fashioned way,
 ;; just imagine that all the "defcustom" stuff you see below is really
-;; "defvar", and ignore everthing else.  For info about custom, see
+;; "defvar", and ignore everything else.  For info about custom, see
 ;; <URL:http://www.dina.kvl.dk/~abraham/custom/>.
 ;;
 ;; This code does in elisp a superset of the stuff that used to be done
 ;; by the separate program "fakemail" for processing outbound email.
 ;; In other words, it takes over after you hit "C-c C-c" in mail mode.
-;; By appropriate setting of options, you can still use "fakemail",
-;; or you can even revert to sendmail (which is not too popular
-;; locally).  See the variables at the top of the elisp for how to
-;; achieve these effects (there are more features than in this bullet
-;; list, so trolling through the variable and function doc strings may
-;; be worth your while):
+;; By appropriate setting of options, you can even revert to sendmail
+;; (which is not too popular locally).  See the variables at the top
+;; of the elisp for how to achieve these effects (there are more
+;; features than in this bullet list, so trolling through the variable
+;; and function doc strings may be worth your while):
 ;;
 ;;    --- you can park outgoing messages into a disk-based queue and
 ;;        stimulate sending them all later (handy for laptop users);
 ;;           for FQM files if you're a VM user
 ;;         change buffer-substring calls to buffer-substring-no-properties for
 ;;           speed-up (suggested by Howard Melman <howard@silverstream.com>)
-;;         feedmail-sendmail-f-doesnt-sell-me-out to contol "-f" in call to sendmail
+;;         feedmail-sendmail-f-doesnt-sell-me-out to control "-f" in call to sendmail
 ;;           in feedmail-buffer-to-sendmail
 ;;         better trapping of odd conditions during the running of the queue;
 ;;           thanks to Yigal Hochberg for helping me test much of this by remote
 ;;           systems with non-classic /bin/[r]mail behavior
 ;;         guard against nil user-mail-address in generating MESSAGE-ID:
 ;;         feedmail-queue-slug-suspect-regexp is now a variable to
-;;           accomodate non-ASCII environments (thanks to
+;;           accommodate non-ASCII environments (thanks to
 ;;           Makoto.Nakagawa@jp.compaq.com for this suggestion)
 ;;         feedmail-buffer-to-smtp, to parallel feedmail-buffer-to-smtpmail
 ;; patchlevel 10, 22 April 2001
@@ -1012,7 +1010,7 @@ If it contains a \"%s\", that will be replaced with the value of
 
 
 (defcustom feedmail-ask-before-queue-reprompt "FQM: Please type q, i, d, or e; or ? for help [%s]: "
-  "A string which will be used for repompting after invalid input.
+  "A string which will be used for reprompting after invalid input.
 If it contains a \"%s\", that will be replaced with the value of
 `feedmail-ask-before-queue-default'."
   :group 'feedmail-queue
@@ -1358,7 +1356,7 @@ for you.  Add this function to `mail-send-hook' with something like this:
        (add-hook 'mail-send-hook 'feedmail-mail-send-hook-splitter)
 
 Then add the functions you want called to either `feedmail-mail-send-hook-queued'
-or `feedmail-mail-send-hook', as apprpriate.  The distinction is that
+or `feedmail-mail-send-hook', as appropriate.  The distinction is that
 `feedmail-mail-send-hook' will be called when you send mail from a composition
 buffer (typically by typing C-c C-c), whether the message is sent immediately
 or placed in the queue or drafts directory.  `feedmail-mail-send-hook-queued' is
@@ -1439,7 +1437,7 @@ internal buffers will be reused and things will get confused."
   )
 
 (defcustom feedmail-queue-runner-mode-setter
-  '(lambda (&optional arg) (mail-mode))
+  (lambda (&optional arg) (mail-mode))
   "A function to set the proper mode of a message file.
 Called when the message is read back out of the queue directory with a single
 argument, the optional argument used in the call to
@@ -1475,7 +1473,7 @@ set `mail-header-separator' to the value of
 
 
 (defcustom feedmail-queue-runner-message-sender
-  '(lambda (&optional arg) (mail-send))
+  (lambda (&optional arg) (mail-send))
   "Function to initiate sending a message file.
 Called for each message read back out of the queue directory with a
 single argument, the optional argument used in the call to
@@ -1493,7 +1491,7 @@ you really don't need that.  Called with funcall, not call-interactively."
 
 
 (defcustom feedmail-queue-runner-cleaner-upper
-  '(lambda (fqm-file &optional arg)
+  (lambda (fqm-file &optional arg)
      (delete-file fqm-file)
      (if arg (feedmail-say-chatter "Nuked %s" fqm-file)))
   "Function that will be called after a message has been sent.
@@ -1635,22 +1633,21 @@ local gurus."
   ;; no evil.
   (feedmail-say-debug ">in-> feedmail-buffer-to-smtpmail %s" addr-listoid)
   (require 'smtpmail)
-  (if (not (smtpmail-via-smtp addr-listoid prepped))
-      (progn
-       (set-buffer errors-to)
-       (insert "Send via smtpmail failed.  Probable SMTP protocol error.\n")
-       (insert "Look for details below or in the *Messages* buffer.\n\n")
-       (let ((case-fold-search t)
-             ;; don't be overconfident about the name of the trace buffer
-             (tracer (concat "trace.*smtp.*" (regexp-quote smtpmail-smtp-server))))
-         (mapcar
-          '(lambda (buffy)
-             (if (string-match tracer (buffer-name buffy))
-                 (progn
-                   (insert "SMTP Trace from " (buffer-name buffy) "\n---------------")
-                   (insert-buffer-substring buffy)
-                   (insert "\n\n"))))
-          (buffer-list))))))
+  (let ((result (smtpmail-via-smtp addr-listoid prepped)))
+    (when result
+      (set-buffer errors-to)
+      (insert "Send via smtpmail failed: %s" result)
+      (let ((case-fold-search t)
+           ;; don't be overconfident about the name of the trace buffer
+           (tracer (concat "trace.*smtp.*" (regexp-quote smtpmail-smtp-server))))
+       (mapcar
+        (lambda (buffy)
+          (if (string-match tracer (buffer-name buffy))
+              (progn
+                (insert "SMTP Trace from " (buffer-name buffy) "\n---------------")
+                (insert-buffer-substring buffy)
+                (insert "\n\n"))))
+        (buffer-list))))))
 
 (declare-function smtp-via-smtp "ext:smtp" (sender recipients smtp-text-buffer))
 (defvar smtp-server)
@@ -1669,7 +1666,7 @@ local gurus."
                          ;; don't be overconfident about the name of the trace buffer
                          (tracer (concat "trace.*smtp.*" (regexp-quote smtp-server))))
                  (mapcar
-                  '(lambda (buffy)
+                  (lambda (buffy)
                          (if (string-match tracer (buffer-name buffy))
                                  (progn
                                        (insert "SMTP Trace from " (buffer-name buffy) "\n---------------")
@@ -1998,7 +1995,7 @@ backup file names and the like)."
        (if feedmail-queue-run-orderer
            (setq list-of-possible-fqms (funcall feedmail-queue-run-orderer list-of-possible-fqms)))
        (mapc
-        '(lambda (blobby)
+        (lambda (blobby)
            (setq maybe-file (expand-file-name blobby feedmail-queue-directory))
            (cond
             ((file-directory-p maybe-file) nil) ; don't care about subdirs
@@ -2191,7 +2188,7 @@ you can set `feedmail-queue-reminder-alist' to nil."
            (if (or (eq user-sez ?\C-m) (eq user-sez ?\C-j) (eq user-sez ?y))
                (setq user-sez d-char))
            ;; these char-to-int things are because of some
-           ;; incomprensible difference between the two in
+           ;; incomprehensible difference between the two in
            ;; byte-compiled stuff between Emacs and XEmacs
            ;; (well, I'm sure someone could comprehend it,
            ;; but I say 'uncle')
@@ -2240,7 +2237,7 @@ the counts."
     ;; iterate, counting things we find along the way in the directory
     (if (file-directory-p queue-directory)
        (mapc
-        '(lambda (blobby)
+        (lambda (blobby)
            (cond
             ((file-directory-p blobby) nil) ; don't care about subdirs
             ((feedmail-fqm-p blobby)
@@ -2264,9 +2261,9 @@ the counts."
   (while (string-match feedmail-queue-slug-suspect-regexp slug) (setq slug (replace-match "-" nil nil slug)))
   ;; collapse multiple hyphens to one
   (while (string-match "--+" slug) (setq slug (replace-match "-" nil nil slug)))
-  ;; for tidyness, peel off leading hyphens
+  ;; for tidiness, peel off leading hyphens
   (if (string-match "^-*" slug) (setq slug (replace-match "" nil nil slug)))
-  ;; for tidyness, peel off trailing hyphens
+  ;; for tidiness, peel off trailing hyphens
   (if (string-match "-*$" slug) (setq slug (replace-match "" nil nil slug)))
   slug
   )
@@ -2413,7 +2410,7 @@ mapped to mostly alphanumerics for safety."
        (a-re-dtcb  "^\\(To\\|Cc\\|Bcc\\):")
        (a-re-dtc   "^\\(To\\|Cc\\):")
        (a-re-db    "^Bcc:")
-       ;; to get a temporary changable copy
+       ;; to get a temporary changeable copy
        (mail-header-separator mail-header-separator)
        )
     (unwind-protect
@@ -2667,7 +2664,7 @@ fiddle-plex, as described in the documentation for the variable
   (save-excursion
     (if feedmail-enable-spray
        (mapcar
-        '(lambda (feedmail-spray-this-address)
+        (lambda (feedmail-spray-this-address)
            (let ((spray-buffer (get-buffer-create " *FQM Outgoing Email Spray*")))
              (with-current-buffer spray-buffer
                (erase-buffer)