Quoting Timo Sirainen :
On Tue, 2010-11-16 at 10:30 -0600, Rick Romero wrote:
>
>> So I modified my vpopmail install to write an additional
field into the
>> lastauth table. My custom vpopmail writes the remote IP into remote_ip,
>> and the auth type into a 'type' field. I tested with qmail's
POP3 daemon to
>> verify vchkpw would fill the table correcly.
>>
>> But I'm not sure how to get dovecot to do it:
>>
>> I know this is close, but there is something not right in
>> src/auth/userdb-vpopmail.c line 99.
>> vset_lastauth(vpop_user, vpop_domain, &auth_request->remote_ip,
>> t_strdup_noconst(auth_request->service));
>
> 1) You need to modify vpopmail's vset_lastauth() function to actually
> support this.
>
> 2) Once you do have the extra field (const char *ip) added, you can use:
>
> vset_lastauth(vpop_user, vpop_domain,
> net_ip2addr(&auth_request->remote_ip),
> t_strdup_noconst(auth_request->service));
>
> Or maybe you could use vchkpw with Dovecot too via passdb checkpassword?
I already did 1) - that's working fine.
2) is becoming frustrating. I thought net_ip2addr() would be what I
needed, but I guess not. Although I only used (char *type) not (const
char *type).. No compile issues, nothing. It doesn't appear to even try
and write to the table. (I locked the table to see :)
For giggles I tried using checkpassword just to see what would happen
(though I know it works for qmail-pop3d), but apparently Dovecot can't use
checkpassword with CRAM-MD5 :/ Not sure if that's a bug or expected, but
means I can't convert. I don't want to remove functionality.
I don't expect much more help unless you see something jump out - This
function just returns an error if MySQL throws an error (in vpopmail's
vauth.c), any other errors and it's silently skipped over - so
troubleshooting this is going to be a little drawn out.
Thanks,
Rick