buf = calloc(bufLen + 2, sizeof(char));
+ /*
+ Format:
+ authenticate-id
+ authorize-id
+ password
+ */
sprintf(buf, "%s %s %s",
[self->login cString], [self->login cString],
[self->password cString]);
auth = [NSData dataWithBytesNoCopy:buf length:bufLen];
auth = [auth dataByEncodingBase64];
- if (LOG_PASSWORD == 1) {
+ if (LOG_PASSWORD) {
NSString *s;
s = [NSString stringWithFormat:@"AUTHENTICATE \"PLAIN\" {%d+}\r\n%s",
client = [[NGSieveClient alloc] initWithURL:url];
NSLog(@" client: %@", client);
- if ((res = [client login:[url user] password:[url password]]) == nil) {
+ res = [client login:[url user] password:[url password]];
+ if (![[res valueForKey:@"result"] boolValue]) {
NSLog(@"could not login %@: %@", [url user], client);
return 1;
}