Sendmail. cf is the Sendmail configuration file, which determines the attributes of Sendmail. This file defines the domain in which the email server is working. The content is a special macro, and most people are afraid of it, because there are too many macro code in the file. Sendmail. cf is usually generated by compiling a file ending with mc. For example, if Redhat comes with a redhat. mc, you can modify some of the settings to suit yourself.
The content of my sendmail. mc file is as follows:
- divert(-1)
- dnl This is the macro config file used to generate the /etc/sendmail.cf
- dnl file. If you modify thei file you will have to regenerate the
- dnl /etc/sendmail.cf by running this macro config through the m4
- dnl preprocessor:
- dnl m4 /etc/sendmail.mc > /etc/sendmail.cf
- dnl You will need to have the Sendmail-cf package installed for this to work.
- include(`/usr/lib/Sendmail-cf/m4/cf.m4')
- define(`confDEF_USER_ID',``8:12'')
- OSTYPE(`linux')
- undefine(`UUCP_RELAY')
- undefine(`BITNET_RELAY')
- define(`confAUTO_REBUILD')
- define(`confTO_CONNECT', `1m')
- define(`confTRY_NULL_MX_LIST',true)
- define(`confDONT_PROBE_INTERFACES',true)
- define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')
- FEATURE(`smrsh',`/usr/sbin/smrsh')
- FEATURE(`mailertable',`hash -o /etc/mail/mailertable')
- FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable')
- FEATURE(redirect)
- FEATURE(always_add_domain)
- FEATURE(use_cw_file)
- FEATURE(local_procmail)
- MAILER(smtp)
- MAILER(procmail)
- FEATURE(`access_db')
- FEATURE(`blacklist_recipients')
- dnl We strongly recommend to comment this one out if you want to protect
- dnl yourself from spam. However, the laptop and users on computers that do
- dnl not hav 24x7 DNS do need this.
- FEATURE(`accept_unresolvable_domains')
- dnl FEATURE(`relay_based_on_MX')
Configure and compile Sendmail. mc to generate the desired sendmail. cf file: # m4/etc/sendmail. mc>/etc/mail/sendmail. cf.
After sendmail. cf is generated, edit sendmail. cf. In the file, look for DS and add the mail server name, domain name behind it to ensure that when you send a mail in a username@mail.domain.com or username@domain.com, the user will receive, as shown below:
# Alias for this host
Cw mail.domain.com domain.com
Then, you can start Sendmail: #/usr/sbin/Sendmail-bd-q20m.
For Versions later than Sendmail 8.9.x, by default, do not forward (Relay) unverified computers. Therefore, if you want to forward emails to computers other than this host, the corresponding configuration file should clearly tell Sendmail which hosts should be forwarded in the configuration file. If verification is not considered and any host is forwarded, you can add a line: FEATURE (promiscuous_relay) to the sedmail. mc file ).
However, if your computer is on the Internet, it is recommended that you do not do this, because after this, anyone can use your computer to forward emails, in particular, spammer, spammers, or spammers, will use the forwarding function of your email server to send a large number of spam messages.