Synch up with main trunk, and prepare the release 2.12.0.
[elisp/wanderlust.git] / wl / wl-draft.el
index 345ad6c..ce725e6 100644 (file)
@@ -152,15 +152,10 @@ e.g.
                 "\n"
               smtp-end-of-line))
            smtp-sasl-user-name smtp-sasl-properties sasl-read-passphrase)
-       (if (and (string= (car smtp-sasl-mechanisms) "DIGEST-MD5")
-               ;; sendmail bug?
-               (string-match "^\\([^@]*\\)@\\([^@]*\\)"
-                             wl-smtp-posting-user))
-          (setq smtp-sasl-user-name (match-string 1 wl-smtp-posting-user)
-                smtp-sasl-properties (list 'realm
-                                           (match-string 2 wl-smtp-posting-user)))
-        (setq smtp-sasl-user-name wl-smtp-posting-user
-              smtp-sasl-properties nil))
+       (setq smtp-sasl-user-name wl-smtp-posting-user
+            smtp-sasl-properties (when wl-smtp-authenticate-realm
+                                   (list 'realm
+                                         wl-smtp-authenticate-realm)))
        (setq sasl-read-passphrase
             (function
              (lambda (prompt)
@@ -1367,7 +1362,8 @@ If KILL-WHEN-DONE is non-nil, current draft buffer is killed"
            ;; If flag is set after send-function, the current mailbox
            ;; might changed by Fcc.
            ;; It causes a huge loss in the IMAP folder.
-           (when (and parent-flag parent-number parent-folder)
+           (when (and parent-flag parent-number
+                      (not (eq (length parent-folder) 0)))
              (wl-folder-set-persistent-mark
               parent-folder parent-number parent-flag))
            (funcall wl-draft-send-function editing-buffer kill-when-done)