;;; Code:
+(eval-when-compile (require 'cl))
(require 'mail-utils)
(defvar parse-time-months)
(pop3-write-to-file file)
(unless pop3-leave-mail-on-server
(pop3-send-streaming-command
- process "DELE" message-count nil))
- (pop3-quit process)))))
+ process "DELE" message-count nil))))
+ (pop3-quit process)
+ t))
(defun pop3-send-streaming-command (process command count total-size)
(erase-buffer)
(let ((i 1))
- (while (>= (1+ count) i)
+ (while (>= count i)
(process-send-string process (format "%s %d\r\n" command i))
;; Only do 100 messages at a time to avoid pipe stalls.
(when (zerop (% i 100))
;; delete it.
(when (eolp)
(delete-char 1))
- (write-region (point-min) (point-max) file)))))
+ (write-region (point-min) (point-max) file nil 'nomesg)))))
(defun pop3-number-of-responses (endp)
(let ((responses 0))
(save-excursion
(goto-char (point-min))
- (while (or (and (re-search-forward "^\\+OK " nil t)
+ (while (or (and (re-search-forward "^\\+OK" nil t)
(or (not endp)
(re-search-forward "^\\.\r?\n" nil t)))
(re-search-forward "^-ERR " nil t))
(const :tag "SSL/TLS" ssl)
(const starttls)))
+(eval-and-compile
+ (if (fboundp 'set-process-query-on-exit-flag)
+ (defalias 'pop3-set-process-query-on-exit-flag
+ 'set-process-query-on-exit-flag)
+ (defalias 'pop3-set-process-query-on-exit-flag
+ 'process-kill-without-query)))
+
(defun pop3-open-server (mailhost port)
"Open TCP connection to MAILHOST on PORT.
Returns the process associated with the connection."
(setq pop3-timestamp
(substring response (or (string-match "<" response) 0)
(+ 1 (or (string-match ">" response) -1)))))
- (set-process-query-on-exit-flag process nil)
+ (pop3-set-process-query-on-exit-flag process nil)
process)))
;; Support functions