emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/mail/smtpmail.el [lexbind]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/mail/smtpmail.el [lexbind]
Date: Tue, 14 Oct 2003 19:39:44 -0400

Index: emacs/lisp/mail/smtpmail.el
diff -c emacs/lisp/mail/smtpmail.el:1.44.2.1 
emacs/lisp/mail/smtpmail.el:1.44.2.2
*** emacs/lisp/mail/smtpmail.el:1.44.2.1        Fri Apr  4 01:20:27 2003
--- emacs/lisp/mail/smtpmail.el Tue Oct 14 19:39:25 2003
***************
*** 1,6 ****
  ;;; smtpmail.el --- simple SMTP protocol (RFC 821) for sending mail
  
! ;; Copyright (C) 1995, 1996, 2001, 2002 Free Software Foundation, Inc.
  
  ;; Author: Tomoji Kagatani <address@hidden>
  ;; Maintainer: Simon Josefsson <address@hidden>
--- 1,6 ----
  ;;; smtpmail.el --- simple SMTP protocol (RFC 821) for sending mail
  
! ;; Copyright (C) 1995, 1996, 2001, 2002, 2003 Free Software Foundation, Inc.
  
  ;; Author: Tomoji Kagatani <address@hidden>
  ;; Maintainer: Simon Josefsson <address@hidden>
***************
*** 212,218 ****
  ;;;
  
  (defvar smtpmail-mail-address nil
!   "Value of `user-mail-address' in ambient buffer.")
  
  ;;;###autoload
  (defun smtpmail-send-it ()
--- 212,218 ----
  ;;;
  
  (defvar smtpmail-mail-address nil
!   "Value to use for envelope-from address for mail from ambient buffer.")
  
  ;;;###autoload
  (defun smtpmail-send-it ()
***************
*** 223,229 ****
        (case-fold-search nil)
        delimline
        (mailbuf (current-buffer))
!       (smtpmail-mail-address user-mail-address)
        (smtpmail-code-conv-from
         (if enable-multibyte-characters
             (let ((sendmail-coding-system smtpmail-code-conv-from))
--- 223,233 ----
        (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))
***************
*** 354,359 ****
--- 358,365 ----
                   (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)
                (insert-buffer tembuf)
***************
*** 397,410 ****
        (with-temp-buffer
          (let ((coding-system-for-read 'no-conversion))
            (insert-file-contents file-msg))
!         (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"))
!       (kill-line 1))
        (write-region (point-min) (point-max) smtpmail-queue-index))))
  
  ;(defun smtpmail-via-smtp (host,port,sender,destination,smtpmail-text-buffer)
--- 403,419 ----
        (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)
***************
*** 457,463 ****
    (let ((cred (smtpmail-find-credentials
               smtpmail-starttls-credentials host port)))
      (if (null (and cred (condition-case ()
!                           (call-process "starttls")
                          (error nil))))
        ;; The normal case.
        (open-network-stream "SMTP" process-buffer host port)
--- 466,474 ----
    (let ((cred (smtpmail-find-credentials
               smtpmail-starttls-credentials host port)))
      (if (null (and cred (condition-case ()
!                           (progn
!                             (require 'starttls)
!                             (call-process starttls-program))
                          (error nil))))
        ;; The normal case.
        (open-network-stream "SMTP" process-buffer host port)
***************
*** 541,549 ****
        (host (or smtpmail-smtp-server
                  (error "`smtpmail-smtp-server' not defined")))
        (port smtpmail-smtp-service)
!       (envelope-from (or (mail-envelope-from)
!                          smtpmail-mail-address
!                          user-mail-address))
        response-code
        greeting
        process-buffer
--- 552,563 ----
        (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
***************
*** 657,663 ****
                          (>= (car response-code) 400))
                      (throw 'done nil))))
  
!           ;; MAIL FROM: <sender>
            (let ((size-part
                   (if (or (member 'size supported-extensions)
                           (assoc 'size supported-extensions))
--- 671,677 ----
                          (>= (car response-code) 400))
                      (throw 'done nil))))
  
!           ;; MAIL FROM:<sender>
            (let ((size-part
                   (if (or (member 'size supported-extensions)
                           (assoc 'size supported-extensions))
***************
*** 692,699 ****
                         "")
                     "")))
  ;           (smtpmail-send-command process (format "MAIL FROM:address@hidden" 
(user-login-name) (smtpmail-fqdn)))
!             (smtpmail-send-command process (format "MAIL FROM: <%s>%s%s"
!                                                    envelope-from
                                                     size-part
                                                     body-part))
  
--- 706,713 ----
                         "")
                     "")))
  ;           (smtpmail-send-command process (format "MAIL FROM:address@hidden" 
(user-login-name) (smtpmail-fqdn)))
!             (smtpmail-send-command process (format "MAIL FROM:<%s>%s%s"
!                                                      envelope-from
                                                     size-part
                                                     body-part))
  
***************
*** 703,712 ****
                  (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))
--- 717,726 ----
                  (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))
***************
*** 946,949 ****
--- 960,964 ----
  
  (provide 'smtpmail)
  
+ ;;; arch-tag: a76992df-6d71-43b7-9e72-4bacc6c05466
  ;;; smtpmail.el ends here




reply via email to

[Prev in Thread] Current Thread [Next in Thread]