X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=pop%2Fpop.c;h=572c79e4463a9e1891b7e6d92b515412d9bce6e7;hb=334faeb80904ba5b8ced869abfea2731440d52e5;hp=365b772522ea231700675babfe9f548729f77133;hpb=ae0ce4dfcafa0c3820f107c5bfa8bd06e5272b57;p=apps%2Fmadmutt.git diff --git a/pop/pop.c b/pop/pop.c index 365b772..572c79e 100644 --- a/pop/pop.c +++ b/pop/pop.c @@ -11,21 +11,21 @@ # include "config.h" #endif +#include +#include + #include #include #include #include +#include + +#include #include "mutt.h" #include "mx.h" #include "pop.h" -#include "mutt_crypt.h" -#include "mutt_curses.h" - -#include "lib/debug.h" - -#include -#include +#include /* write line to file */ static int fetch_message (char *line, void *file) @@ -142,7 +142,7 @@ static int fetch_uidl (char *line, void *data) mx_alloc_memory (ctx); ctx->msgcount++; - ctx->hdrs[i] = mutt_new_header (); + ctx->hdrs[i] = header_new(); ctx->hdrs[i]->data = m_strdup(line); } else if (ctx->hdrs[i]->index != index - 1) @@ -217,7 +217,7 @@ static int pop_fetch_headers (CONTEXT * ctx) if (ret != PQ_OK) { for (i = ctx->msgcount; i < new_count; i++) - mutt_free_header (&ctx->hdrs[i]); + header_delete(&ctx->hdrs[i]); return ret; } @@ -409,7 +409,7 @@ int pop_fetch_message (MESSAGE * msg, CONTEXT * ctx, int msgno) cache->path = m_strdup(path); rewind (msg->fp); uidl = h->data; - mutt_free_envelope (&h->env); + envelope_delete(&h->env); h->env = mutt_read_rfc822_header (msg->fp, h, 0, 0); h->data = uidl; h->lines = 0; @@ -422,8 +422,7 @@ int pop_fetch_message (MESSAGE * msg, CONTEXT * ctx, int msgno) h->content->length = ftello (msg->fp) - h->content->offset; /* This needs to be done in case this is a multipart message */ - if (!WithCrypto) - h->security = crypt_query (h->content); + h->security = crypt_query (h->content); mutt_clear_error (); rewind (msg->fp); @@ -455,7 +454,7 @@ pop_query_status pop_sync_mailbox (CONTEXT * ctx, int unused, int *index_hint) } if (ret == PQ_OK) { - strfcpy (buf, "QUIT\r\n", sizeof (buf)); + m_strcpy(buf, sizeof(buf), "QUIT\r\n"); ret = pop_query (pop_data, buf, sizeof (buf)); } @@ -558,7 +557,7 @@ void pop_fetch_mail (void) mutt_message _("Checking for new messages..."); /* find out how many messages are in the mailbox. */ - strfcpy (buffer, "STAT\r\n", sizeof (buffer)); + m_strcpy(buffer, sizeof(buffer), "STAT\r\n"); ret = pop_query (pop_data, buffer, sizeof (buffer)); if (ret == PQ_NOT_CONNECTED) goto fail; @@ -571,7 +570,7 @@ void pop_fetch_mail (void) /* only get unread messages */ if (msgs > 0 && option (OPTPOPLAST)) { - strfcpy (buffer, "LAST\r\n", sizeof (buffer)); + m_strcpy(buffer, sizeof(buffer), "LAST\r\n"); ret = pop_query (pop_data, buffer, sizeof (buffer)); if (ret == PQ_NOT_CONNECTED) goto fail; @@ -640,14 +639,14 @@ void pop_fetch_mail (void) if (rset) { /* make sure no messages get deleted */ - strfcpy (buffer, "RSET\r\n", sizeof (buffer)); + m_strcpy(buffer, sizeof(buffer), "RSET\r\n"); if (pop_query (pop_data, buffer, sizeof (buffer)) == PQ_NOT_CONNECTED) goto fail; } finish: /* exit gracefully */ - strfcpy (buffer, "QUIT\r\n", sizeof (buffer)); + m_strcpy(buffer, sizeof(buffer), "QUIT\r\n"); if (pop_query (pop_data, buffer, sizeof (buffer)) == PQ_NOT_CONNECTED) goto fail; mutt_socket_close (conn);