[Dovecot] Trouble with password scheme module

Ian R. Justman ianj at ian-justman.com
Tue Mar 29 04:05:57 EEST 2011


Hi, all.

About two and a half years ago, I wrote a hack to add an additional 
MD5-based password scheme to Dovecot, but I wrote it as a hack to 
src/auth/password_scheme.c since it was relatively easy to do, and I 
needed to get a machine running since the machine I was replacing, a Sun 
Ultra 5 running Post.Office, had dying hard drives.

Now, I'm actually sitting down and adapting it as a module and am having 
trouble getting it to work.

The code tarball itself can be picked up here:

http://www.ian-justman.com/code/dovecot/password_scheme_po_smd5.tar.gz

Before I continued, I made sure that a system-level account worked:

# telnet <server IP> 110
Trying <server IP>...
Connected to <server IP>.
Escape character is '^]'.
+OK Dovecot ready.
user <username>
+OK
pass <password>
+OK Logged in.
quit
+OK Logging out.
Connection closed by foreign host.

I then enabled the module, which introduces the password scheme 
"PO-SMD5".  I have Dovecot's default scheme set to SMD5.  If I get a 
password hash whose value has a {PO-SMD5} tag on it, the session looks 
like the following:

# telnet <server IP> 110
Trying <server IP>...
Connected to <server IP>.
Escape character is '^]'.
+OK Dovecot ready.
user <user with PO-SMD5 password>
+OK
pass <user's password>
-ERR Authentication failed.
quit
+OK Logging out
Connection closed by foreign host.

The following entry is deposited into the system log:

Mar 28 17:44:51 <hostname> dovecot: auth: Error: sql(<username>,<server 
IP>): Unknown scheme PO-SMD5

However, when I try using an account covered by the system (which does 
work when the plugin isn't loaded in dovecot.conf), the session looks 
like the following:

mikuru# telnet <server IP> 110
Trying <server IP>...
Connected to <server IP>.
Escape character is '^]'.
+OK Dovecot ready.
user <user with system password>
+OK
pass <user's password>
Connection closed by foreign host.

The following entry is deposited into the system log:

Mar 28 17:45:13 <hostname> dovecot: pop3: Error: 
dlopen(/usr/local/lib/dovecot/lib_password_scheme_po_smd5.so) failed: 
/usr/local/lib/dovecot/lib_password_scheme_po_smd5.so: Undefined symbol 
"password_scheme_unregister"

Otherwise, the patch I developed under 1.x applies cleanly to 2.0.x's 
password_scheme.c and works perfectly as a builtin.

This work was done under FreeBSD 8.1-RELEASE amd64.

Any ideas?

--Ian.

-- 
Ian R. Justman
UNIX hacker.  Anime fan.  Any questions?
ianj (at) ian-justman.com


More information about the dovecot mailing list