Redhat 7.1 sendmail Configuring FAQ

zhaozj2021-02-08  282

Redhat 7.1 Sendmail Configuring FAQ1, how to get Sendmail: from the Redhat website http://www.redhat.com or your installation CD: sendmail-cf-8.11.0-8.i386.rpm Using rpm -ihv sendmail- CF-8.11.0-8.i386.rpm Installation from http://www.sendmail.org to get sendmail.8.12.0.tar.gz compression package, you need yourself to compile installation. Use: tar -zxvf sendmail.8.12.0.tar.gzcd sendmail.8.12.0./build ./build install installation

2, what is the main configuration file: /etc/sendmail.cf This file can be included in the system, you can also generate this file using the /etc/mail/sendmail.mc file: M4 / ETC / Mail / Sendmail. MC> /etc/sendmail.cf

3. How to set up SMTP Rules to prevent others from maliciously using my SMTP server. You can set up / etc / mail / access files, only allowing internal networks or hosts or IPs within the specified range to use the mail server as a RELAY

4, SENDMAIL default, is it used by others as a mail forwarding server? The default state is not supporting Open Relay, which only allows localhost and localdomain to forward the mail server, you can modify the / etc / mail / access file to join the people you want to allow, such as adding a row inside 192.168 relay can allow all IP uses your server to forward mail with a computer starting with 192.168.

5, how to configure the sendmail as the MDA? MDA refers to the Mail Delivery Agent. General Sendmail's RPM packages are configured to configure Procmail as their MDA. If not, you can join MAILER (procmail) in the Sendmail.mc file, then generate sendmail.cf File.

6, how to set automatic forwarding. Create a file in the user's home directory .Forward, write the forwarded address.

7. Use Outlook to send trust to the server, should be smtp no problem, but you can't accept it, but you have set to NO in /etc/xinetd.d/pop3s, but it is not.

First of all, I should notice that POP3S is different from POP3, so you have no effect; if you are fully installed, you will have an IPOP3 file in /etc/xinetd.d, this is really applied to POP3 110 port. If not, you can create such a file yourself.

8. I installed Sendmail in MailServer (IP: 192.168.1.1), machine DNS named mail.net, now you can send and receive mail, but you can't send up the form of UserName@192.168.1.1, How to configure?

It should be username @ [192.168.1.1] sending and receiving emails with IP address can only be used in the form of username @ [ip_address], which is not a problem that the user is not used to. Otherwise, even if your server can accept the format without [], other servers may still be unacceptable. You can modify the DM item of Sendmail.cf to DM [a.b.c.d] a.b.c.d is the IP address of your server, which is the form of username @ [a.b.c.d] through the email it.

9. Can Sendmail build a mailing group! Just build an individual name, Aliases in Sendmail provide such a function. For example, if you want to use the Xuser group, place two users: A and B, then you can add a line in the / etc / aliases file: XUser: a, b If you want to add more users, you can Continue to add after B. After the modification is completed, use the newaliase command to make the modification take effect. 10. How to limit the maximum user email to 10m? Setting in Sendmail.cf: # Maximum Message Size O MaxMessagesize = 1000000

11. How to send a letter from Sendmail, I want to know a few letters waiting to send Mailq

12. Which RPM package is supplied with POP3 service? IMAP

13, I use Redhat 7.1, this machine is normal Telent Localhost 25 can, but the server does not open 25 ports, from the network unaccessible, sendmail is not controlled by Xinetd, from where to open 25 mouth?

RH7.1 By default SMTP is only bound 127.0.0.1, so you cannot access from network, you can open SMTP, as follows: edit /etc/sendmail.cf Find: # SMTP daemon optionso daemonportOptions = port = SMTP, addr = 127.0. 0.1, Name = MTA Add: # SMTP Daemon Optionso daemonportOptions = port = SMTP, addr = Your IP, Name = MTA Save!

14. By default, RELAY rules

By default, if you have any settings (Sendmail Server), you can only send mail, network (local area network or internet), any other host on the network, cannot send mail to the SMTP server. If you want to be sent, you need to meet any of the following conditions (do not need to be satisfied):

1. Sender identity belongs to "Local or Allowed Senders". 2. Receiver identity belongs to "Local or Allowed Receiver".

