|
Staf Wagemakers
ConfigurationCGIpaf 1.3.2 ConfigurationContent
SyntaxThe configuration file (cgipaf.conf) contains one directive per line. The directive names are case insensitive, the values are case sensitive. Everything after a hash ( # ) is ignored. Empty lines and whitespaces are also ignored. If a directive appears more than ones the last one is used. Sections are grouped between <section_name> ... </section_name>, the section names are like the directive names case insensitive. Sections
The configuration file has three sections "global", "passwd" and "mailcfg".
The directives that don't belong to a section are global. Global directives
apply to all sections unless they're overwritten in the sections. DirectivesThe following parameters control cgipaf features and configuration. If a option is not specified or invalid the default built-in messages are used. syslogSyntax: syslog on|off enable syslog messages all the authentication events are logged with LOG_AUTHPRIV facility, other events are logged with the LOG_USER facility loglevelSyntax: loglevel number set the syslog level, messages of a higher significance will be reported as well.
pam_serviceSyntax: pam_service pam service name Set the pam service name, if not set "passwd" is used. The passwd pam service ( /etc/pam.d/passwd ) usually doesn't have an entry for user authentication, therefor /etc/pam.d/other has to have a line auth set to pam_unix.so.
If you don't like this for security reason etc, you can set the pam_service directive to "cgipaf" and create the file /etc/pam.d/cgipaf that looks like this
document_rootSyntax: document_root path location of the custom html message files login_documentSyntax: login_document filename OR
login_document Redirect location if the program is executed without parameters this message is displayed error_loginname
Syntax: error_loginname filename OR
error_loginname Redirect location The user forgot to type his loginname. error_access
Syntax: error_access filename OR
error_access Redirect location The user try to logon as root or the user's uid isn't between min_uid & max_uid. error_invalid
Syntax: error_invalid filename OR
error_invalid Redirect location The password is incorrect or the user doesn't exists error_newpassword
Syntax: error_newpasswd filename OR
error_newpassord Redirect location can't read new password error_match
Syntax: error_match filename OR
error_match Redirect location The new passwords doesn't match error_unchanged
Syntax: error_unchanged filename OR
error_unchanged Redirect location Password Unchanged error_tooshort
Syntax: error_tooshort filename OR
error_tooshort Redirect location the password length is below min_length error_toolong
Syntax: error_toolong filename OR
error_toolong Redirect location the password length is above max_length error_locked
Syntax: error_locked filename OR
error_locked Redirect location The user has exceeded the max_invalid tries error_forwardto
Syntax: error_forwardto filename OR
error_forwardto Redirect location The user has enabled mail forwarding, but didn't supply a forward to mail address error_invalidforwardto
Syntax: error_invalidforwardto filename
OR error_invalidforwardto Redirect location The forward to email address is invalid msg_success
Syntax: msg_success filename OR
msg_success Redirect location The password or mail configuration is updated successfully msg_changed
Syntax: msg_changed filename OR
msg_changed Redirect location see msg_success msg_updated
Syntax: msg_updated filename OR
msg_updated Redirect location see msg_success error_readname
Syntax: error_readname filename OR
error_readname Redirect location mailcfg.cgi is unable to read to username, this is probably an error in mailcfg_document. error_readforward
Syntax: error_readforward filename OR
error_readforward Redirect location mailcfg.cgi is unable to read forward, this is probably an error in mailcfg_document. error_readkeepmsg
Syntax: error_readkeepmsg filename OR
error_readkeepmsg Redirect location mailcfg.cgi is unable to read keep_msg, this is probably an error in mailcfg_document. error_readautoreply
Syntax: error_readautoreply filename
ORerror_readautoreply Redirect location mailcfg.cgi is unable to read autoreply, this is probably an error in mailcfg_document. error_autoreply_msg
Syntax: error_autoreplymsg filename OR
error_autoreplymsg Redirect location The user has enabled autoreply, but didn't supply a autoreply message. error_cookie
Syntax: error_cookie filename OR
error_cookie Redirect location mailcfg.cgi can't update the mail configuration without cookies. error_cookietimeout
Syntax: error_cookietimeout filename
OR error_cookietimeout Redirect location mailcfg.cgi can't update the mail configuration because the cookie is too old. error_accessdb
Syntax: error_accessdb filename OR
error_accessdb Redirect location (view)mailcfg.cgi can't work without an accessdb error_cracklib
Syntax: error_cracklib filename OR
error_cracklib Redirect location cracklib error error_mailcfgscript
Syntax: error_mailcfgscript filename OR
error_mailcfgscript Redirect location run_mailcfg failed. error_viewmailcfgscript
Syntax: error_viewmailcfgscript filename OR
error_viewmailcfgscript Redirect location run_viewmailcfg failed. error_pam
Syntax: error_pam filename OR
error_pam Redirect location pam error error_illegalword
Syntax: error_illegalword filename OR
error_illegalword Redirect location The new password contains an illegal word. min_uid
Syntax: min_uid uid minimum user id, if a uid is bellow min_uid access will be denied. You can't set min_uid lower then 10. max_uid
Syntax: max_uid uid maximum user id, if the uid is higher than max_uid access will be denied. If max_uid isn't set there is no maximum. min_length
Syntax: min_length length minimum password length max_length
Syntax: max_length length maximum password length accessdb
Syntax: accessdb path accessdb path, if not set no access database is used. If not set Users can try to change their password as many times they like. (view)mailcfg.cgi don't work without an accessdb. cracklib
Syntax: cracklib on|off enable cracklib test, the new password is tested with cracklib. if the password is invalid error_cracklib is displayed. you have to set the cracklib_dictpath directive to your cracklib dictpath otherwise cracklib is disabled. CGIpaf support cracklib password testing in the PAM configuration, if cracklib is enabled in your PAM configuration and you should set cracklib to off. cracklib_dictpath
Syntax: cracklib_dictpath /path/to/cracklib_dict Set the cracklib_dictpath, the cracklib_dictpath should be set to the dictionary filename without the extension ( .pwi ), not the directory path. vmail_support
Syntax: vmail_support yes|no
Enable support for Linuxconf virtual email domains passwords passwd_location
Syntax: passwd_location /path/to/your/passwd_file Set the password file location. This directive is only available if you've compiled CGIpaf without PAM support and isn't supported on *BSD systems. shadow_location
Syntax: passwd_location /path/to/your/shadow_file Set the shadow file location. This directive is only available if you've compiled CGIpaf without PAM support and isn't supported on *BSD systems. illegal_words
Syntax: illegal_words word1 word2 Specify a list of words that are illegal to use as a part of a new password set_PAM_CHANGE_EXPIRED_AUTHTOK
Syntax: set_PAM_CHANGE_EXPIRED_AUTHTOK on|off
Set the PAM_CHANGE_EXPIRED_AUTHTOK flag. max_invalid
Syntax: max_invalid tries maximum invalid tries, if not set the default value (3) will be used. invalid_timeout
Syntax: invalid_timeout seconds
Default: 600 time in seconds that a user will be locked out if the max_invalid tries has been exceeded. sendmail
Syntax: sendmail path_to_sendmail mailcfg.cgi uses the path_to_sendmail in ~/.procmailrc, if your mailer is on another location than "/usr/lib/sendmail" you've to set the sendmail directive. formail
Syntax: formail path_to_formail mailcfg.cgi uses the path_to_formail in ~/.procmailrc, by default the basename 'forname' is used. domain
Syntax: domain domain_name A "X-loop: user@domainname" header is added to the forwarded or the replied mail to avoid mail looping. With the domain directive you can set the domainname in the "X-loop" header. If domain is not set mailcfg.cgi will use hostname.nisadomainname, if your server isn't part of a NIS domain it'll use the domain in /etc/resolv.conf. use_statefile
Syntax: use_statefile yes|no
Default no
CGIpaf creates a state file ( $HOME/.cgipaf_state ) in the user's home directory.
This file contains the user's current mail configuration state. This file is used by
run_before_mailcfg, run_after_mailcfg and run_mailcfg.
run_success
Syntax: run_success path_to_script
stdout runs a script is a password / mail configuration is successfully updated. Example:
Will update the SAMBA password file. run_locked
Syntax: run_locked path_to_script
stdout run a script is a user is locked. run_before_mailcfg
Syntax: run_before_mailcfg script
run a script before the mail configuration. mailcfg.cgi will
execute the "run_before_mailcfg" script if the mail configuration state
goes from not active ( no mail forwarding and no autoreply ) to active.
run_after_mailcfg
Syntax: run_after_mailcfg script
run a script after the mail configuration. mailcfg.cgi will
execute the "run_after_mailcfg" script if the mail configuration state
goes from active ( mail forwarding or autoreply enabled ) to non-active.
run_mailcfg
Syntax: run_mailcfg path_to_script
define a mail configuration script, if not set the built-in procmail
configuration updater is used mailcfg_check
Syntax: mailcfg_check on|off
enables or disables mailcfg.cgi internal HTTP POST parameters checking if disabled mailcfg.cgi will run run_mailcfg after the authentication without testing the HTTP POST variables. This is something you must do within your run_mailcfg script. if mailcfg_check is disabled:
run_viewmailcfg
Syntax: run_viewmailcfg path_to_script
defines a view mail configuration script. set_script_filename
Syntax: set_script_filename on|off set the SCRIPT_FILENAME environment variable to the real scriptname. unset_script_filename
Syntax: unset_script_filename on|off unset the SCRIPT_FILENAME environment variable. cookie_timeout
Syntax: cookie_timeout seconds
Default: 300 cookie life time in seconds. mailcfg_document
Syntax: mailcfg_document filename OR
mailcfg_document Redirect Location Path to the mail configuration document error_deldotforward
Syntax: error_deldotforward filename OR
error_deldotforward Redirect Location Unable to delete .forward error_deldotprocmailrc
Syntax: error_deldotprocmailrc filename OR
error_deldotprocmailrc Redirect Location Unable to delete .forward error_openvacations
Syntax: error_openvacations filename OR
error_openvacations Redirect Location Unable to open ~/vacations.txt error_updateprocmailrc
Syntax: error_updateprocmailrc filename OR
error_updateprocmailrc Redirect Location Unable to update ~/.procmailrc AclOrder
Syntax: AclOrder Deny,All OR Allow,Deny Set the Acl order. AllowUsers
Syntax: AllowUsers user1 user2 OR * Specify a list of users that are allowed to use CGIpaf see Access Control List DenyUsers
Syntax: DenyUsers user1 user2 OR * Specify a list of users that are denied to use CGIpaf see acl AllowGroups
Syntax: AllowGroups group1 group2 OR * Specify a list of groups that are allowed to use CGIpaf see acl DenyGroups
Syntax: DenyGroups group1 group2 OR * Specify a list of groups that are denied to use CGIpaf see acl VariablesFor each document you can as use a plain html file with a few PHP extensions (see bellow) or a redirect. In a redirect, file or run_success and run_locked you can use the following variables:
Redirectexample:
Will redirect to /pwchanged.php?name="loginname" after a user has succeed to change his password. HTML filesIf you don't use a redirect you can use plain html files with two PHP extensions "include" and "echo". The same variables as by a redirect are available.
Will print the user's name and include bottom.php. Please note that the PHP implementation is very limited. include("bottom.php") won't work for example. ScriptsOverview
SyntaxThe first argument is the script name, the second argument is send to stdout. The second argument is usually used to pass the new password to a script. Examples
Executes a script to update the SAMBA password file after the system password is updated.
Emulates a cgi environment for the mail configuration. Access Control ListWith the Access Control list you can allow or deny users or groups. The AclOrder directive control the default access state and the order in which the acl is processed.
A star (*) in the user or group list means any user or group other wildcards are not supported.
Examples
Access to user "foo" will be allowed and all others will be denied.
Give the same result as above.
Will denied access to all, because the default state is set to deny.
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| © 2012 Staf Wagemakers | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||