close
2. Mail Relays
%允許intranet: 192.168.0.0/24使用MTA(sendmail)寄信
#vi /etc/access
# by default we allow relaying from localhost...
Connect:localhost.localdomain RELAY
Connect:localhost RELAY
Connect:127.0.0.1 RELAY
Connect:192.168.0.0/24 RELAY
重新啟動sendmail
#service sendmail restart
%設定要接收那些網域的信, 並視為本機的信件
#vi /etc/mail/local-host-names
# local-host-names - include all aliases for your machine here.
example.com
mail.example.com
cba.com
123.com
3. Aliases
%部門郵件指定給特定的user, ex: helpdesk信給student
#vi /etc/aliases
---略---
# Person who should get root's mail
#root: marc
manager: student
helpdesk: student
4. virtusertable
%收虛擬網域的信, ex: admin@123.com, student@cba.com, 指定給特定user
%/etc/hosts或DNS須有對應
#vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.0.254 server1.example.com server1
192.168.0.118 server118.example.com server118
192.168.0.254 123.com
192.168.0.254 cba.com
#vi /etc/mail/virtusertable
admin@123.com student
student@cba.com student@server118.example.com
5 procmail
#vi /etc/procmailrc [可由/usr/share/doc/proc*/examples/ * 找到範例檔]
[root@server1 mail]# cat /etc/procmailrc
# Please check if all the paths in PATH are reachable, remove the ones that
# are not.
PATH=$HOME/bin:/usr/bin:/usr/ucb:/bin:/usr/local/bin:.
DEFAULT=$HOME/mbox
VERBOSE=yes
:0 c
* ^Subject:.*rhce
/var/spool/mail/procmail.test
LOGFILE=/var/spool/mail/procmail.log
%允許intranet: 192.168.0.0/24使用MTA(sendmail)寄信
#vi /etc/access
# by default we allow relaying from localhost...
Connect:localhost.localdomain RELAY
Connect:localhost RELAY
Connect:127.0.0.1 RELAY
Connect:192.168.0.0/24 RELAY
重新啟動sendmail
#service sendmail restart
%設定要接收那些網域的信, 並視為本機的信件
#vi /etc/mail/local-host-names
# local-host-names - include all aliases for your machine here.
example.com
mail.example.com
cba.com
123.com
3. Aliases
%部門郵件指定給特定的user, ex: helpdesk信給student
#vi /etc/aliases
---略---
# Person who should get root's mail
#root: marc
manager: student
helpdesk: student
4. virtusertable
%收虛擬網域的信, ex: admin@123.com, student@cba.com, 指定給特定user
%/etc/hosts或DNS須有對應
#vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.0.254 server1.example.com server1
192.168.0.118 server118.example.com server118
192.168.0.254 123.com
192.168.0.254 cba.com
#vi /etc/mail/virtusertable
admin@123.com student
student@cba.com student@server118.example.com
5 procmail
#vi /etc/procmailrc [可由/usr/share/doc/proc*/examples/ * 找到範例檔]
[root@server1 mail]# cat /etc/procmailrc
# Please check if all the paths in PATH are reachable, remove the ones that
# are not.
PATH=$HOME/bin:/usr/bin:/usr/ucb:/bin:/usr/local/bin:.
DEFAULT=$HOME/mbox
VERBOSE=yes
:0 c
* ^Subject:.*rhce
/var/spool/mail/procmail.test
LOGFILE=/var/spool/mail/procmail.log
全站熱搜
留言列表