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

来源:天极Yesky 时间:2007-09-12 13:51:00 

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_mynetworkspermit_sasl_authenticatedpermit_aut-h_destinationreject
  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@localhostroot]#mkdir/usr/local/virtual
  [root@localhostroot]#chown-Rpostfix:postfix/usr/local/virtual
  [root@localhostroot]#chmod-R751/usr/local/virtual

  
七、测试端口25
  


  A.mysql>usepostfix
  Readingtableinformationforcompletionoftableandcolumnnames
  Youcanturnoffthisfeaturetogetaquickerstartupwith-A
  
  Databasechanged
  mysql>showtables;
  +----------+
  |Tables_in_postfix|
  +----------+
  |alias|
  |domain|
  |mailbox|
  +----------+
  3rowsinset(0.00sec)
  
  mysql>INSERTINTOalias(username,goto)VALUES('postmaster@lansemail.com','tester@lansemail.com');
  QueryOK,1rowaffected(0.08sec)
  
  mysql>INSERTINTOdomain(domain,description)VALUES('lansemail.com','local:');QueryOK,1rowaffected(0.00sec)
  
  mysql>INSERTINTOmailbox(username,password,home,maildir,name,domain,create_date,create_time)VALUES('tester','$1$pi.WVgBx$a3dUCzBnbY76jnZlqWQCQ/','/usr/local/virtual/','tester@lansemail.com/','tes-ter','lansemail.com','2003-11-19','21:24:00');QueryOK,1rowaffected(0.03sec)-
  
  mysql>select*frommailbox
  ->;
  +----+-----+---+----+-----+----+----+--+----+--+-+-+----+------+-------+----------+----+
  |userid|username|password|home|maildir|name|uid|gid|quota|domain|create_date|cre-ate_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|
  +----+-----+------------------+-----------+------------+----+----+----+----+--------+-------+-------+-------+-------+-------+----------+----+
  1rowinset(0.11sec)
  
  mysql>

  
这里用的username为tester,只是用来测试端口用的,正式使用一定要用全名tester@lansemail.com.否则信件收不到,信息如下

无法到达以下收件人:



           

  
  'tester@lansemail.com',时间为21/11/200313:05
  450<tester@lansemail.com>:Userunknowninlocalrecipienttable
  
  B.[root@localhostpostfix]#telnetlocalhost25
  
  
  Trying127.0.0.1...
  Connectedtolocalhost.
  Escapecharacteris'^]'.
  220localhost.localdomainESMTPPostfix
  ehlolocalhost
  250-localhost.localdomain
  250-PIPELINING
  250-SIZE10240000
  250-VRFY
  250-ETRN
  250-AUTHLOGINPLAINOTP
  250-AUTH=LOGINPLAINOTP
  250-XVERP
  2508BITMIME
  authplaindGVzdGVyAHRlc3RlcgB0ZXN0cHc=
  235Authenticationsuccessful
  quit
  221Bye
  Connectionclosedbyforeignhost.
  [root@localhostpostfix]#telnetlocalhost25
  Trying127.0.0.1...
  Connectedtolocalhost.
  Escapecharacteris'^]'.
  220localhost.localdomainESMTPPostfix
  ehlolocalhost
  250-localhost.localdomain
  250-PIPELINING
  250-SIZE10240000
  250-VRFY
  250-ETRN
  250-AUTHLOGINPLAINOTP
  250-AUTH=LOGINPLAINOTP
  250-XVERP
  2508BITMIME
  authlogin
  334VXNlcm5hbWU6
  dGVzdGVy-->username:tester(用printf'tester'|mmencode取得。)
  334UGFzc3dvcmQ6
  dGVzdHB3-->password:testpw
  235Authenticationsuccessful
  quit
  221Bye
  Connectionclosedbyforeignhost.
  [root@localhostpostfix]#


标签:
0
投稿

猜你喜欢

  • 如何设置Exchange 2007的传输规则

    2010-03-13 19:12:00
  • 一种经济合算的NT邮件服务器软件(2)

    2010-05-22 18:13:00
  • 网站搬家和重大变动 应该注意的几个问题

    2008-12-17 14:18:00
  • FTP命令详解

    2007-08-17 14:38:00
  • 网易邮箱推广的一点思考

    2009-07-16 10:10:00
  • 王川:你的商业模式完整吗?

    2008-12-29 10:46:00
  • Windows Server 2008创新特性之高可用性

    2009-03-06 17:08:00
  • 为VMware的多台虚拟机绑定IP地址的方法

    2023-11-05 04:11:36
  • 经验分享:我优化网站标题标签的三次经历

    2008-11-13 12:30:00
  • 优化网页广告代码以及速度

    2009-03-02 19:23:00
  • 使用框架结构的网页SEO技巧

    2009-09-14 09:35:00
  • 李开复:谷歌用户为先做好三件事

    2009-02-04 16:16:00
  • centos7下如何安装ftp服务

    2023-10-18 05:38:03
  • 伪原创:站长和网络编辑必备技能

    2009-07-07 09:50:00
  • 新云模板导入方法

    2009-02-19 20:36:00
  • Win+apache下配置虚拟主机和绑定域名

    2008-10-17 14:56:00
  • Linux下截屏并编辑的最佳工具

    2023-11-02 17:31:58
  • Google AdSense广告优化四要素之“广告格式”

    2007-11-27 18:52:00
  • Windows XP SP3将于23日上市

    2008-02-12 09:08:00
  • 详解linux下nohup日志输出过大问题解决方案

    2023-11-03 18:20:49
  • asp之家 网站运营 m.aspxhome.com