邮件服务器-邮件系统-邮件技术论坛(BBS)

 找回密码
 会员注册
查看: 8934|回复: 3
打印 上一主题 下一主题

extmail 自动安装程序 for freebsd 6.0/6.1(2006-10-12加强版)

[复制链接]
跳转到指定楼层
顶楼
发表于 2006-10-13 00:04:03 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
extmail 自动安装程序 for freebsd 6.0/6.1(2006-10-12加强版)是在fengyong 的mail_v2.0基础上进行扩展完善的http://www.extmail.org/forum/archive/2/0607/2100.html


功能描述一下fengyong 的mail_v2.0提到的我就不说了)

1\修改了ExtMan/0.16-pre1的代码,完善了允许的服务(webmail\smtp auth\pop3\imap\netdisk),已经生效的控制权限有(webmail\smtp auth)下一步将继续增强扩展

2\结合POSTFIX和ExtMan/0.16-pre1增加了(内网用户)功能,激活内网用户,该帐号只能向本域或授权域发送邮件,未激活内网用户的标准帐号可向任何域发送邮件

3\整合了进出邮件备份的功能,
incoming@domain.com/outgoing@domain.com 分别对进出邮件进行备份

4\修改ExtMail 0.24-pre8使其支持ExtMan/0.16-pre1对webmail设定的支持

5\增加了授权域数据库主要用来支持内网帐号的应用,目前需手动在数据库内增删,以后会在ExtMan/0.16-pre1里支持操作

6\增加了垃圾邮件过滤(SpamAssassin)配置文档,

7\增加了安装 PHP5/php5-extensions/phpMyAdmin 完装完毕即可使用



下一版本:

1\完善邮件列表功能
2\完善允许的服务(pop3\imap\netdisk)
3\增加ExtMan/0.16-pre1对授权域的操作
4\增加LDAP的自动安装
5\增加Extmail里的(全局地址本)的自动安装配置
6\Maildrop + ExtMail 实现过滤/自动回复/转发等
7\用户自定义白名单,黑名单的功能


希望能尽可能的解决繁琐的配置和安装过程,有时间我会补充一份配置说明,大家可以根据需要,自行
修改调整!






安装前请参照压缩包内的(INSTALL_README)文档,里面是从开始到结束,所有需要进行选择项配置说明!
Http://down.21sun.net/mail_v.1.0.0.0.tar.gz












(INSTALL_README)文档
=================================================
Options for gettext 0.14.5_2
-------------------------------------------------
[X] EXAMPLES install example files
[X] HTMLMAN   install man pages in HTML format
-------------------------------------------------



Options for courier-imap 4.1.1,1
-------------------------------------------------
[X] OPENSSL     Build with OpenSSL support
[ ] FAM       Build in fam support for IDLE command
[ ] DRAC       Build in DRAC support
[ ] TRASHQUOTA   Include deleted mails in the quota
[ ] GDBM       Use gdbm db instead of system bdb
[ ] IPV6       Build with IPv6 support
[ ] AUTH_LDAP   LDAP support
[X] AUTH_MYSQL   MySQL support
[ ] AUTH_PGSQL   PostgreSQL support
[ ] AUTH_USERDB Userdb support
[ ] AUTH_VCHKPW Vpopmail/vchkpw support
-------------------------------------------------


