In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "how to configure Sendmail". In the actual case operation process, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!
download and install
The latest version of Sendmail is 8.11.3 and the file size is 1.2MB.
1. decompression
# tar -zxvf Sendmail-8.11.3.tar.gz
#cd Sendmail-8.11.3
If the package is in rpm format, extract the installation as follows:
#rpm -ivh Sendmail-8.11.3-src.rpm
2. compilation
# ./ Build
If nothing goes wrong, the compilation passes, and the directory is automatically generated after compilation: obj.Linux.2.2.18.i686(this is the core name of the author, maybe your kernel name is different).
3. installation
#./ Build install
If the package is in rpm format, it should be compiled as follows:
# rpm -ba Sendmail-8.11.1.spec
#rpm -ivh Sendmail*.rpm
At this point, compilation and installation are complete
allocation strategy
sendmail.cf is Sendmail's configuration file, which determines Sendmail's attributes. This file defines which domain the mail server works for. The content is a specific macro that most people fear because there is so much macro code in the file. sendmail.cf is usually compiled from a file ending in mc. For example, Redhat comes with a redhat.mc, and users can modify some of these settings to suit themselves. My sendmail.mc file reads 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')
Compile sendmail.mc to produce the required sendmail.cf file: # m4 /etc/sendmail.mc > /etc/mail/sendmail.cf
After generating sendmail.cf, edit sendmail.cf In the file, look for DS and add the mail server name and domain name to ensure that when you send a message to username@mail.domain.com or username@domain.com, the user will receive it, as follows:
# Alias for this host
Cw mail.domain.com domain.com
Then you can start Sendmail: # /usr/sbin/Sendmail -bd -q20m.
Sendmail 8.9.x and later versions, by default, do not forward (Relay) to unauthenticated computers, so if you want to forward mail to other computers than this computer, then you should clearly tell Sendmail in the corresponding configuration file which hosts to forward. If you want to forward to any host regardless of validation, you can add FEATURE(promiscuous_relay) to the sedmail.mc file.
However, if your computer is on the public network, it is recommended that you do not do this, because if you do, anyone can use your computer to forward mail, especially some malicious people or some spammers (spammers) will use your mail server's forwarding function to send a lot of spam.
instructions for use
Normally, Sendmail does not relay messages for mail services, which prevents malicious people from using someone else's mail server to send mail. By default, Sendmail has Relay turned off. If you want to Relay mail for another server, you can set it as follows--add the machine for which you want to relay mail to the access file, in the format:
hostname RELAY
ipaddress RELAY
If you want to relay messages for multiple machines in a domain, you can add their subnet IP or domain name directly to the/etc/mail/access file, as follows:
access file content:
domainname.com RELAY (Allow relay messages for all computers with domain domainname)
localhost RELAY
192.168.1.0 RELAY (for 192.168.1.0 all machines in this network relay mail)
This file uniquely determines which machines and domains can use the mail server to forward mail. After completion, it needs to be compiled: #makemap hash access.db < access.
Other configuration file relationships are not very large, you can temporarily use the default installation content. Sendmail should be working properly.
Next is to test the mail sending function of the mail server. Note: When testing, don't only test local users. For example, your domain is abc.com. When testing, don't only test user1@abc.com users on the mail server. Because user1 is local, the mail server can relay it. You should test the server from another machine on your local area network using a mail client such as Outlook.
Fixed IP users (including users of multinational companies) have no problem and can add their fixed IP to the database. Not applicable to people who travel frequently.
debugging
Error 1. After configuring POP and SMTP server addresses correctly in Outlook, the following error occurs:
Unable to connect to server. Account: '192.168.0.1', Server: ' 192.168.0.1',
Protocol: POP3, Port: 110, Security (SSL): No, Socket Error: 10061,
Error Number: 0x800 CCC0E
The main reason for this error is that POP3D and IMAPD are not running.
Solution: Open/etc/inetd.conf and find it.
# pop-3 stream tcp nowait root /usr/sbin/tcpd ipop3d
Delete the #.
Open/etc/services to find
#pop3 110/tcp
#pop3 110/udp
Delete the first two lines of #.
In this way, after restarting inetd, pop3 port 110 can receive! If it still doesn't work, check if POP3 service package is installed!
Mistake 2: Many dial-up users experience the following problems:
The message could not be sent because the server rejected one of the recipients. The rejected E-mail address was "lcl@lettee.com.cn" Subject 'ffd', Account: ' mailns.lettee.com.cn (1)', Server: ' mailns.lettee.com.cn', Protocol: SMTP, Server response: '551 we do not relay', Port: 25, Security (SSL): No, Server error: 551, Error number: 0x800 CCC79
This error indicates that Sendmail cannot relay messages for the client you are using.
Cause: Since Sendmail 8.9.3, Relay has been restricted by default, mainly to prevent spammers. Local users using this server can send messages, while non-local users cannot send messages through it. Solution: Add the IP of the client to access and recompile access.
Many friends often make the mistake of "I have added the IP address of the mail server to access and makemap the database file, but it still doesn't work." In fact, you made a mistake, should be added to the IP of the client-try to dial your PC IP to access, makemap, you do not have to restart Sendmail, try, send successfully!
As mentioned earlier, if you dial up, the next time you dial up, your IP will change, and of course your email server will not let you send messages. If the company's employees often travel, they often dial the local ISP to send and receive mail when they are away from home. There must be no problem receiving mail, but SMTP does not perform password verification for mail at present, and the mail server has to perform forwarding control, not forwarding to hosts that are not recorded in the database. Therefore, the mail could not be sent out. In this case, if you set all forwarding functions as mentioned earlier in this article, you can let dial-up users send messages, but at the same time, the problem is that there will be a lot of Spam, it is difficult to achieve the best of both worlds.
There are two ways to solve the above problems, one is to use SMTP authentication, that is, before the user sends the mail, the mail server performs user identity authentication, and if it passes, the server will send the mail for it, otherwise it will refuse to send the mail; the second way is to use dynamic forwarding authorization control.(Dynamic Relay authorization control), its working principle is: dial-up users dial the Internet, first receive mail, if the user can receive mail correctly, then automatically add the IP of the user who just received the mail in access.db, and allow this IP to send. However, if this IP does not send/receive mail within 30 minutes, SOR will delete this IP from access.db. This mechanism ensures that dial-up users can send E-mail through remote mail servers without SMTP authentication.
"How to configure Sendmail" content is introduced here, thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!
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.