|
|
|
@ -125,7 +125,7 @@ int main(int argc, char **argv)
|
|
|
|
|
/* main loop */
|
|
|
|
|
while(eport_read(stdin, msgbuf, msgbuflen) > 0) {
|
|
|
|
|
opt = eport_ejabberd_msgread(msgbuf, msgbuflen, &m);
|
|
|
|
|
if(opt > 0) {
|
|
|
|
|
if(opt < 0) {
|
|
|
|
|
abort_parsing:
|
|
|
|
|
fprintf(stderr, "Error: message isn't valid.\nExiting.\n");
|
|
|
|
|
ssllib_free();
|
|
|
|
@ -140,7 +140,7 @@ int main(int argc, char **argv)
|
|
|
|
|
/* connect to IMAPs */
|
|
|
|
|
if(tls_connect(imap_host, imap_port, &connection)) {
|
|
|
|
|
fprintf(stderr, "Error: unable to connect to IMAPs.\n");
|
|
|
|
|
opt = -1;
|
|
|
|
|
opt = 0;
|
|
|
|
|
} else {
|
|
|
|
|
opt = imap_auth(&connection, &m);
|
|
|
|
|
tls_close(&connection);
|
|
|
|
@ -152,7 +152,7 @@ int main(int argc, char **argv)
|
|
|
|
|
/* connect to SMTPs */
|
|
|
|
|
if(tls_connect(smtp_host, smtp_port, &connection)) {
|
|
|
|
|
fprintf(stderr, "Error: unable to connect to SMTPs.\n");
|
|
|
|
|
opt = -1;
|
|
|
|
|
opt = 0;
|
|
|
|
|
} else {
|
|
|
|
|
opt = smtp_checkuser(&connection, &m, smtp_host);
|
|
|
|
|
tls_close(&connection);
|
|
|
|
@ -164,7 +164,7 @@ int main(int argc, char **argv)
|
|
|
|
|
case EJA_REMOVEUSER3:
|
|
|
|
|
/* still aren't supported by the program */
|
|
|
|
|
fprintf(stderr, "Error: This type of message are not supported.\n");
|
|
|
|
|
opt = -1;
|
|
|
|
|
opt = 0;
|
|
|
|
|
break;
|
|
|
|
|
case EJA_UNKNOWN:
|
|
|
|
|
default: /* something goes wrong with message */
|
|
|
|
@ -173,7 +173,10 @@ int main(int argc, char **argv)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* finally, reply ... */
|
|
|
|
|
eport_write(stdout, (char *)((int16_t *)&opt), sizeof(int16_t));
|
|
|
|
|
opt = ((int16_t)opt << 8) | (((int16_t)opt >> 8) & 0xff);
|
|
|
|
|
eport_write(stdout, (char *)(&opt), sizeof(int16_t));
|
|
|
|
|
/* clear the buffer */
|
|
|
|
|
memset(msgbuf, 0, msgbuflen);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ssllib_free();
|
|
|
|
|