vpopmail + openwebmail 질문

망치의 이미지

설치까지 마쳤는데, vpopmail 에서 설정한 계정을 인식하지 못합니다. 로그인 페이지는 뜨는데, vpopmail 에서 설정한 계정이 아닌 시스템 계정을 인식하더군요.

vpopmail 설정에 맞게 돌아가도록 해줘야할듯한데, openwebmail 에서 그걸 어떻게 잡아줘야하는질 모르겠습니다..

웹페이지에서 시스템계정으로 로그인을 시도하면 로딩 화면이 뜨지만, 홈디렉토리를 찾을 수 없다는 에러가 뜨면서 종료됩니다. auth디렉토리에 있는 auth_mysql.pl 이나 auth_mysql_vmail.pl 을 어떻게 수정해서 적용해야 할듯한데.. 감을 잡기가 힘듭니다...

아래는 관련 문서인데, 따라한다고 따라 해봤지만 제대로 안되고 있습니다;;..

auth_module.txt

Hi,

Here are some notes for you to write authentication module for openwebmail.
We assume the module you want to write is auth_XYZ

ps: A simplest way is to modify an existing one to fit your requirement.


filename
---------
The file name should be auth_XYZ.pl, XYZ could be A-Za-z and _


location
--------
This auth_XYZ.pl should be put at the same directory
as other auth module is.


package name
------------
The package name for this module is ow::auth_XYZ
The first line of auth_XYZ.pl should be

package ow::auth_XYZ;


functions
----------
An auth module should have the following 4 API routines

get_userlist
get_userinfo
check_userpassword
change_userpassword

All functions follow this form

($retcode, $errmsg, retvals...)=routine($r_config, parameters);
where:
	$retcode:  0 means ok, else means error
	$errmsg:   message for sysadm, it will be logged to openwebmail.log
                   this won't be displayed to user
	$r_config: reference of the system config hash %config

#  0 : ok
# -2 : parameter format error
# -3 : authentication system/internal error
# -4 : user doesn't exist
($retcode, $errmsg, realname, uid, gid, homedir)=get_userinfo($r_config, $user);

#  0 : ok
# -1 : function not supported
# -3 : authentication system/internal error
($retcode, $errmsg,$userlist)=get_userlist($r_config);

#  0 : ok
# -2 : parameter format error
# -3 : authentication system/internal error
# -4 : password incorrect
($retcode, $errmsg)=check_userpassword($r_config, $user, $password)

#  0 : ok
# -1 : function not supported
# -2 : parameter format error
# -3 : authentication system/internal error
# -4 : password incorrect
($retcode, $errmsg)=change_userpassword($r_config, $user, $oldpassword, $newpassword)


conf file
---------
you may read some config values from auth_XYZ.conf.

Here is an example:

If you have the following lines in auth_XYZ.conf

option1		XXX
option2		YYY
option3		ZZZ

Then you may put the following at the start of your auth module.

----------------------------------------------------
require "modules/tool.pl";

my %conf;
if (($_=ow::tool::find_configfile('auth/auth_XYZ.conf')) ne '') {
   my ($ret, $err)=ow::tool::load_configfile($_, \%conf);
   die $err if ($ret<0);
}
----------------------------------------------------

Then option values in conf file can be derived by
$conf{'option1'}, $conf{'option2'}, $conf{'option3'}


globals
---------
Openwebmail can run in persistent mode,
so you have to be very careful about the global variables.

1. only use 'my variable' for constant globals.
   If the global variable will be changed and referenced at runtime by routines,
   you need to delcare it with 'use vars qw(variable);'

ps: this is due to the closure effect in persistent mode perl.
    Once a my variable is referenced by a sub routine, then
    the subroutine will has its own copy of this my variable.
    Then further change in the global my variable won't be seen by the subroutine.

2. code outside routines will be executed only once
   (when the module is required by main program)
   So the outside routine code should be used for init only

3. if you module has to chat with remote server,
   please do all the following thing in each of the 4 API routines

   open the connection,
   chat with server,
   close connection

   This is the simplest way, and it can avoid the problem of lost connection
   or server rebooting.
   Openwebmail will cache the userinfo for each session. In most case, each user
   session will need send only one request to auth server.

4. If you really need global variables, use 'use vars qw(variable)'.
   And please remember that value of global variables will be kept forever
   when running in persistent mode

5. if you hope to keep some connections to your remote server:

   a. you can use global variable to store connection handle
      but please don't do thing outside routines.

   b. all of the API routines should have the capability

      1. if the connection has not been initialized
         => initialize the connection handle
      2. if the connection is lost or dead
         => free old/stale connection handle
            reinitialize the connection handle

6. The signal handler for child process $SIG{CHLD} may have been set
   before calling the API routines, if your routine will fork new process,
   you may need to disable the handler temporarily by putting the following
   line in the routine

   local $SIG{CHLD}; undef $SIG{CHLD}


More about persistent CGI
-------------------------
1. a persistent CGI process serves one request at a time,
   if more than one request come, more processes are forked

2. a persistent CGI process won't end after a request is completed,
   it waits for a new request and the global variable will be kept
   across requests.

3. Normally, a persistent perl CGI runs under main:: package
   Just the same as pure CGI

4. But SpeedyCGI has a group mode which puts servers CGIs into one process,
   each CGI is running under a package other than main::,

   And here are the differences in group mode:

   a. one resident perl process can be used to wait requests for different CGIs

   b. you can not access variable with prefix like  $main:: or $::.

   c. Different CGI may share one copy of packages during differnt time
      So if package use global vraible to store state,
      the global may be changed or used by different CGIs


망치의 이미지

글을 찾아보는데.. vpopmail + openwebmail 조합으로 사용하는분이 안보이는군요. 나름대로 이렇게 쓰는분이 꽤 있을거라 생각했는데.. 의외네요..;;

그래서 한글 문서도 잘 안보이는거같고..;;

---------------------------------------
http://www.waitfor.com/
http://www.textmud.com/

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.