Prototype for a function to handle POP server responses.
More...
Prototype for a function to handle POP server responses.
- Parameters
-
- Return values
-
◆ fetch_capa()
static int fetch_capa |
( |
const char * |
line, |
|
|
void * |
data |
|
) |
| |
|
static |
Parse CAPA output - Implements pop_fetch_t -.
- Parameters
-
line | List of capabilities |
data | POP data |
- Return values
-
Definition at line 146 of file lib.c.
147{
149
151 {
154 }
156 adata->cmd_stls =
true;
163
164 return 0;
165}
size_t mutt_buffer_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
char * mutt_str_skip_email_wsp(const char *s)
Skip over whitespace as defined by RFC5322.
size_t mutt_istr_startswith(const char *str, const char *prefix)
Check whether a string starts with a prefix, ignoring case.
void * adata
Private data (for Mailbox backends)
POP-specific Account data -.
◆ fetch_auth()
static int fetch_auth |
( |
const char * |
line, |
|
|
void * |
data |
|
) |
| |
|
static |
Fetch list of the authentication mechanisms - Implements pop_fetch_t -.
- Parameters
-
line | List of authentication methods |
data | POP data |
- Return values
-
Definition at line 173 of file lib.c.
174{
176
178 {
180 }
182
183 return 0;
184}
bool mutt_buffer_is_empty(const struct Buffer *buf)
Is the Buffer empty?
size_t mutt_buffer_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
◆ check_uidl()
static int check_uidl |
( |
const char * |
line, |
|
|
void * |
data |
|
) |
| |
|
static |
Find message with this UIDL and set refno - Implements pop_fetch_t -.
- Parameters
-
line | String containing UIDL |
data | POP data |
- Return values
-
Definition at line 565 of file lib.c.
566{
567 if (!line || !data)
568 return -1;
569
570 char *endp = NULL;
571
572 errno = 0;
573 unsigned int index = strtoul(line, &endp, 10);
574 if (errno != 0)
575 return -1;
576 while (*endp == ' ')
577 endp++;
578
581 {
584 {
586 break;
587 }
588 }
589
590 return 0;
591}
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
struct PopEmailData * pop_edata_get(struct Email *e)
Get the private data for this Email.
void * edata
Driver-specific data.
int index
The absolute (unsorted) message number.
int msg_count
Total number of messages.
struct Email ** emails
Array of Emails.
POP-specific Email data -.
◆ fetch_message()
static int fetch_message |
( |
const char * |
line, |
|
|
void * |
data |
|
) |
| |
|
static |
Write line to file - Implements pop_fetch_t -.
- Parameters
-
line | String to write |
data | FILE pointer to write to |
- Return values
-
Definition at line 98 of file pop.c.
99{
100 FILE *fp = data;
101
102 fputs(line, fp);
103 if (fputc('\n', fp) == EOF)
104 return -1;
105
106 return 0;
107}
◆ fetch_uidl()
static int fetch_uidl |
( |
const char * |
line, |
|
|
void * |
data |
|
) |
| |
|
static |
Parse UIDL - Implements pop_fetch_t -.
- Parameters
-
- Return values
-
Definition at line 200 of file pop.c.
201{
204 char *endp = NULL;
205
206 errno = 0;
207 int index = strtol(line, &endp, 10);
208 if (errno)
209 return -1;
210 while (*endp == ' ')
211 endp++;
212 line = endp;
213
214
215 if (strlen(line) == 0)
216 return -1;
217
218 int i;
220 {
223 break;
224 }
225
227 {
229
232
235
238 }
241
243
246
247 return 0;
248}
struct Email * email_new(void)
Create a new Email.
#define mutt_debug(LEVEL,...)
@ LL_DEBUG1
Log at debug level 1.
void mx_alloc_memory(struct Mailbox *m)
Create storage for the emails.
struct PopAccountData * pop_adata_get(struct Mailbox *m)
Get the Account data for this mailbox.
struct PopEmailData * pop_edata_new(const char *uid)
Create a new PopEmailData for an email.
void pop_edata_free(void **ptr)
Free the private Email data - Implements Email::edata_free()
void(* edata_free)(void **ptr)
Free the private data attached to the Email.
int email_max
Number of pointers in emails.