Skip to content

Instantly share code, notes, and snippets.

@jsm222
Created September 25, 2016 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsm222/7b26a89e24bc7f554443dbe3f5261f48 to your computer and use it in GitHub Desktop.
Save jsm222/7b26a89e24bc7f554443dbe3f5261f48 to your computer and use it in GitHub Desktop.
Prompt for password to late...
#include <stdlib.h>
#include <stdio.h>
#include <cyrus/imclient.h>
#include "assert.h"
static struct imclient *imclient;
void fatal(const char *s, int code)
{
fprintf(stderr, "Fatal error: %s\n", s);
exit(code);
}
char server[] = "localhost" ;
char port[] = "imap";
char mech[] ="CRAM-MD5";
char service[] = "imap";
int main() {
if(imclient_connect(&imclient, server, port,NULL)) {
fprintf(stderr,
"error: Couldn't connect to %s %s\n",
server, port);
}
int ret = imclient_authenticate(imclient, mech,service,NULL, 0,10000);
printf("%d",ret);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment