基于centos5.0的企业级完全邮件系统(2)

smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject_invalid_hostname,reject_non_fqdn_hostname,reject_unknown_sender_domain,reject_non_fqdn_sender,reject_non_fqdn_recipient,reject_unknown_recipient_domain,reject_unauth_pipelining,reject_unauth_destination

smtpd_sasl_auth_enable = yes

smtpd_sasl_local_domain = $myhostname

smtpd_sasl_security_options = noanonymous

smtpd_sasl_application_name = smtpd

smtpd_banner = Welcome to our $myhostname ESMTP,Warning: Version not Available!

########################Virtual Mailbox Settings########################

virtual_mailbox_base = /mail/mailbox

virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf

virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf

virtual_alias_domains =

virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf

virtual_uid_maps = static:2525

virtual_gid_maps = static:2525

virtual_transport = maildrop

maildrop_destination_recipient_limit = 1

maildrop_destination_concurrency_limit = 1

##########################QUOTA Settings########################

message_size_limit = 14336000

virtual_mailbox_limit = 20971520

virtual_create_maildirsize = yes

virtual_mailbox_extended = yes

virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_limit_maps.cf

virtual_mailbox_limit_override = yes

virtual_maildir_limit_message = Sorry, the user's maildir has overdrawn his diskspace quota, please Tidy your mailbox and try again later.

virtual_overquota_bounce = yes

content_filter=amavisfeed:[127.0.0.1]:10024

vi /etc/postfix/master.cf

修改为以下

maildrop  unix  -       n       n       -       -       pipe

flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}

在最后添加

# ==========================================================================

# service type  private unpriv  chroot  wakeup  maxproc command + args

#               (yes)   (yes)   (yes)   (never) (100)

# ==========================================================================

#

amavisfeed unix    -       -       n       -       2     smtp

-o smtp_data_done_timeout=1200

-o smtp_send_xforward_command=yes

-o disable_dns_lookups=yes

-o max_use=20

#

127.0.0.1:10025 inet n    -       n       -       -     smtpd

-o content_filter=

-o smtpd_delay_reject=no

-o smtpd_client_restrictions=permit_mynetworks,reject

-o smtpd_helo_restrictions=

-o smtpd_sender_restrictions=

-o smtpd_recipient_restrictions=permit_mynetworks,reject

-o smtpd_data_restrictions=reject_unauth_pipelining

-o smtpd_end_of_data_restrictions=

-o smtpd_restriction_classes=

-o mynetworks=127.0.0.0/8

-o smtpd_error_sleep_time=0

-o smtpd_soft_error_limit=1001

-o smtpd_hard_error_limit=1000

-o smtpd_client_connection_count_limit=0

-o smtpd_client_connection_rate_limit=0

-o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_milters

-o local_header_rewrite_clients=

echo "/usr/sbin/postfix start" >> /etc/rc.d/rc.local

postconf  -a

cyrus

dovecot

8. courier-authlib认证安装

tar xjvf courier-authlib-0.60.2.tar.bz2

cd courier-authlib-0.60.2

./configure --prefix=/usr/local/courier-authlib --sysconfdir=/etc --without-authpam --without-authldap --without-authpwd --without-authshadow --without-authvchkpw --without-authpgsql --with-authmysql --with-mysql-libs=/usr/local/mysql/lib/mysql --with-mysql-includes=/usr/local/mysql/include/mysql --with-RedHat --with-authmysqlrc=/etc/authmysqlrc --with-authdaemonrc=/etc/authdaemonrc CFLAGS="-march=i686 -O2 -fexpensive-optimizations" CXXFLAGS="-march=i686 -O2 -fexpensive-optimizations"

make

make install

chmod 755 /usr/local/courier-authlib/var/spool/authdaemon

cp /etc/authdaemonrc.dist  /etc/authdaemonrc

cp /etc/authmysqlrc.dist  /etc/authmysqlrc

vi /etc/authdaemonrc

编辑以下

authmodulelist="authmysql"

authmodulelistorig="authmysql"

daemons=10

vi /etc/authmysqlrc

编辑以下

MYSQL_SERVER localhost

MYSQL_PORT 3306

MYSQL_USERNAME  extmail

MYSQL_PASSWORD extmail

MYSQL_SOCKET  /tmp/mysql.sock

MYSQL_DATABASE  extmail

MYSQL_USER_TABLE  mailbox

MYSQL_CRYPT_PWFIELD  password

MYSQL_UID_FIELD  '1001'

MYSQL_GID_FIELD  '1001'

MYSQL_LOGIN_FIELD  username

MYSQL_HOME_FIELD  concat('/mail/mailbox/',homedir)

MYSQL_NAME_FIELD  name

MYSQL_MAILDIR_FIELD  concat('/mail/mailbox/',maildir)

cp courier-authlib.sysvinit /etc/init.d/courier-authlib

chmod 755 /etc/init.d/courier-authlib

chkconfig --add courier-authlib

chkconfig --level 3 courier-authlib on

echo "/usr/local/courier-authlib/lib/courier-authlib" >> /etc/ld.so.conf

ldconfig -v

service courier-authlib start

9.imap接受邮件

tar xjvf courier-imap-4.2.1.tar.bz2

cd courier-imap-4.2.1

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wyxdyw.html