imclient_authenticate wrong prompt order.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello list.

This is a question about using libcyrus, hope this is the place for such questions?

The following sample prompts for entering the password after ones actually did enter the password. 1) Why is that e.g why does this sample write "please enter your password: " after the password is entered, and then exits?
The authentication works. Only the prompting is a problem.

I've tried with adding different sasl_callback_t callbacks to imclient_connects but cannot get it to work as I expect it to.

My goal is to authenticate fully programmatically. 2) How to supply username and password without user inetercaction?

#include <cstring>
#include <sasl/sasl.h>
#include <sasl/saslutil.h>
extern "C" {
#include <cyrus/xmalloc.h>
}

extern "C" {
#include <cyrus/imclient.h>
}
#include <cstdio>
struct imclient *imclient;

char server[] = "192.168.1.1" ;
char port[] = "imap";
char mech[] ="CRAM-MD5";
char service[] = "imap";
void fatal(const char* message, int rc) {
   fprintf(stderr, "fatal error: %s\n", message);
   exit(rc);
}
int main() {
    if(imclient_connect(&imclient, server, port,NULL)) {
    fprintf(stderr,
    "error: Couldn't connect to %s %s\n",
     server, port);
    }

imclient_authenticate(imclient, mech,service,NULL, 0,256);
}

c++ testcyrus.cpp -I /usr/local/include/ -L /usr/local/lib -lcyrus_min -lcyrus -o testcyrus
c++ --version
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
uname -a
FreeBSD freebsd2.openbsd.lan 10.3-RELEASE FreeBSD 10.3-RELEASE cyrus-imapd25-2.5.8 ----
Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
To Unsubscribe:
https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus



[Index of Archives]     [Cyrus SASL]     [Squirrel Mail]     [Asterisk PBX]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [KDE]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux