信息来源:Inspiration
实现的方法很多,各位可以根据自己的情况实现。我这里用了一个较为简单的方法。这里假定您已经有了一个默认的域名default-domain.com,你需要给other.com配置虚拟邮件服务。
1、找到mail的配置目录,一个说来在/etc/mail
2、编辑/etc/mail/virtusertable这个文件,在其中加入
@other.com %
1@default-domain.com
其中%1表示
user@other.com中所包含的user。
3、重新启动Sendmail的进程,/etc/rc.d/init.d/sendmail restart
实际上,我们可以做得让虚拟主机用户和系统自己的用户区别开来,比如,给虚拟主机用户加上一个后缀。当我们给user建立用户的时候,我们可以使用useradd user.other这样的格式来建立。这样我们需要重新配置一下/etc/mail/virtusertable这个文件:
@other.com %
1.other@default-domain.com
那么,当有人向
user@other.com发送邮件的时候,这个地址会被系统透明的转换为
user.other@default-domain.com
更多的信息请看:
http://www.sendmail.org/virtual-hosting.html (Virtual Hosting with Sendmail)