268 |
Header: Date, Subject, From, Sender, Reply-To, To, Cc, Bcc, In-Reply-To, |
Header: Date, Subject, From, Sender, Reply-To, To, Cc, Bcc, In-Reply-To, |
269 |
and Message-Id. */ |
and Message-Id. */ |
270 |
static int |
static int |
271 |
fetch_envelope (struct fetch_command *command, char **arg) |
fetch_envelope (struct fetch_command *command, char **arg ARG_UNUSED) |
272 |
{ |
{ |
273 |
int status; |
int status; |
|
(void)arg; /* No arguments. */ |
|
274 |
util_send ("%s (", command->name); |
util_send ("%s (", command->name); |
275 |
status = fetch_envelope0 (command->msg); |
status = fetch_envelope0 (command->msg); |
276 |
util_send (")"); |
util_send (")"); |
335 |
;; from the given time will give the UT form. |
;; from the given time will give the UT form. |
336 |
;; The Universal Time zone is "+0000". */ |
;; The Universal Time zone is "+0000". */ |
337 |
static int |
static int |
338 |
fetch_internaldate (struct fetch_command *command, char **arg) |
fetch_internaldate (struct fetch_command *command, char **arg ARG_UNUSED) |
339 |
{ |
{ |
340 |
char date[128], *p; |
char date[128], *p; |
341 |
envelope_t env = NULL; |
envelope_t env = NULL; |
342 |
struct tm tm; |
struct tm tm; |
343 |
mu_timezone tz; |
mu_timezone tz; |
344 |
|
|
|
(void)arg; /* No arguments. */ |
|
345 |
message_get_envelope (command->msg, &env); |
message_get_envelope (command->msg, &env); |
346 |
date[0] = '\0'; |
date[0] = '\0'; |
347 |
envelope_date (env, date, sizeof (date), NULL); |
envelope_date (env, date, sizeof (date), NULL); |
358 |
Functionally equivalent to BODY.PEEK[HEADER], differing in the syntax of |
Functionally equivalent to BODY.PEEK[HEADER], differing in the syntax of |
359 |
the resulting untagged FETCH data (RFC822.HEADER is returned). */ |
the resulting untagged FETCH data (RFC822.HEADER is returned). */ |
360 |
static int |
static int |
361 |
fetch_rfc822_header (struct fetch_command *command, char **arg) |
fetch_rfc822_header (struct fetch_command *command, char **arg ARG_UNUSED) |
362 |
{ |
{ |
363 |
char buffer[32]; |
char buffer[32]; |
364 |
char *p = buffer; |
char *p = buffer; |
365 |
(void)arg; /* No arguments. */ |
|
366 |
strcpy (buffer, ".PEEK[HEADER]"); |
strcpy (buffer, ".PEEK[HEADER]"); |
367 |
fetch_body (command, &p); |
fetch_body (command, &p); |
368 |
return RESP_OK; |
return RESP_OK; |
372 |
Functionally equivalent to BODY[TEXT], differing in the syntax of the |
Functionally equivalent to BODY[TEXT], differing in the syntax of the |
373 |
resulting untagged FETCH data (RFC822.TEXT is returned). */ |
resulting untagged FETCH data (RFC822.TEXT is returned). */ |
374 |
static int |
static int |
375 |
fetch_rfc822_text (struct fetch_command *command, char **arg) |
fetch_rfc822_text (struct fetch_command *command, char **arg ARG_UNUSED) |
376 |
{ |
{ |
377 |
char buffer[16]; |
char buffer[16]; |
378 |
char *p = buffer; |
char *p = buffer; |
379 |
(void)arg; /* No arguments. */ |
|
380 |
strcpy (buffer, "[TEXT]"); |
strcpy (buffer, "[TEXT]"); |
381 |
fetch_body (command, &p); |
fetch_body (command, &p); |
382 |
return RESP_OK; |
return RESP_OK; |
384 |
|
|
385 |
/* The [RFC-822] size of the message. */ |
/* The [RFC-822] size of the message. */ |
386 |
static int |
static int |
387 |
fetch_rfc822_size (struct fetch_command *command, char **arg) |
fetch_rfc822_size (struct fetch_command *command, char **arg ARG_UNUSED) |
388 |
{ |
{ |
389 |
size_t size = 0; |
size_t size = 0; |
390 |
size_t lines = 0; |
size_t lines = 0; |
391 |
(void)arg; /* No arguments. */ |
|
392 |
message_size (command->msg, &size); |
message_size (command->msg, &size); |
393 |
message_lines (command->msg, &lines); |
message_lines (command->msg, &lines); |
394 |
util_send ("%s %u", command->name, size + lines); |
util_send ("%s %u", command->name, size + lines); |
439 |
|
|
440 |
/* UID: The unique identifier for the message. */ |
/* UID: The unique identifier for the message. */ |
441 |
static int |
static int |
442 |
fetch_uid (struct fetch_command *command, char **arg) |
fetch_uid (struct fetch_command *command, char **arg ARG_UNUSED) |
443 |
{ |
{ |
444 |
size_t uid = 0; |
size_t uid = 0; |
445 |
(void)arg; /* No arguments. */ |
|
446 |
message_get_uid (command->msg, &uid); |
message_get_uid (command->msg, &uid); |
447 |
util_send ("%s %d", command->name, uid); |
util_send ("%s %d", command->name, uid); |
448 |
return RESP_OK; |
return RESP_OK; |
453 |
server by parsing the [MIME-IMB] header fields in the [RFC-822] header and |
server by parsing the [MIME-IMB] header fields in the [RFC-822] header and |
454 |
[MIME-IMB] headers. */ |
[MIME-IMB] headers. */ |
455 |
static int |
static int |
456 |
fetch_bodystructure (struct fetch_command *command, char **arg) |
fetch_bodystructure (struct fetch_command *command, char **arg ARG_UNUSED) |
457 |
{ |
{ |
|
(void)arg; /* No arguments. */ |
|
458 |
util_send ("%s (", command->name); |
util_send ("%s (", command->name); |
459 |
fetch_bodystructure0 (command->msg, 1); /* 1 means with extension data. */ |
fetch_bodystructure0 (command->msg, 1); /* 1 means with extension data. */ |
460 |
util_send (")"); |
util_send (")"); |