Configure senmail on CentOS

Configure Sendmail on CnetOS
1. Locate and edit the sendmail.mc file at /etc/mail
Comment out these lines from the default config by removing the dnl from in front of the line.
define(`confTO_QUEUEWARN', `4h')dnl
define(`confTO_QUEUERETURN', `5d')dnl
FEATURE(delay_checks)dnl
define(`confSMTP_LOGIN_MSG', `$j server ready at $b')dnl
I comment this line by adding the dnl in front of the line:
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
and add the following line in it’s place to allow the server to accept connections from outside, so in the end it looks like this:
DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl
2. Create the sendmail.cf file
From the /etc/mail directory, you can backup the current and then create the new sendmail.cf like this:
cp sendmail.cf sendmail.cf_`date +%m%d%y_%H%M%S`
m4 sendmail.mc > sendmail.cf
You can simply view the m4 output by doing this:
m4 sendmail.mc
3. Configure the /etc/mail/local-host-names file
add the desired domain name into this list: NCWVMPDB.***.gov
4. Configure the /etc/mail/virtusertable file to receive emails
admin@ NCWVMPDB.***.gov        real_email_address
5. Build the database or hash of the file by using the following command
makemap hash virtusertable < virtusertable
6. start/restart the mail server
/etc/init.d/sendmail restart
Q: How to install sendmail
A: $ sudo yum install sendmail
Q: cannot open `/usr/share/sendmail-cf/m4/cf.m4'
A: You need to install the sendmail-cf package. $ sudo yum install sendmail-cf
Q: NONE:0: m4: ERROR: end of file in argument list while you were using the m4 sendmail.mc > sendmail.cf
A: check the quotations in sendmail.mc file, particularly the sentence you added, to make sure that the quotation is ` and ‘, since m4 expects back-tick - tick quoting (`xxx')

No comments:

Post a Comment

Datatable static image not found on the server

When you use ```datatables.min.css``` and ```datatables.min.js``` locally, instead of datatables CDN, you may have encountered that ```sort...