27 |
extern buffer_t ibuf, obuf; |
extern buffer_t ibuf, obuf; |
28 |
|
|
29 |
unsigned int options; /* Program options. */ |
unsigned int options; /* Program options. */ |
30 |
|
int verbosity; /* Program verbosity level (-2..2). */ |
31 |
unsigned int flags = 0; /* Program flags. */ |
unsigned int flags = 0; /* Program flags. */ |
32 |
unsigned int interval = 0; /* Poll at the specified interval. */ |
unsigned int interval = 0; /* Poll at the specified interval. */ |
33 |
conn_t connpri, connaux; /* Primary and auxiliary IMAP connection. */ |
conn_t connpri, connaux; /* Primary and auxiliary IMAP connection. */ |
57 |
setlocale(LC_ALL, ""); |
setlocale(LC_ALL, ""); |
58 |
|
|
59 |
home = getenv("HOME"); |
home = getenv("HOME"); |
60 |
options = (OPTION_DETAILS_NORMAL | OPTION_NAMESPACE | OPTION_PEEK | |
options = (OPTION_NAMESPACE | OPTION_PEEK); |
61 |
OPTION_PERMISSIONS); |
verbosity = 0; |
62 |
*charset = 0; |
*charset = 0; |
63 |
*logfile = 0; |
*logfile = 0; |
64 |
conffile = NULL; |
conffile = NULL; |
68 |
#ifdef ENCRYPTED_PASSWORDS |
#ifdef ENCRYPTED_PASSWORDS |
69 |
"p" |
"p" |
70 |
#endif |
#endif |
71 |
"qvVw")) != -1) { |
"qvV")) != -1) { |
72 |
switch (c) { |
switch (c) { |
73 |
case 'c': |
case 'c': |
74 |
conffile = optarg; |
conffile = optarg; |
99 |
break; |
break; |
100 |
#endif |
#endif |
101 |
case 'q': |
case 'q': |
102 |
options &= ~(OPTION_DETAILS_QUIET | |
if (verbosity > -2) |
103 |
OPTION_DETAILS_NORMAL | OPTION_DETAILS_VERBOSE); |
verbosity--; |
|
options |= OPTION_DETAILS_QUIET; |
|
104 |
break; |
break; |
105 |
case 'v': |
case 'v': |
106 |
options &= ~(OPTION_DETAILS_QUIET | |
if (verbosity < 2) |
107 |
OPTION_DETAILS_NORMAL | OPTION_DETAILS_VERBOSE); |
verbosity++; |
|
options |= OPTION_DETAILS_VERBOSE; |
|
108 |
break; |
break; |
109 |
case 'V': |
case 'V': |
110 |
version(); |
version(); |
111 |
exit(ERROR_UNDEFINED); |
exit(ERROR_UNDEFINED); |
112 |
break; |
break; |
|
case 'w': |
|
|
options &= ~(OPTION_PERMISSIONS); |
|
|
break; |
|
113 |
default: |
default: |
114 |
usage(); |
usage(); |
115 |
exit(ERROR_UNDEFINED); |
exit(ERROR_UNDEFINED); |
150 |
init_buffer(&ibuf); |
init_buffer(&ibuf); |
151 |
init_buffer(&obuf); |
init_buffer(&obuf); |
152 |
|
|
153 |
if (options & OPTION_DAEMON_MODE) { |
if (options & OPTION_DAEMON_MODE) |
154 |
options &= ~(OPTION_DETAILS_QUIET | |
verbosity = -2; |
155 |
OPTION_DETAILS_NORMAL | OPTION_DETAILS_VERBOSE); |
|
|
options |= OPTION_DETAILS_QUIET; |
|
|
} |
|
156 |
do { |
do { |
157 |
for (ca = accounts; ca != NULL; ca = ca->next) { |
for (ca = accounts; ca != NULL; ca = ca->next) { |
158 |
|
|
297 |
#ifdef ENCRYPTED_PASSWORDS |
#ifdef ENCRYPTED_PASSWORDS |
298 |
"p" |
"p" |
299 |
#endif |
#endif |
300 |
"qvVw] [-c configfile] [-d interval] [-l logfile]\n"); |
"qvV] [-c configfile] [-d interval] [-l logfile]\n"); |
301 |
} |
} |
302 |
|
|
303 |
|
|