注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

永福的技术博客

Linux运维

 
 
 

日志

 
 

extmail和postfix两个邮件域名的配置  

2014-04-29 17:14:39|  分类: 软件编程 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

前提背景

之前一直使用extmail邮件系统, 只配置了一个域名example1.com, 近来新增了一个域名example2.com. 现在要求两个域名都能对外发送邮件和接收邮件.

DNS的配置

假设该服务器的IP为 110.110.110.110

example1.com 的DNS配置
@       MX      10  110.110.110.110.
@       TXT     "v=spf1 a mx ~all"  
mail    A       110.110.110.110

example2.com 的DNS配置
@       MX      10  110.110.110.110.
@       TXT     "v=spf1 a mx ~all"  
mail    A       110.110.110.110

extmail的设置

  1. 新建目录 sudo mkdir /home/domains/example2.com
  2. 修改用户组: sudo chown -R vuser:vgroup /home/domains/example2.com
  3. 修改权限: sudo chmod 777 /home/domains/example2.com
  4. 在extmail的web界面新增虚拟域名

postfix的设置

需要修改的几个配置项:

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
myhostname = mail.example1.com
mydomain = example1.com
myorigin = $mydomain
inet_protocols = all
mynetworks = change_to_ip1, change_to_ip2    ## 修改为自己的ip
mydestination = $mynetworks, $myhostname, mail.example2.com   ## 注意此处添加了 mail.example2.com
unknown_local_recipient_reject_code = 550
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
home_mailbox = Maildir/
debug_peer_level = 2
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.6.6/samples
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
message_size_limit = 15728640
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =            ## 此项需要置为空
smtpd_sasl_security_options = noanonymous
smtpd_sasl_application_name = smtpd
smtpd_banner = Welcome to our $myhostname ESMTP,Warning: Version not Available!
virtual_transport = maildrop:
maildrop_destination_recipient_limit = 1
virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_alias_maps = mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_create_maildirsize = yes
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
local_recipient_maps = $virtual_mailbox_maps   ## 需要配置此项
virtual_maildir_limit_message = Sorry, this user has exceeded their disk space quota, pleasetry again later.
smtpd_sender_restrictions =
        permit_mynetworks,
        reject_sender_login_mismatch,
        reject_authenticated_sender_login_mismatch,
        reject_unauthenticated_sender_login_mismatch
smtpd_sender_login_maps =
        mysql:/etc/postfix/mysql_virtual_sender_maps.cf,
        mysql:/etc/postfix/mysql_virtual_alias_maps.cf
receive_override_options=no_address_mappings
smtpd_recipient_restrictions =
        permit_mynetworks,
        permit_sasl_authenticated,
        reject_non_fqdn_hostname,
        reject_non_fqdn_sender,
        reject_non_fqdn_recipient,
        reject_unauth_destination,
        reject_unauth_pipelining,
        reject_invalid_hostname
  评论这张
 
阅读(1086)| 评论(0)
推荐 转载

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018