23 |
|
|
24 |
unsigned int options; /* Program options. */ |
unsigned int options; /* Program options. */ |
25 |
unsigned int flags = 0; /* Program flags. */ |
unsigned int flags = 0; /* Program flags. */ |
|
unsigned int capabilities; /* Capabilities of mail server. */ |
|
26 |
unsigned int interval = 0; /* Poll at the specified interval. */ |
unsigned int interval = 0; /* Poll at the specified interval. */ |
27 |
|
unsigned int capspri, capsaux; /* Capabilities of primary and auxiliary mail |
28 |
|
* server. */ |
29 |
|
|
|
char authmech[AUTH_MECH_LEN]; /* Authentication mechanisms. */ |
|
30 |
char logfile[PATH_MAX]; /* Log file. */ |
char logfile[PATH_MAX]; /* Log file. */ |
31 |
char *home = NULL; /* User's home directory. */ |
char *home = NULL; /* User's home directory. */ |
32 |
char charset[CHARSET_LEN]; /* Charset for IMAP SEARCH requests. */ |
char charset[CHARSET_LEN]; /* Charset for IMAP SEARCH requests. */ |
134 |
|
|
135 |
open_logfile(); |
open_logfile(); |
136 |
|
|
137 |
init_vbuf(); |
init_ibuf(); |
138 |
|
|
139 |
if (options & OPTION_DAEMON_MODE) { |
if (options & OPTION_DAEMON_MODE) { |
140 |
f = 1; |
f = 1; |
169 |
get_password(ca->password, PASSWORD_LEN); |
get_password(ca->password, PASSWORD_LEN); |
170 |
ca->passwdattr = PASSWORD_PLAIN; |
ca->passwdattr = PASSWORD_PLAIN; |
171 |
} |
} |
172 |
if (login(&sockpri, ca->username, |
#ifdef CRAM_MD5 |
173 |
ca->password) == RESPONSE_NO) { |
if (capspri & CAPABILITY_AUTH_CRAM_MD5) |
174 |
|
r = imf_cram_md5(&sockpri, |
175 |
|
ca->username, ca->password); |
176 |
|
else |
177 |
|
#endif |
178 |
|
r = login(&sockpri, ca->username, |
179 |
|
ca->password); |
180 |
|
|
181 |
|
if (r == RESPONSE_NO) { |
182 |
error("username %s or password rejected " |
error("username %s or password rejected " |
183 |
"at %s\n", ca->username, ca->server); |
"at %s\n", ca->username, ca->server); |
184 |
continue; |
continue; |
235 |
|
|
236 |
lockfile_remove(); |
lockfile_remove(); |
237 |
|
|
238 |
exit(0); |
return 0; |
239 |
} |
} |
240 |
|
|
241 |
|
|