9 |
#include "data.h" |
#include "data.h" |
10 |
|
|
11 |
|
|
|
extern int sock; |
|
|
|
|
12 |
static unsigned int tag = 0xF00000; /* Every IMAP command is prefixed |
static unsigned int tag = 0xF00000; /* Every IMAP command is prefixed |
13 |
with a unique [:alnum:] string. */ |
with a unique [:alnum:] string. */ |
14 |
|
|
17 |
*/ |
*/ |
18 |
unsigned int send_command(char *cmd) |
unsigned int send_command(char *cmd) |
19 |
{ |
{ |
|
|
|
20 |
#ifdef DEBUG |
#ifdef DEBUG |
21 |
printf("debug: sending command: %s", cmd); |
printf("debug: sending command: %s", cmd); |
22 |
#endif |
#endif |
23 |
|
|
24 |
if (write(sock, cmd, strlen(cmd)) == -1) |
socket_write(cmd); |
|
fatal(ERROR_NETWORK, "imapfilter: error while sending command; %s", |
|
|
strerror(errno)); |
|
25 |
|
|
26 |
return tag++; |
return tag++; |
27 |
} |
} |