(mime-library-product): Update to FLIM 1.14.0 (Ninokuchi).
[elisp/flim.git] / smtp.el
diff --git a/smtp.el b/smtp.el
index c2c9937..27a0b99 100644 (file)
--- a/smtp.el
+++ b/smtp.el
@@ -1,10 +1,10 @@
 ;;; smtp.el --- basic functions to send mail with SMTP server
 
-;; Copyright (C) 1995, 1996, 1998 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1996, 1998, 1999 Free Software Foundation, Inc.
 
 ;; Author: Tomoji Kagatani <kagatani@rbc.ncl.omron.co.jp>
 ;;         Simon Leinen <simon@switch.ch> (ESMTP support)
-;;         Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp>
+;;         Shuhei KOBAYASHI <shuhei@aqua.ocn.ne.jp>
 ;; Keywords: SMTP, mail
 
 ;; This file is part of FLIM (Faithful Library about Internet Message).
 ;; 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
+;; along with this program; see the file COPYING.  If not, write to the
 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 ;; Boston, MA 02111-1307, USA.
 
 ;;; Code:
 
-(require 'mail-utils) ; pick up mail-strip-quoted-names
+(require 'poe)
+(require 'poem)
+(require 'pcustom)
+(require 'mail-utils)                  ; mail-strip-quoted-names
+
+(eval-when-compile (require 'cl))      ; push
 
 (defgroup smtp nil
   "SMTP protocol for sending mail."
@@ -62,7 +67,17 @@ don't define this value."
   :type '(choice (const nil) string)
   :group 'smtp)
 
-(defvar smtp-debug-info nil)
+(defcustom smtp-debug-info nil
+  "*smtp debug info printout. messages and process buffer."
+  :type 'boolean
+  :group 'smtp)
+
+(defcustom smtp-notify-success nil
+  "*If non-nil, notification for successful mail delivery is returned 
+ to user (RFC1891)."
+  :type 'boolean
+  :group 'smtp)
 (defvar smtp-read-point nil)
 
 (defun smtp-make-fqdn ()
@@ -193,7 +208,11 @@ don't define this value."
            ;; RCPT TO:<recipient>
            (while recipients
              (smtp-send-command process
-                                (format "RCPT TO:<%s>" (car recipients)))
+                                (format
+                                 (if smtp-notify-success
+                                     "RCPT TO:<%s> NOTIFY=SUCCESS" 
+                                   "RCPT TO:<%s>")
+                                 (car recipients)))
              (setq recipients (cdr recipients))
              (setq response (smtp-read-response process))
              (if (or (null (car response))
@@ -329,8 +348,7 @@ don't define this value."
 
 (defun smtp-deduce-address-list (smtp-text-buffer header-start header-end)
   "Get address list suitable for smtp RCPT TO:<address>."
-  (let ((case-fold-search t)
-       (simple-address-list "")
+  (let ((simple-address-list "")
        this-line
        this-line-end
        addr-regexp
@@ -339,6 +357,7 @@ don't define this value."
        (save-excursion
          ;;
          (set-buffer smtp-address-buffer)
+         (setq case-fold-search t)
          (erase-buffer)
          (insert (save-excursion
                    (set-buffer smtp-text-buffer)