Sendmail configuration Policy

Source: Internet
Author: User

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:

 
 
  1. divert(-1)  
  2. dnl This is the macro config file used to generate the /etc/sendmail.cf  
  3. dnl file. If you modify thei file you will have to regenerate the  
  4. dnl /etc/sendmail.cf by running this macro config through the m4  
  5. dnl preprocessor:  
  6. dnl m4 /etc/sendmail.mc > /etc/sendmail.cf  
  7. dnl You will need to have the Sendmail-cf package installed for this to work.  
  8. include(`/usr/lib/Sendmail-cf/m4/cf.m4')  
  9. define(`confDEF_USER_ID',``8:12'')  
  10. OSTYPE(`linux')  
  11. undefine(`UUCP_RELAY')  
  12. undefine(`BITNET_RELAY')  
  13. define(`confAUTO_REBUILD')  
  14. define(`confTO_CONNECT', `1m')  
  15. define(`confTRY_NULL_MX_LIST',true)  
  16. define(`confDONT_PROBE_INTERFACES',true)  
  17. define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')  
  18. FEATURE(`smrsh',`/usr/sbin/smrsh')  
  19. FEATURE(`mailertable',`hash -o /etc/mail/mailertable')  
  20. FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable')  
  21. FEATURE(redirect)  
  22. FEATURE(always_add_domain)  
  23. FEATURE(use_cw_file)  
  24. FEATURE(local_procmail)  
  25. MAILER(smtp)  
  26. MAILER(procmail)  
  27. FEATURE(`access_db')  
  28. FEATURE(`blacklist_recipients')  
  29. dnl We strongly recommend to comment this one out if you want to protect  
  30. dnl yourself from spam. However, the laptop and users on computers that do  
  31. dnl not hav 24x7 DNS do need this.  
  32. FEATURE(`accept_unresolvable_domains')  
  33. 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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.