So what is "local / allowed sender"? In fact, there is only one, it is listed in File / etc / mail / relay-domains (without this file after the default installation, you can create it) or / etc / mail / access from the domain name or IP address line, such as:

abc.com (/ etc / mail / relay-domains) abc.com relay (/ etc / mail / access) If the domain name is listed in the Relay-Domains / Access file, you will find / look for the sender's IP address / ETC / HOSTS file (in this case, because the Linux server is used by default, lookup DNS is first looking for the / etc / hosts file to see if there is a host domain name corresponding to this IP address, if there is no reverse DNS lookup, if Ability to find out, and the domain part of the searched host belongs to the domain name listed in the above two files, and then the host name is looking for the IP address (host A record) and the sender IP address. The same, the Relay mail is allowed, which indicates that the sender belongs to the permitted sender.

That is to say, first look at the definition in the /etc/host.conf file, which is usually true: Order Hosts, Bind Multi On

The ORDER line refers to the precedent / etc / hosts, then find the DNS database. If the line corresponding to the sender IP address is not found in / etc / hosts, then find the DNS, reverse resolve the sender IP, and if you can find the host record of the sender IP in the reverse DNS database, Then, the host name found, then from the DNS, if the lookup is consistent, the relay is allowed to be the same as the above case, belongs to the first allowed RELAY rule. It should be noted that it is necessary to be resolved and unanimous, otherwise it is not allowed to record "May Bepeged" in / var / log / maillog in / var / log / maillog. But not all records "May Bepeged" information is not allowed in the / var / log / maillog file, and some cases have recorded a warning message says "May Be forged", but the email is still receiving. In the case of the following: for example: on the B-machine / etc / mail / relay-domains, there are two lines of ABC.COM Yahoo.com

