快速业务通道

在Fedora上建立自己的邮件服务器(4)

作者 佚名技术 来源 服务器技术 浏览 发布时间 2012-07-05

D.配置postfix.        
1. 主要是main.cf的配置。
virtual_alias_maps = MySQL:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_gid_maps = static:12345
virtual_mailbox_base = /usr/local/virtual
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_mailbox_limit = 51200000
virtual_minimum_uid = 12345
virtual_transport = virtual
virtual_uid_maps = static:12345 smtpd_sasl_auth_enable = yes 
#smtpd_sasl_local_domain = $myhostname 
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated permit_auth_destination reject 
smtpd_sasl_security_options = noanonymous 
smtpd_client_restrictions = permit_sasl_authenticated 
broken_sasl_auth_clients = yes  2. mysql_virtual_alias_maps.cf 如下 user = postfix
password = postfix
hosts = localhost
dbname = postfix
table = alias
select_field = goto
where_field = username 3. mysql_virtual_domains_maps.cf 如下 user = postfix
password = postfix
hosts = localhost
dbname = postfix
table = domain
select_field = description
where_field = domain 4. mysql_virtual_mailbox_maps.cf 如下 user = postfix
password = postfix
hosts = localhost
dbname = postfix
table = mailbox
select_field = maildir
where_field = username

  E.建立

  [root@localhost root]# mkdir /usr/local/virtual
  [root@localhost root]# chown -R postfix:postfix /usr/local/virtual
  [root@localhost root]# chmod -R 751 /usr/local/virtual
  七、测试端口25
  A. mysql> use postfix
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
 
Database changed
mysql> show tables;
+----------+
| Tables_in_postfix |
+----------+
| alias       |
| domain      |
| mailbox      |
+----------+
3 rows in set (0.00 sec)
 
mysql> INSERT INTO alias (username,goto) VALUES (''postmaster@lansemail.com'',''tester@lansemail.com'');
Query OK, 1 row affected (0.08 sec)
 
mysql> INSERT INTO domain (domain,description) VALUES (''lansemail.com'',''local:''); Query OK, 1 row affected (0.00 sec)
 
mysql> INSERT INTO mailbox (username,password,home,maildir,name,domain,create_date,create_time) VALUES(''tester'',''$1$pi.WVgBx$a3dUCzBnbY76jnZlqWQCQ/'',''/usr/local/virtual/'',''tester@lansemail.com/'',''tester'',''lansemail.com'',''2003-11-19'',''21:24:00''); Query OK, 1 row affected (0.03 sec)
 
mysql> select * from mailbox
  -> ;
+----+-----+---+----+-----+----+----+--+----+--+-+-+----+------+-------+----------+----+
| userid | username | password              | home        | maildir        | name  | uid  | gid  | quota | domain    | create_date | create_time | change_date | change_time | last_Access | passwd_lastchanged | status |
+----+-----+------------------+-----------+------------+----+----+----+----+--------+-------+-------+-------+-------+-------+----------+----+
|    | tester  | $1$pi.WVgBx$a3dUCzBnbY76jnZlqWQCQ/ | /usr/local/virtual/ | tester@lansemail.com/ | tester | 12345 | 12345 |    | lansemail.com | 2003-11-19 | 21:24:00  | 0000-00-00 | 00:00:00  |      0 |         0 |   1 |
+----+-----+------------------+-----------+------------+----+----+----+----+--------+-------+-------+-------+-------+-------+----------+----+
1 row in set (0.11 sec)
 
mysql>

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号