/* open the stream only if we didn't get here from
mailbox_save_init() */
hdr = mail_index_get_header(_mail->box->view);
- if (_mail->uid != 0 && _mail->uid < hdr->next_uid)
+ if (!_mail->saving && _mail->uid < hdr->next_uid)
(void)mail_get_stream(_mail, NULL, NULL, &input);
}
}
if (stp == NULL)
return -1;
*st = *stp;
- } else if (mail->uid != 0) {
+ } else if (!mail->saving) {
imail->mail.stats_stat_lookup_count++;
ret = maildir_file_do(mbox, mail->uid, do_stat, st);
if (ret <= 0) {
enum maildir_uidlist_rec_ext_key key;
const char *path, *fname, *value;
- if (_mail->uid != 0) {
+ if (!_mail->saving) {
if (maildir_mail_get_fname(mbox, _mail, &fname) <= 0)
return -1;
} else {
return 1;
/* size can be included in uidlist entry */
- if (_mail->uid != 0) {
+ if (!_mail->saving) {
key = vsize ? MAILDIR_UIDLIST_REC_EXT_VSIZE :
MAILDIR_UIDLIST_REC_EXT_PSIZE;
value = maildir_uidlist_lookup_ext(mbox->uidlist, _mail->uid,
return 0;
}
- if (_mail->uid != 0) {
+ if (!_mail->saving) {
ret = maildir_file_do(mbox, _mail->uid, do_stat, &st);
if (ret <= 0) {
if (ret == 0)
*value_r = mail->data.guid;
return 0;
}
- if (_mail->uid != 0) {
+ if (!_mail->saving) {
if (maildir_mail_get_fname(mbox, _mail, &fname) <= 0)
return -1;
} else {
in such situation we're probably checking if the user-given input
looks compressed */
if (imail->data.stream != NULL ||
- (_mail->uid == 0 && zuser->save_handler == NULL)) {
+ (_mail->saving && zuser->save_handler == NULL)) {
return zmail->super.get_stream(_mail, hdr_size, body_size,
stream_r);
}