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 response - Implements pop_fetch_t -.
- Parameters
-
line | List of capabilities |
data | POP data |
- Return values
-
Definition at line 147 of file lib.c.
148{
150
152 {
155 }
157 {
158 adata->cmd_stls =
true;
159 }
161 {
163 }
165 {
167 }
169 {
171 }
172
173 return 0;
174}
size_t buf_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 |
Parse AUTH response - Implements pop_fetch_t -.
- Parameters
-
line | List of authentication methods |
data | POP data |
- Return values
-
Definition at line 182 of file lib.c.
183{
185
187 {
189 }
191
192 return 0;
193}
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
size_t buf_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 |
Parse UIDL response - Implements pop_fetch_t -.
- Parameters
-
line | String containing UIDL |
data | POP data |
- Return values
-
Find message with this UIDL and set refno.
Definition at line 575 of file lib.c.
576{
577 if (!line || !data)
578 return -1;
579
580 char *endp = NULL;
581
582 errno = 0;
583 unsigned int index = strtoul(line, &endp, 10);
584 if (errno != 0)
585 return -1;
586 while (*endp == ' ')
587 endp++;
588
591 {
594 {
596 break;
597 }
598 }
599
600 return 0;
601}
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 |
Parse a Message response - Implements pop_fetch_t -.
- Parameters
-
line | String to write |
data | FILE pointer to write to |
- Return values
-
Save a Message to a file.
Definition at line 99 of file pop.c.
100{
101 FILE *fp = data;
102
103 fputs(line, fp);
104 if (fputc('\n', fp) == EOF)
105 return -1;
106
107 return 0;
108}
◆ fetch_uidl()
static int fetch_uidl |
( |
const char * |
line, |
|
|
void * |
data |
|
) |
| |
|
static |
Parse UIDL response - Implements pop_fetch_t -.
- Parameters
-
- Return values
-
Definition at line 202 of file pop.c.
203{
206 char *endp = NULL;
207
208 errno = 0;
209 int index = strtol(line, &endp, 10);
210 if (errno)
211 return -1;
212 while (*endp == ' ')
213 endp++;
214 line = endp;
215
216
217 if (strlen(line) == 0)
218 return -1;
219
220 int i;
222 {
225 break;
226 }
227
229 {
231
233
236
239 }
241 {
243 }
244
246
249
250 return 0;
251}
struct Email * email_new(void)
Create a new Email.
void pop_edata_free(void **ptr)
Free the private Email data - Implements Email::edata_free() -.
#define mutt_debug(LEVEL,...)
@ LL_DEBUG1
Log at debug level 1.
void mx_alloc_memory(struct Mailbox *m, int req_size)
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(* edata_free)(void **ptr)