In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
In this issue, the editor will bring you an example analysis of the application of Sendmail mail server in small and medium-sized enterprises. The article is rich in content and analyzed and described from a professional point of view. I hope you can get something after reading this article.
Summary: the purpose of this paper is to introduce how to use sendmail on Linux server to build mail server for small and medium-sized enterprises.
We assume that the enterprise uses a dedicated line to access Internet and has two Linux servers (Redhat 6.1)
One is directly connected to Chinanet as a firewall, which is the only entrance to Internet, as well as
DNS/SMTP server, and applied for the domain name domain.com, by the firewall server (DNS server)
Parse the domain domain.com. The other mail server runs on the internal network segment, completely with the outside
The world is irrelevant. As an email server for users on the internal local area network.
Address: assume that the permanent external address of the firewall Linux server is a.b.c.d (eth0), and the address of the internal network card
192.168.11.5 (eth2), the machine is named firewall.domain.com, and the internal mail server address is
192.168.11.1, the machine name is mail.domain.com, and the hostname entered when registering the domain is
Dns.domain.com (a.b.c.d).
Idea: first configure the DNS server to resolve the @ domain.com domain name and indicate that the MX records to internal emails
Mainframe mail.domain.com. Use this firewall only as a mail relay host, anything from the outside
It handles all messages sent by the world to the @ domain.com domain and relay to the internal mail host, only accepting
Messages with the @ domain.com suffix enter, which prevents spammer from sending spam.
On the internal mail server, configure the DS part of Sendmail to firewall.domain.com, any
Emails sent to non-internal employees are sent directly to firewall.domain.com, and domain.com is set to
In the local domain, any mail sent to the @ domain.com domain is processed by an internal alias and sent to internal users
In the mail buffer pool.
Considerations for travel users:
If employees need to receive mail from the company's server when they are away on business, one way is to dial the local ISP directly.
Then set the incoming mail server to mail.domain.com, but require mail.domain.com to be out of town
It is resolved to the external permanent address of the firewall, so that the plug-gw proxy, proxy is set on the firewall.
Any request to port 110 of the external address of the firewall goes to port 110 of the internal 192.168.11.1.
In another way, you can also build another server for Linux dial-in server, which can be dialed directly to the company to receive
Mail.
Key points: various configurations and related settings of Sendmail
One: Sendmail configuration on the firewall:
We use Redhat Linux 6.1 plus Sendmail 8.9.3 as the operating environment:
Install the configuration of operating system and firewall. It is recommended to use 3c905b or Intel pro100 network card, and configure DNS first.
Set / etc/named.conf like this:
=
Zone ". {
Type hint
File "named.ca"
}
Zone "0.0.127.in-addr.arpa" {
Notify no
Type master
File "127.0.0"
}
Zone "11.168.192.in-addr.arpa" {
Notify no
Type master
File "192.168.11"
}
Zone "domain.com" {
Notify no
Type master
File "domain.com"
}
File 192.168.11 looks like this:
@ IN SOA dns.domain.com. Root.mail.domain.com. (
1999092201 86400 3600 3600000 86400)
NS dns.domain.com.
1 PTR mail.domain.com.
5 PTR firewall.domain.com.
The file domain.com looks like this:
@ IN SOA dns.domain.com. Root.mail.domain.com. (
1999120401 86400 3600 3600000 86400)
NS dns.domain.com.
An a.b.c.d
MX 10 mail.domain.com.
Firewall An a.b.c.d
Mail An a.b.c.d
Dns An a.b.c.d
Add the following line to / etc/hosts
192.168.11.1 mail.domain.com mail
192.168.11.5 firewall.domain.com firewall
=
To configure Sendmail, first create a sendmail.mc file to generate / etc/sendmail.cf
During Redhat installation, there is a default redhat.mc in the / usr/lib/sendmail-cf/cf directory.
We modify it 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
Dnl M4 / etc/sendmail.mc > / etc/sendmail.cf
Dnl
Dnl You will need to have the sendmail-cf package installed for this to
Dnl work.
Include (`.. / m4bind cf.m4')
Define (`confDEF_USER_ID', ``8virtual')
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')
Define (`ALIAS_FILE', `/ etc/mail/aliases')
FEATURE (`smrsh', `/ usr/sbin/smrsh')
FEATURE (`mailertable', `hash-o / etc/mail/mailertable')
FEATURE (`virtusertable', `hash-o / etc/mail/virtusertable')
FEATURE (`domaintable', `hash-o / etc/mail/domaintable')
FEATURE (redirect)
FEATURE (always_add_domain)
FEATURE (use_cw_file)
FEATURE (local_procmail)
MAILER (procmail)
MAILER (smtp)
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.
Dnl FEATURE (`accept_unresolvable_domains')
Dnl FEATURE (`relay_based_on_MX')
=
Then use M4 redhat.mc > sendmail.cf to generate sendmail.cf and put it in the / etc directory. And do the following:
1. Change the definition of Fw to Fw/etc/mail/sendmail.cw in / etc/sendmail.cf
And create an empty file sendmail.cw (# touch / etc/mail/sendmail.cw)
two。 Change / etc/mail/mailertable like this:
Domain.com relay: [192.168.11.1]
And run makemap hash / etc/mail/mailertable.db
The above is the analysis of the application example of Sendmail mail server in small and medium-sized enterprises shared by Xiaobian. If you happen to have similar doubts, you might as well refer to the above analysis to understand. If you want to know more about it, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.