Options for postfix 2.3.3,1
-------------------------------------------------
[X] PCRE     Perl Compatible Regular Expressions
[ ] SASL     Cyrus SASLv1 (Simple Auth. and Sec. Layer)
[X] SASL2   Cyrus SASLv2 (Simple Auth. and Sec. Layer)
[ ] DOVECOT   Dovecot SASL authentication method
[ ] SASLKRB   If your SASL req. Kerberos select this option
[ ] SASLKRB5 If your SASL req. Kerberos5 select this option
[ ] SASLKMIT If your SASL req. MIT Kerberos5 select this option
[X] TLS     Enable SSL and TLS support
[ ] BDB     Berkeley DB (choose version with WITH_BDB_VER)
[X] MYSQL   MySQL maps (choose version with WITH_MYSQL_VER)
[ ] PGSQL   PostgreSQL maps (choose with DEFAULT_PGSQL_VER)
[ ] OPENLDAP OpenLDAP maps (choose ver. with WITH_OPENLDAP_VER)
[ ] CDB     CDB maps lookups   
[ ] NIS     NIS maps lookups   
[X] VDA     VDA (Virtual Delivery Agent)           
[ ] TEST     SMTP/LMTP test server and generator
-------------------------------------------------



Options for p5-Mail-SpamAssassin 3.1.5
-------------------------------------------------
[X] AS_ROOT     Run spamd as root (recommended)
[ ] DOMAINKEYS   DomainKeys support
[X] SSL         Build with SSL support for spamd/spamc
[X] MYSQL       Add MySQL support
[ ] PGSQL       Add PostreSQL support
[ ] RAZOR       Add Vipul's Razor support
[ ] SPF_QUERY     Add SPF query support
[ ] RELAY_COUNTRY Relay country support
[X] TOOLS       Install SpamAssassin tools
-------------------------------------------------



Options for amavisd-new 2.4.2_3,1   
-------------------------------------------------
[X] BDB       Use BerkeleyDB for nanny/cache/snmp
[ ] SQLITE     Use SQLite for lookups/logging/quarantine
[X] MYSQL       Use MySQL for lookups/logging/quarantine
[ ] PGSQL       Use PgSQL for lookups/logging/quarantine
[ ] LDAP       Use LDAP for lookups
[X] SASL       Use SASL authentication
[X] MILTER     Sendmail milter support
[ ] NEW_MILTER   New sendmail milter support (external module)
[X] SPAMASSASSIN Use mail/p5-Mail-SpamAssassin
[ ] P0F       Passive operating system fingerprinting
[ ] FILE       Use newer file(1) utility from ports
[X] RAR       RAR support with archivers/rar
[X] UNRAR       RAR support with archivers/unrar
[X] ARJ       ARJ support with archivers/arj
[X] UNARJ       ARJ support with archivers/unarj
[X] LHA       LHA support with archivers/lha
[X] ARC       ARC support with archivers/arc
[X] NOMARCH     ARC support with archivers/nomarch
[X] CAB       CAB support with archivers/cabextract
[X] RPM       RPM support with archivers/rpm2cpio
[X] ZOO       ZOO support with archivers/zoo
[X] UNZOO       ZOO support with archivers/unzoo
[X] LZOP       LZOP support with archivers/lzop
[X] FREEZE     FREEZE support with archivers/freeze
[X] TNEF       Add external tnef decoder converters/tnef
-------------------------------------------------





Options for clamav 0.88.4
-------------------------------------------------
[X] MILTER   Compile the milter interface
[X] CURL     Support URL downloading
[X] LIBUNRAR Support for external Unrar library
[X] STDERR   Print logs to stderr instead of stdout
-------------------------------------------------



Options for php5 5.1.6
-------------------------------------------------
[ ] CLI     Build CLI version
[ ] CGI     Build CGI version
[X] APACHE   Build Apache module
[ ] DEBUG     Enable debug
[ ] SUHOSIN   Enable Suhosin protection system
[X] MULTIBYTE Enable zend multibyte support
[ ] IPV6     Enable ipv6 support
[ ] REDIRECT   Enable force-cgi-redirect support (CGI only)
[ ] DISCARD   Enable discard-path support (CGI only)
[ ] FASTCGI   Enable fastcgi support (CGI only)
[ ] PATHINFO   Enable path-info-check support (CGI only)
-------------------------------------------------