If A is sent to B to Someone@yahoo.com. There is no corresponding record line corresponding to 192.168.11.12 in the B-machine / etc / hosts. And in the B-machine (DNS server), IP address 192.168.11.12 can not be reverse, or can do reverse lookup, if you find it out for jephe.abc.com but in the forward look (for the main DNS for the abc.com The database in the database corresponds to the a record corresponding to the host Jephe, or the IP address of the host Jephe is not 192.168.11.12. but. The recipient is someone@yahoo.com, and the domain Yahoo.com is in / etc / mail / relay-domains. Then it is still allowed. However, a warning message may be forged to / var / log / maillog file, which allows the second Mail Relay rule: the recipient is the allowed recipient. What is "local or allowed receiver"?

This is relatively simple, that is, the domain part of the recipient's Email address is listed in the / etc / mail / service-domains or / etc / mail / access file, as the case above, send any reception in the @ Yahoo.com domain Both are allowed to be received. Pay attention to a range problem, if the sender's domain name (according to the previous / etc / hosts or positive reverse DNS unison) is listed in these two files, the sender can send to anyone's mail, It can be received, but if this is not this, only the retribute of the domain name of the recipient's Email address in these two files. The latter's situation is subject to the scope of the subject.

Another question of another payment is to be aware, that is, the domain name listed in the file relay-domains or access is both for the sender, and is also for the recipient. For the sender, check / etc / hosts, and forward DNS, for the recipient, only the domain portion of the recipient email address is checked.

Also, for the second Mail Relay rule, there is more situations, ie: If the receiver's domain name portion is listed in the /etc/sendmail.cw, the recipient is also a local recipient. (By default, sendmail.cw is under / etc, of course, you can also change the Sendmail.cw path in /etc/sendmail.cf) and check the alias file Aliases to expand alias. 15. What is the SMTP protocol SMTP (Simple Mail Transfer Protocol), which is a simple mail transfer protocol, which mainly specifies how the basic email submission system passes packets. How to accept emails from users, how to display emails, how to store users, how to send packets in how to send packets in how to send packets in electronic mail systems, and email systems. In SMTP, communication between clients and servers is composed of readable text. Start, the client creates a TCP connection with the server (usually TCP 25 port) through three handshakes, and then waits for the server to send 220 Ready for Mail. After receiving 220 packets, the client sends a helo command. After that, the email interaction begins with the mail command. In the mail command, there is a "from:" field, which is used to notify the sender in an error. After receiving the mail command, the server sends 250 ok as a response, indicating everything. After the mail command is successful, the client can tell the server to the server, which is implemented in a series of RCPT commands. After the server receives each RCPT command, send 250 ok as a response, indicating correctly; or sending 550 No Such User Here, indicating that there is no user. When the client's RCPT command gets the correct response, you can send data to the data command. After receiving the data command, the server sends 354 Start Mail Input; End With. Give response. Where End With. The five consecutive characters used to end the email message are: Enter, wrap, round dot, Enter, Row, this is why it is sent to email with Mail, and finally contains only a dot. The line indicates the end of the end.

16. The main content of the Sendmail.cf configuration Local Information Defines the information about the personal host. General Macros defines the macro classes of the local network defines the host name group or domain name group of the special mail transfer program or the version of the version of the sendmail.cf file. Number of Special Macros defines some special macro options used by Sendmail Sendmail option Message Precedence Define the priority value of the various messages used by Sendmail Trusted users definition to ignore the user format of Headers of the sender address when sending the message Defines Sendmail insertion. Mail Header Rules Defines Rules for Rewriting Mail Address MAILERS Definition Sendmail Used to Call the Mail Transporter RuleSet Zero Defines a special rewrite rule called RuleSet Zero Machine-Dependent Part of RuleSet Zero Definition and Configuration RuleSet Zero section

17. All internal macro A RFCS822 format The original date B RFCS822 format The current date C hop count D UNIX format date E SMTP data item F "from" The sender G relative to the sender of the recipient Address H Receive Host I Queue Identifies the formal domain name of the J node L UNIX line format n The operator in the name O address in the error message set Pidmail's PID Q default sender address format R used protocol S sender The value of the host name T Current time indicates that the version number of the receiver user V sendmail, the host name X sender full name Z Receiver host directory 18, the meaning of each instruction in the sendmail.mc file: Divert (-1) Managing Output Characters DNL When DEFINE is automatically generated, you can use DNL to delete the incline containing a file Define Arg 1 Arg 2 Define Macro Argument1 Set to Value Argument2 Undifine Arg 1 Cancel Arg1 definition OSTYPE (Linux) Define the type of operating system Feature function option, corresponding to file name inside / usr / lib / sendmail-cf / feature define all necessary mail delivery agent, MTA Masquerade_as is used to handle multi-host name issues

19, sendmail alias

Alias ​​is one of the most important features of Sendmail. It defines in Aliases. The location of the AliaSes file is specified by option a in Sendmail.cf, typically located in the / etc directory. AliaSes is a text file, of which the format of each line is as follows: Alias: Recipeint [, Recipeint, ...] where Alias ​​is the name of the address in the message, Recipient is the name of the mail destination address. Mail destination address names can have a lot, each with a comma-separated space. Here, there are several main usages of the alias: ◆ Protecting the login account Many network hacker offensive network computers The first step is to get the account of legitimate users on the target, and the email account is usually the same as the login account, which makes the hacker organically multiplied. But you can use alias to protect the account of legitimate users. A legal user's landing account is xiaoniao, and his email account can be Aaabbb. Just add "AAABBB: Xiaoniao" in the alias file to achieve this. ◆ Email forwarding If you want to automatically forward emails from Xiaoniao users to root users, just join "Xiaoniao: root" in the alias file. Another example is the user xiaoniao leaves this unit. From a security perspective, he should delete his user account. But because he is impossible to inform everyone right away, he wants to keep his original email account for a while. This is just to join "Xiaoniao: New Email Address" in the alias file. ◆ The most important feature of the implementation of the mail list is to implement a list of mail. Through it, you can implement a recipient address and will send us to many people. For example, set a mailing list on the host, including XIaoniao, Lyong, Twang, and Lwang. Just join in the alias file: xn_group: xiaoniao, lyong, twang, lwang Owner_xn_group: xiaoniao When the recipient is XN_GROUP, the letter will be automatically sent to Xiaoniao, Lyong, Twang and Lwang. When sending an email, if an error is wrong, the error message will be sent to XIAONIAO.

转载请注明原文地址:https://www.9cbs.com/read-1923.html

New Post(0)