- (if (search-forward (nnbabyl-article-string (car articles)) nil t)
- (if (setq is-old
- (nnmail-expired-article-p
- newsgroup
- (buffer-substring
- (point) (progn (end-of-line) (point))) force))
- (progn
- (nnheader-message 5 "Deleting article %d in %s..."
- (car articles) newsgroup)
- (nnbabyl-delete-mail))
- (setq rest (cons (car articles) rest))))
+ (when (search-forward (nnbabyl-article-string (car articles)) nil t)
+ (if (setq is-old
+ (nnmail-expired-article-p
+ newsgroup
+ (buffer-substring
+ (point) (progn (end-of-line) (point))) force))
+ (progn
+ (unless (eq nnmail-expiry-target 'delete)
+ (with-temp-buffer
+ (nnbabyl-request-article (car articles)
+ newsgroup server
+ (current-buffer))
+ (let ((nnml-current-directory nil))
+ (nnmail-expiry-target-group
+ nnmail-expiry-target newsgroup)))
+ (nnbabyl-possibly-change-newsgroup newsgroup server))
+ (nnheader-message 5 "Deleting article %d in %s..."
+ (car articles) newsgroup)
+ (nnbabyl-delete-mail))
+ (push (car articles) rest)))