if (idata->state == IMAP_CONNECTED) {
if (!imap_authenticate (idata)) {
idata->state = IMAP_AUTHENTICATED;
- }
- else
+ } else {
mutt_account_unsetpass (&idata->conn->account);
+ }
p_delete(&idata->capstr);
}
CONTEXT * dest __attribute__ ((unused)),
HEADER * hdr __attribute__ ((unused)))
{
- char tmp[_POSIX_PATH_MAX];
+ char tmp[_POSIX_PATH_MAX];
- mutt_mktemp (tmp);
- if ((msg->fp = safe_fopen (tmp, "w")) == NULL) {
- mutt_perror (tmp);
- return (-1);
- }
- msg->path = m_strdup(tmp);
- return 0;
+ msg->fp = m_tempfile(tmp, sizeof(tmp), NONULL(Tempdir), NULL);
+ if (!msg->fp) {
+ mutt_perror(tmp);
+ return -1;
+ }
+
+ msg->path = m_strdup(tmp);
+ return 0;
}
/* this ugly kludge is required since the last int to