Options for php5-extensions 1.0
-------------------------------------------------
[X] BCMATH   bc style precision math functions
[X] BZ2     bzip2 library support
[X] CALENDAR   calendar conversion support
[X] CTYPE     ctype functions
[X] CURL     CURL support   
[ ] DBA     dba support   
[ ] DBASE     dBase library support
[X] DOM     DOM support
[ ] EXIF     EXIF support
[ ] FILEINFO   fileinfo support
[ ] FILEPRO   filePro support
[ ] FRIBIDI   FriBidi support
[X] FTP     FTP support
[X] GD       GD library support
[ ] GETTEXT   gettext library support
[ ] GETTEXT   gettext library support
[ ] GMP     GNU MP support
[X] HASH     HASH Message Digest Frameworkx
[X] ICONV     iconv support
[X] IMAP     IMAP support   
[ ] INTERBASE Interbase 6 database support (Firebird)
[ ] LDAP     OpenLDAP support     
[ ] MBSTRING   multibyte string support
[X] MCRYPT   Encryption support   
[X] MHASH     Crypto-hashing support
[ ] MING     ming shockwave flash support
[ ] MSSQL     MS-SQL database support
[X] MYSQL     MySQL database support
[ ] MYSQLI   MySQLi database support
[ ] NCURSES   ncurses support (CLI only)
[ ] ODBC     unixODBC support     
[ ] OPENSSL   OpenSSL support
[ ] PANDA     panda support
[ ] PCNTL     pcntl support (CLI only)
[X] PCRE     Perl Compatible Regular Expression support
[ ] PDF     PDFlib support (implies GD)
[X] PDO     PHP Data Objects Interface (PDO)
[ ] PGSQL     PostgreSQL database support
[X] POSIX     POSIX-like functions   
[ ] PSPELL   pspell support
[ ] READLINE   readline support (CLI only)
[ ] RECODE   recode support
[X] SESSION   session support
[ ] SHMOP     shmop support
[X] SIMPLEXML simplexml support
[ ] SNMP     SNMP support   
[ ] SOAP     SOAP support   
[ ] SOCKETS   sockets support
[X] SQLITE   sqlite support
[ ] SYBASE_CT Sybase database support
[ ] SYSVMSG   System V message support
[ ] SYSVSEM   System V semaphore support
[ ] SYSVSHM   System V shared memory support
[ ] TIDY     TIDY support   
[X] TOKENIZER tokenizer support     
[ ] WDDX     WDDX support (implies XML)
[X] XML     XML support   
[X] XMLREADER XMLReader support     
[ ] XMLRPC   XMLRPC-EPI support   
[X] XMLWRITER XMLWriter support
[ ] XSL     XSL support (Implies DOM)
[ ] YAZ     YAZ support (ANSI/NISO Z39.50)
[X] ZIP     ZIP support   
[X] ZLIB     ZLIB support



Options for phpMyAdmin 2.9.0.2
-------------------------------------------------
[X] BZ2     bzip2 library support
[X] GD     GD library support
[X] MYSQLI   Improved MySQL support
[X] OPENSSL   OpenSSL support
[X] PDF     PDFlib support (implies GD)
[X] ZLIB     ZLIB support
[X] MCRYPT   MCrypt library support
[X] MBSTRING Multi-byte character-set string support














对于,已经安装好了EXTMAIL和POSTFIX的用户可以参照下面的文档来修改你的Extmail/Extman

并参照mail_v.1.0.0.0.tar.gz压缩包内的Conf 目录下的配置文档来设置你的相关配置文件

有关新增加的表和字段,请对比压缩包内的 Conf 目录下的 extmail.sql 文档自行建立


========================================================
----------------------------------------------------------------
1、修改用户增加和编辑界面,增加激活内网用户的操作界面
----------------------------------------------------------------
vi /usr/local/www/cgi-bin-dist/extman/html/standard/edit_user.html

找到以下代码72行处:
<tr>
    <td><%active%></td><td><input name=active type=checkbox <!-- IF ACTIVE -->checked<!-- END ACTIVE-->></td>
</tr>

