Config Inbound Outbound mail in sendmail.mc file Processing

Inbound Mail(To change the To address for sending)
system
Step 1:
#vim /etc/mail/sendmail.mc
Line no:79
FEATURE(`virtusertable', `hash ­o /etc/mail/virtusertable.db')dnl
Step 2:
edit virtusertable file
#vim /etc/mail/virtusertable
user1@dns.com dns@dns.com
Step 3:
restart the sendmail servicechange from to address in sendmail.mc file rhel5
#service sendmail restart
Step 4:
#mail ­s “test” ­v user1@dns.com
sample mail for virtual user table
.
cc:
Step 5:
#su – user1
$mail
$exit
#su – dns
$mail


Outbound Mail(To change the From address for sending)
System
Step 1:
add the following entries in sendmail.mc file
#vim /etc/mail/sendmail.mc
Line no:104
FEATURE(genericstable)dnl
FEATURE(`always_add_domain')dnl
GENERICS_DOMAIN_FILE(`/etc/mail/local­host­names')dnl
Step 2:
#hostname system4.dns.com
edit genericstable file
#vim /etc/mail/genericstable
user1@system4.dns.com dns@system4.dns.com
Step 3:
add the hostname entries in local­host­names file
#vim /etc/mail/local­host­names
dns.com
system4.dns.com
system4
Step 4:
restart the sendmail service
#service sendmail restart
Step 5:
From user1 to send a mail to another user
$mail ­s “test” ­v root@dns.com
sample mail for generics user table
.
cc:
Step 6:
check root mails
#mail
Inbound and outbound mail configure successful by through change to address and from address in rhel5

Related post