| From | Sent On | Attachments |
|---|---|---|
| Marc Haber | Mar 10, 2002 6:37 am | |
| Sam Varshavchik | Mar 10, 2002 7:43 am | |
| Marc Haber | Mar 11, 2002 11:45 pm | |
| Sam Varshavchik | Mar 12, 2002 6:24 am | |
| Marc Haber | Mar 16, 2002 2:08 am |
| Subject: | [courier-users] questions about writing an authcustom module | |
|---|---|---|
| From: | Marc Haber (cour...@marc-haber.de) | |
| Date: | Mar 10, 2002 6:37:48 am | |
| List: | net.sourceforge.lists.courier-users | |
Hi,
we are still using courier 0.32 and are currently thinking about updating to the current version 0.37. From what I see from the docs, the authentication code has changed quite a bit between these two versions, and we are using a custom authentication module that helps with transparently migrating accounts over from our old POP e-mail server.
Basically, this custom module verifies username/password against the old system and then proceeds to create the new account "on the fly". Our custom module does no more than calling a perl script which does the actual work, so our C module is quite simple, only has very few lines of code.
I am now trying to adapt that module to the new authentication code. If I understand correctly, I am expected to change the code in preauthcustom.c to do what I need. If this the recommended way of creating a custom auth module? Or is it a better idea t make a copy of the authcustom, creating an authscript module? How do I adapt the build process to have the new module automatically built?
Also, the new code asks for a function that simply verifies if the user account in question exists. Since I am validating against a background POP3 system, I can't say if an account exists. The only thing I can do is verifying if a given password belongs to a given account. If either password or account is wrong, I get the same error state, so I can't say if this is the wrong password for an existing account. What is my authpre function to return in this case? Should I always return "account exists"?
What is the recommended method of getting a single parameter (here: the path name to the perl script doing the actual work) into the authentication module? Should I copy some code from authmysql, reading my own config file, or should I relay on an environment variable passed in from the init script (probably reading from /etc/courier/pop3d conffile)?
Any hints will be appreciated.
Greetings Marc
-- -------------------------------------- !! No courtesy copies, please !! ----- Marc Haber | " Questions are the | Mailadresse im Header Karlsruhe, Germany | Beginning of Wisdom " | Fon: *49 721 966 32 15 Nordisch by Nature | Lt. Worf, TNG "Rightful Heir" | Fax: *49 721 966 31 29