在其下面增加:
<tr>
    <td><%lanuser%></td><td><input name=lanuser type=checkbox <!-- IF LANUSER -->checked<!-- END LANUSER-->></td>
</tr>







----------------------------------------------------------------
2、修改用户增加和编辑界面,增加激活内网用户语言包内容
----------------------------------------------------------------
vi /usr/local/www/cgi-bin-dist/extman/lang/zh_CN

找到以下代码78行处
%lang_user = (
.
.
.
lanuser => '激活',

在其下面增加一行
lanuser => '激活内网用户',


vi /usr/local/www/cgi-bin-dist/extman/lang/en_CN

找到以下代码78行处:
%lang_user = (
.
.
.
active => 'Active',

在其下面增加一行
lanuser => 'Active Lan User',






----------------------------------------------------------------
3、vi /usr/local/www/cgi-bin-dist/extman/libs/Ext/Mgr/MySQL.pm
----------------------------------------------------------------
首先修正一个显示的小BUG

查找
push @$srv, 'netdisk' if ($opt{srv_imap});

替换成
push @$srv, 'netdisk' if ($opt{srv_netdisk});




找到191行处:
sub get_users_list {
  my $self = shift;
  my $SQL = "SELECT * FROM mailbox WHERE domain='$_[0]'";
  my $rs = $self->get_entries($SQL);
  my $arr = []; # null ARRAY ref
  foreach my $ref (@$rs) {
    push @$arr, {
        mail => $ref->{username},
        cn => $ref->{name},
        domain => $ref->{domain},
        uidnumber => $ref->{uidnumber},
        gidnumber => $ref->{gidnumber},
        uid => $ref->{uid},
        netdiskquota => $ref->{netdiskquota},
        active => $ref->{active} ? 1 : 0,
在其下面增加:
        lanuser => $ref->{smtp_local_limit} ? 1 : 0,



找到281行处:
sub add_user {
  my $self = shift;
  my %opt = @_;
  my $db = $self->{dbh};

  my $ctype = $self->{crypt_type};
  my $srv = [];
  push @$srv, 'webmail' if ($opt{srv_webmail});
  push @$srv, 'smtpauth' if ($opt{srv_smtpauth});
  push @$srv, 'pop3' if ($opt{srv_pop3});
  push @$srv, 'imap' if ($opt{srv_imap});
  push @$srv, 'netdisk' if ($opt{srv_imap});

  $srv = join(',',@$srv); # XXX
  my $passwd = $self->encrypt($ctype, $opt{passwd});
  my $active = $opt{active} ? 1 : 0;
在其下面增加:
  my $lanuser = $opt{lanuser} ? 1 : 0;
  my $webmail_limit = $opt{srv_webmail} ? 1 : 0;
  my $smtp_limit = $opt{srv_smtpauth} ? 1 : 0;
  my $pop3_limit = $opt{srv_pop3} ? 1 : 0;
  my $imap_limit = $opt{srv_imap} ? 1 : 0;
  my $netdisk_limit = $opt{srv_imap} ? 1 : 0;


向下几行,找到296行处
  $db->do("INSERT into mailbox(
        username,
        uid,
        password,
        name,
        maildir,
        homedir,
        quota,
        netdiskquota,
        domain,
        uidnumber,
        gidnumber,
        createdate,
        expiredate,
        active,
在其下面增加
        webmail_limit,      
        smtp_local_limit,
        smtp_limit,
        pop3_limit,
        imap_limit,
        netdisk_limit,


向下几行,找到311行处
        '$opt{mail}',
        '$opt{uid}',
        '$passwd',
        '$opt{cn}',
        '$opt{maildir}',
        '$opt{homedir}',
        '$opt{quota}',
        '$opt{netdiskquota}',
        '$opt{domain}',
        '$opt{uidnumber}',
        '$opt{gidnumber}',
        '$opt{create}',
        '$opt{expire}',
        '$active',
在其下面增加
        '$webmail_limit',
        '$lanuser',
        '$smtp_limit',
        '$pop3_limit',
        '$imap_limit',
        '$netdisk_limit',


找到以下代码处501行
sub modify_user {
  my $self = shift;
  my %opt = @_;
  my $db = $self->{dbh};

  my $srv = [];
  push @$srv, 'webmail' if ($opt{srv_webmail});
  push @$srv, 'smtpauth' if ($opt{srv_smtpauth});
  push @$srv, 'pop3' if ($opt{srv_pop3});
  push @$srv, 'imap' if ($opt{srv_imap});
  push @$srv, 'netdisk' if ($opt{srv_imap});

  $srv = join(',',@$srv); # XXX
  my $active = $opt{active} ? 1 : 0;
在其下面增加
  my $lanuser = $opt{lanuser} ? 1 : 0;
  my $smtp_limit = $opt{srv_smtpauth} ? 1 : 0;
  my $webmail_limit = $opt{srv_webmail} ? 1 : 0;
  my $pop3_limit = $opt{srv_pop3} ? 1 : 0;
  my $imap_limit = $opt{srv_imap} ? 1 : 0;
  my $netdisk_limit = $opt{srv_imap} ? 1 : 0;


再向下几行,找到如下代码517行处
  $db->do("UPDATE mailbox set
        name='$opt{cn}',
        quota='$opt{quota}',
        netdiskquota='$opt{netdiskquota}',
        uidnumber='$opt{uidnumber}',
        gidnumber='$opt{gidnumber}',
        expiredate='$opt{expire}',
        active='$active',
在其下面增加:
        smtp_local_limit='$lanuser',
        smtp_limit='$smtp_limit',
        smtp_local_limit='$lanuser',
        webmail_limit='$webmail_limit',
        pop3_limit='$pop3_limit',
        imap_limit='$imap_limit',
        netdisk_limit='$netdisk_limit',


找到如下代码处637行:
sub get_user_info {
  my $self = shift;
  my $user = $_[0];
  my $domain = $user;

  $domain =~ s#^([^\@]+)@##;
  my $SQL = "SELECT * FROM mailbox where username='$user'";
  my $ref = $self->get_entry($SQL);
  return undef unless ($ref);
  return {
    mail => $ref->{username},
    cn => $ref->{name},
    domain => $ref->{domain},
    uidnumber => $ref->{uidnumber},
    gidnumber => $ref->{gidnumber},
    uid => $ref->{uid},
    netdiskquota => $ref->{netdiskquota},
    active => $ref->{active} ? 1 : 0,
在其下面增加
    lanuser => $ref->{smtp_local_limit} ? 1 : 0,



----------------------------------------------------------------
4、修改下面的文件

vi /usr/local/www/cgi-bin-dist/extman/libs/Ext/MgrApp/User.pm
----------------------------------------------------------------
找到如下代码:(约57行处)
sub add_user {
  my $self = shift;
  my $tpl = $self->{tpl};
  my $mgr = $self->{backend};
  my $q = $self->{query};
  my $sys = $self->{sysconfig};

  $tpl->assign(
    HAVE_USER => 1,
    NEWADD => 1,
    EXPIRE => $default_expire,
    ACTIVE => 1,
在其下面增加:
     LANUSER => 1,




向下找到如下代码:(130行处)
sub edit_user {
  my $self = shift;
  my $tpl = $self->{tpl};
  my $mgr = $self->{backend};
  my $q = $self->{query};
  my $multiplier = $self->{sysconfig}->{SYS_QUOTA_MULTIPLIER} || '1048576';

  my $user = $q->cgi('user') || $q->cgi('username').'@'.$q->cgi('domain');
  my $ui = $mgr->get_user_info($user);
  my $charset = $self->{sysconfig}->{SYS_CHARSET} || $lang_charset;

  return 0 unless($ui);

  # permission validation
  unless ($self->valid_perm($ui->{domain})) {
    $self->error('Access denied');
    return 0;
  }

  my ($uname) = ($ui->{mail} =~ m!(.*)@.*!);

  $tpl->assign(HAVE_USER => 1);
  $tpl->assign(
    MAIL => $ui->{mail},
    UNAME => $uname,
    NAME => $mgr->decode_utf8($charset, $ui->{cn} || $ui->{username}),
    DOMAIN => $ui->{domain},
    UID => $ui->{uidnumber},
    GID => $ui->{gidnumber},
    EXPIRE => $ui->{expire},
    PASSWD => "",
    QUOTA => $self->quota2num($ui->{quota})/$multiplier,
    NDQUOTA => $self->quota2num($ui->{netdiskquota})/$multiplier,
    ACTIVE => $ui->{active},
在其下面增加:
    LANUSER => $ui->{lanuser},




向下找到如下代码209行处)
        $rc = $mgr->modify_user(
          user => "$user\@$domain",
          domain => $domain,
          cn => $mgr->encode_utf8($charset, $q->cgi('cn')),
          uidnumber => $q->cgi('uid'),
          gidnumber => $q->cgi('gid'),
          expire => $q->cgi('expire'),
          passwd => $pwd1,
          quota => $self->num2quota($multiplier*$q->cgi('quota')),
          netdiskquota => $self->num2quota($multiplier*$q->cgi('netdiskquota')),
          active => $q->cgi('active'),
在其下面增加
           lanuser => $q->cgi('lanuser'),



向下找到如下代码(262行处)
        $rc = $mgr->add_user(
          mail => "$user\@$domain",
          domain => $domain,
          uid => $user,
          cn => $mgr->encode_utf8($charset, $q->cgi('cn')),
          uidnumber => $q->cgi('uid'),
          gidnumber => $q->cgi('gid'),
          # new user attributes here
          create => strftime("%Y-%m-%d %H:%M:%S", localtime),
          expire => $q->cgi('expire'),
          passwd => $pwd1,
          quota => $self->num2quota($multiplier*$q->cgi('quota')),
          maildir => "$domain/$user/Maildir/",
          homedir => "$domain/$user",
          netdiskquota => $self->num2quota($multiplier*$q->cgi('netdiskquota')),
          active => $q->cgi('active'),
在其下面增加
          lanuser => $q->cgi('lanuser'),


5、修改以下文件,来达到对WEBMAIL的限制
vi /usr/local/www/cgi-bin-dist/extmail/libs/Ext/Auth/MySQL.pm

找到 70 行如下代码
    $sql = "SELECT * FROM $self->{opt}->{table} WHERE $username='$params[0]'";
修改为:
    $sql = "SELECT * FROM $self->{opt}->{table} WHERE $username='$params[0]' and webmail_limit='1'";
沙发
发表于 2006-10-13 09:28:27 | 只看该作者
谢谢云中帆 来到5dmail并把最新的资料提供。
藤椅
发表于 2006-11-30 22:15:56 | 只看该作者
下载不了啊.
板凳
发表于 2006-12-1 17:55:58 | 只看该作者
谢谢了,顶一下。。
您需要登录后才可以回帖 登录 | 会员注册

本版积分规则

小黑屋|手机版|Archiver|邮件技术资讯网

GMT+8, 2026-8-5 22:49

Powered by Discuz! X3.2

© 2001-2016 Comsenz Inc.

本论坛为非盈利中立机构,所有言论属发表者个人意见,不代表本论坛立场。内容所涉及版权和法律相关事宜请参考各自所有者的条款。
如认定侵犯了您权利,请联系我们。本论坛原创内容请联系后再行转载并务必保留我站信息。此声明修改不另行通知,保留最终解释权。
*本论坛会员专属QQ群:邮件技术资讯网会员QQ群
*本论坛会员备用QQ群:邮件技术资讯网备用群

快速回复 返回顶部 返回列表