DNAuth - External Authentication Using DNews's users.dat

Under Construction :-)

Sample NetWin Authentication routine, uses DNews's users.dat file.

Version 1.0a - 14 April 1999 - contact tam at support-dmail@netwinsite.com

Included with distribution set for DMail, version 2.5d and above. See the utilities download page to download it separately.

Command line options:
dnauth -check username password
dnauth -lookup username
dnauth -search string
dnauth -path string -...
so dnauth uses, string/users.dat and logs there also
dnauth -log -... (or -debug) makes dnauth create log file, dnauth.log in DMail directory.

Normal processing options when used as external authent module for dsmtp/dpop:
exit (or quit)
+OK goodbye

check username[@domain] password fromIPaddress
+OK username@domain drop_file_path uid info

lookup username[@domain]
+OK username@domain drop_file_path uid fwd="a@b" groups="adults"

search string
+DATA user1 info
+DATA user2 info
+DATA user3 info

Normal processing commands:
check username[@domain] password fromIPaddress
lookup username[@domain]
search string

Works by using a file users.dat in this format

NB: colons are only allowed in last field, but spaces can be used anywhere. The info has fields, field1="" field2="" where field1 etc. can be whatever you want.

DNAuth, takes the information in fields dnews5 and dnews6 and pretends that they are on the end of the info field as,
name="dnews5" usergroups="dnews6" .
This means that the serch command will find text matching 'string' in any of the fields, user, dnews5,dnews6 and info.

DNAuth will by default look for the dnews.conf configuration file to find the users.dat file. It looks in the path as set in the 'config' setting.

It will also, by default, log the last error message to a log file, dnauth.log in the DMail directory.

To make the DMail servers use DNAuth, you should set the following two lines in dmail.conf,
authent_method external
authent_process path_to_dnauth argument

where path_to_dnauth, is the full path to the dnauth process. The argument is optional.

authent_method external
authent_process c:\dmail\dnauth.exe -log

Changes History:

Version 1.0b

Version 1.0a - 14 April 1999
  • added dnews3-6 to User structure
  • change rebuild_index to get dnews3-6
  • changed free to clear dnews3-6
  • checked auth_search only checks user and info fields.
  • auth_lookup looks up username and always returns, +OK username config 0
  • imported, password encryption from DNews 5.1
  • auth_check, made use pass_test
  • made str_encode use pass_encrypt
  • auth_rebuild, creates name="" and usergroups="" fields so search finds them in info field
  • added, quote_check() to check string does not contain quotes, returns, "Invalid Data" if it does.
  • made response to quit or exit, '+OK goodbye' as ext auth's are supposed to.
  • log pid and timestamp
  • log starting message and version.
  • debug mode: appends all to log file
    normal mode: log file overwritten with last error
  • stops if users.dat cannot be opened in build_index (tries to open twice with 1 second delay)