/* Support for IMAP4rev1, with the occasional nod to IMAP 4. */
#include <lib-lib/lib-lib.h>
/* Support for IMAP4rev1, with the occasional nod to IMAP 4. */
#include <lib-lib/lib-lib.h>
fputc (c, fp);
if (bar && !(pos % 1024))
mutt_progress_bar (bar, pos);
fputc (c, fp);
if (bar && !(pos % 1024))
mutt_progress_bar (bar, pos);
if (idata->state == IMAP_CONNECTED) {
if (!imap_authenticate (idata)) {
idata->state = IMAP_AUTHENTICATED;
if (idata->state == IMAP_CONNECTED) {
if (!imap_authenticate (idata)) {
idata->state = IMAP_AUTHENTICATED;
/* TODO: Parse new tagged CAPABILITY data (* OK [CAPABILITY...]) */
if (imap_check_capabilities (idata))
goto bail;
/* TODO: Parse new tagged CAPABILITY data (* OK [CAPABILITY...]) */
if (imap_check_capabilities (idata))
goto bail;
/* Attempt STARTTLS if available and desired. */
if (!idata->conn->ssf && (option(OPTSSLFORCETLS) ||
mutt_bit_isset (idata->capabilities, STARTTLS))) {
/* Attempt STARTTLS if available and desired. */
if (!idata->conn->ssf && (option(OPTSSLFORCETLS) ||
mutt_bit_isset (idata->capabilities, STARTTLS))) {
}
else if (ascii_strncasecmp ("* PREAUTH", idata->cmd.buf, 9) == 0) {
idata->state = IMAP_AUTHENTICATED;
}
else if (ascii_strncasecmp ("* PREAUTH", idata->cmd.buf, 9) == 0) {
idata->state = IMAP_AUTHENTICATED;
/* fire off command */
snprintf (buf, sizeof (buf), "%s \"\" \"%s%%\"",
/* fire off command */
snprintf (buf, sizeof (buf), "%s \"\" \"%s%%\"",
CONTEXT * dest __attribute__ ((unused)),
HEADER * hdr __attribute__ ((unused)))
{
CONTEXT * dest __attribute__ ((unused)),
HEADER * hdr __attribute__ ((unused)))
{
- 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(MCore.tmpdir), NULL);
+ if (!msg->fp) {
+ mutt_perror(tmp);
+ return -1;
+ }
+
+ msg->path = m_strdup(tmp);
+ return 0;