The Sendmail program is a very widely used Mail Transport Agent (MTA).
MTAs send mail from one machine to another. Sendmail is not a client
program, which you use to read your email. Sendmail is a
behind-the-scenes program which actually moves your email over networks
or the Internet to where you want it to go..
This guide show you have to install and configure sendmail with virtual user and domains -
Installation -
Accepting mail for virtual domains/users
1.Create a new system user and set the password for that user.
2. Add the user to the
sendmail’s virtusertable file. Open the ‘/etc/mail/virtusertable’
file and add the following:
Each line in the /etc/mail/virtusertable file should be of the following format:
3. Add each new domain name to the /etc/mail/local-host-names file
4. Generate a new sendmail.cf
file by using the following commands:
Rewriting
outgoing email addresses
This guide show you have to install and configure sendmail with virtual user and domains -
Installation -
Check
if sendmail is installed or not:
# rpm –qa | grep sendmail
If
it is not installed, then install the sendmail package using
following command:
# yum install sendmail sendmail-cf
By
default sendmail listen on local interface i.e 127.0.0.1
To
configure the sendmail to listen to all interface at the host, just
comment the following line in “sendmail.mc”:
# vi /etc/mail/sendmail.mc
From:
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
To
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
Accepting mail for virtual domains/users
1.Create a new system user and set the password for that user.
useradd
exampleuserpasswd
exampleuser |
Each line in the /etc/mail/virtusertable file should be of the following format:
3. Add each new domain name to the /etc/mail/local-host-names file
exampledomain.tld |
cd
/etc/mailmake
all/etc/init.d/sendmail
restart |
1.
Add the following lines to the /etc/mail/sendmail.mc file:
1
2
3
|
FEATURE(masquerade_envelope)FEATURE(genericstable,
`hash
-o
/etc/mail/genericstable')GENERICS_DOMAIN_FILE(`/etc/mail/sendmail.gdf') |
2.
Create /etc/mail/genericstable file containing local users mapped to
desired addresses:
exampleuser
exampleuser@exampledomain.tldexampleuser2
exampleuser2@exampledomain.tld |
3.
Create /etc/mail/sendmail.gdf file containing the fully qualified
name of the local mail server.
host.exampledomain.tld |
4.
Finally, generate a new sendmail.cf file:
cd
/etc/mailmake
all/etc/init.d/sendmail
restartDONE ...:) |

Comments