Authent Modules

SurgeMail supports external authentication modules which are simple command line based programs that understand a small set of commands to add, remove and look up user details in your user database.

We provide modules for most common databases, including:

  • NWAuth - The default, fast simple and reliable, always use this!
  • MySQLAuth - MySQL UNIX based SQL database
  • LDAPAuth - LDAP database, can also be used with windows.

Authent modules should always be tested at the command line to see if they are working. Here is an example using NWAuth, the standard NetWin module:

c:> nwauth
set bob
+OK added to database
+OK config 0
check xxx
-ERR password wrong or not a valid user
search bo*
+OK Search Complete 2 items found out of 1510
set bob quota="200" fwd=""
+OK added to database
+OK config 0 quota="200" fwd=""

Configuring the Authent Module.

This is done in surgemail.ini e.g.

g_authent_process "c:\surgemail\nwauth.exe -path c:\surgemail"

The above tells NWAuth to look in c:\surgemail for it's files nwauth.add, nwauth.txt, etc.
The same is true for any module that has an .ini file.

Extended info fields recognized by SurgeMail

SurgeMail uses the g_authent_info settings to define what fields it displays and where. Most fields have a 'hard-coded' use but others are simply there as examples of the kind of optional information you can collect about your users. The default settings are as follows:

g_authent_info name="Creation Stamp" field="created" access="none" default="" type=""
g_authent_info name="Forwarding" field="fwd" access="none" default="" type=""
g_authent_info name="SPF Block" field="spf_block" access="none" default="" type=""
g_authent_info name="Disk Quota (bytes)" field="quota" access="domadmin" default="" type=""
g_authent_info name="Full Name" field="full_name" access="user" default="" type=""
g_authent_info name="Phone" field="phone" access="user" default="" type=""
g_authent_info name="Password Retrieval Question" field="pass_question" access="createonly" default="" type=""
g_authent_info name="Password Retrieval Answer" field="pass_answer" access="createonly" default="" type=""
g_authent_info name="Access type" field="mailaccess" access="domadmin" default="" type=""
g_authent_info name="Account Status" field="mailstatus" access="domadmin" default="" type=""
g_authent_info name="Sms Number" field="smsto" access="domadmin" default="" type=""
g_authent_info name="Disabled" field="disabled" access="none" default="" type=""
g_authent_info name="User alias quota" field="alias_quota" access="domadmin" default="" type=""
g_authent_info name="User list quota" field="list_quota" access="domadmin" default="" type=""
g_authent_info name="User access settings" field="user_access" access="domadmin" default="" type=""
g_authent_info name="Msg limit per 30min" field="send_limit" access="none" default="" type=""
g_authent_info name="To host(g_proxy)" field="tohost" access="none" default="" type=""
g_authent_info name="Is an alias of" field="realuser" access="none" default="" type=""
g_authent_info name="Allowed to" field="allow" access="none" default="" type=""
g_authent_info name="Friends Enabled" field="friends" access="none" default="" type=""
g_authent_info name="Email Notification Address" field="enotify" access="none" default="" type=""
g_authent_info name="SpamPrivate private prefix" field="ddpriv" access="none" default="" type=""
g_authent_info name="SpamPrivate from prefix" field="ddfrom" access="none" default="" type=""
g_authent_info name="Card Name" field="ccname" access="user" default="" type=""
g_authent_info name="Card Number" field="ccnumber" access="user" default="" type="encrypt"
g_authent_info name="Card Expiry" field="ccexpires" access="user" default="" type=""
g_authent_info name="Card Security Code" field="ccciv" access="user" default="" type=""
g_authent_info name="Card Type" field="cctype" access="user" default="" type="" 

allow Services the user can access eg. SMTP,POP,IMAP.
createdRecord of creation time, stored on creation time.
ddfromPrivate email 'from' suffix.
ddprivPrivate email 'private' suffix.
enotifyThe email address to send email notifications to.
friends'true' if the user has a friends mode configured.
full_nameExample information about user (not required, example).
fwdForwarding rules for the user, configured via users "Forwarding" page.
mailstatusStatus of the account, see (account status)
pass_questionOnly used at creation time, collects password retrieval question (not stored in database).
pass_answerOnly used at creation time, collects password retrieval answer (not stored in database).
phoneExample information about user (not required, example).
quotaUsers disk quota, configured via the admininstrative interface.
spf_block'true' if the user wants to block non spf compliant email.

For example:

+OK config 0 fwd=""
+OK config 0 quota="200000" fwd=""

Advanced settings :

alias_quota Number of aliases this user can create
admin_accessFeatures this domain admin can access
ccnameCredit card holders name.
ccnumberCredit card number.
ccexpiresCredit card expiry date mm/yy.
cccivCredit card security code.
cctypeCredit card type eg. Visa, Amex
disabledUsed by email based account creation code (may also be used to disable existing accounts)
list_quotaQuota of mailing lists the user can create.
mailaccessUsed in conjunction with g_access_group and g_user_access to specify access to features.
realuserReal account to which this account is aliased - allows aliases to be specified in authent database
send_limitNumber of outgoing messages this user can send per 30 minutes. You must also define the global limits g_tarpit_max, and g_tarpit_max_remote. And you may want to set g_tarpit_drop "true"
smsto SMS phone number to send SMS nontifications to users "SMS" page.
tohostThe host which to connect to when using proxy mode (g_proxy)
user_accessFeatures this user can access

Legacy settings :

account statusNumeric equivalent of mailaccess
droppath The user's drop path, this is no longer supported and will not work with all SurgeMail functionality.
groupsExample setting used to be installed for default SurgeMail installs


Example ldapauth.ini config used with ActiveDirectory (Windows)

ldap_port 389
ldap_mgr_dn cn=ftpadmin1,ou=mgt_info_sys,ou=CTL,ou=region_sales,dc=example,dc=com
ldap_mgr_pw secret_password
ldap_search_base OU=region_sales,dc=example,dc=com
ldap_scope LDAP_SCOPE_subtree
ldap_search_name ExampleAccountName
ldap_group_base OU=region_sales,dc=example,dc=com
ldap_group_search CN=&*
ldap_group_field CN
ldap_group_attrib member

Was this article helpful?

Related Articles

Need Support?

Can't find the answer you're looking for?
Contact Support