Hi, First, I'm not sure if dovecot should alter this, but it seems vpopmail writes the IP into the 'remote_ip' field instead of the auth type. Dovecot still writes the auth type.? I want both. 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)); I'm, by far, NOT a C programmer - Feel free to laugh at my code publicly :) Thanks, Rick
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?