In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
First, the preparation before installation. Basic knowledge of mail service:
Wget http://sourceforge.net/p
SMTP: (Simple Mail Transfer Protocol) is the simple Mail transfer Protocol
POP3: post Office Protocol IMAP4:internet mail access protocol Internet Mail access Protocol
SASL:simple Authentication Secure layer simple security authentication layer (version v1 dint v2 currently mainstream v2 version)
MDA: Mail delivery Agent (procmail,maildrop)
MUA: Mail user Agent (mutt)
Mail relay: Mail Relay
MTA: message transfer Agent (sendmail,postfix,qmail,exim)
Configuration file for Postfix:
Postfix Modularization:
Master:/etc/postfix/master.cf main process profile
Mail:/etc/postfix/main.cf master profile (master profile for related configurations)
Format: parameter = value: the parameter must be written at the beginning of the absolute line (that is, there can be no spaces at the beginning of the line), and the line that begins with a blank space is recognized
It is a continuation of the previous line (that is, the lines with blanks at the beginning of the line are all unfinished content of the previous line).
Postconfig: you can directly configure and modify the main configuration file of postfix
-d: displays the default configuration
-n: modified configuration
-m: displays supported lookup table types
-A: displays supported SASL client plug-in types
-e PARMATER=VALUE: change a parameter configuration information and save it to the main.cf main configuration file
-a: types of SASL plug-ins supported on the server side
Smtp status code:
1xx: pure information
2xx: correct information
3xx: the previous step has not been completed and needs to be supplemented.
4xx: temporary error
5xx: permanent error
Smtp protocol commands:
Helo (smtp protocol)
Ehlo (esmtp protocol)
Mail from: specify the sender
Rcpt to: specify recipient
Data input text
Subject: message subject
The body of the e-mail. End
Quit exit email
II. Compile and install postfix2.10 mail service
[root@lamp ~] # ls
Postfix-2.10.10.tar.gz
[root@lamp ~] # tar xf postfix-2.10.10.tar.gz # decompress postfix software
[root@lamp ~] # ls
Postfix-2.10.10 postfix-2.10.10.tar.gz
[root@lamp ~] # cd postfix-2.10.10 # enter the decompression directory
[root@lamp postfix-2.10.10] # groupadd-g 2525 postfix # New Group postfix
[root@lamp postfix-2.10.10] # useradd-g postfix- u 2525-M-s / sbin/nologin postfix
# New user postfix-g specifies the group to which it belongs,-u specifies that UID,-M does not create a home directory, and-s specifies that login shell is a non-logon nologin.
[root@lamp postfix-2.10.10] # id postfix # View postfix user information
Uid=2525 (postfix) gid=2525 (postfix) group = 2525 (postfix)
[root@lamp postfix-2.10.10] # groupadd-g 2526 postdrop # New Group postdrop
[root@lamp postfix-2.10.10] # useradd-g postdrop-u 2526-M-s / sbin/nologin postdrop
[root@lamp postfix-2.10.10] # id postdrop
Uid=2526 (postdrop) gid=2526 (postdrop) group = 2526 (postdrop)
[root@lamp postfix-2.10.10] # yum list all | grep sasl
# check the installed sasl and make sure that the following sasl components have been installed.
This system is not registered with RHN.
RHN support will be disabled.
Cyrus-sasl.x86_64 2.1.23-8.el6 @ anaconda-RedHatEnterpriseLinux
Cyrus-sasl-devel.x86_64 2.1.23-8.el6 @ Server
Cyrus-sasl-lib.x86_64 2.1.23-8.el6 @ anaconda-RedHatEnterpriseLinux
Cyrus-sasl-md5.x86_64 2.1.23-8.el6 @ anaconda-RedHatEnterpriseLinux
Cyrus-sasl-plain.x86_64 2.1.23-8.el6 @ anaconda-RedHatEnterpriseLinux
Start the compilation installation:
[root@lamp postfix-2.10.10] # make makefiles' CCARGS=-DHAS_MYSQL-I/usr/local/mysql/include-DUSE_SASL_AUTH-DUSE_CYRUS_SASL-I/usr/include/sasl-DUSE_TLS''AUXLIBS=-L/usr/local/mysql/lib-lmysqlclient-lz-lm-L/usr/lib64/sasl2-lsasl2-lssl-lcrypto'
[root@lamp postfix-2.10.10] # make & & make install
# you need to specify the relevant path, which does not need to be changed, and all can be done by default.
Third, use postfix mail service
[root@lamp ~] # postfix start # start the postfix process
Postfix/postfix-script: starting the Postfix mail system
[root@lamp ~] # netstat-tlnp # check whether port 25 of the mail service is listening
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
Tcp 0 0 127.0.0.1 631 0.0.0.0 * LISTEN 1553/cupsd
Tcp 0 0 0.0.0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0
Tcp 0 0: 111: * LISTEN 1385/rpcbind
Tcp 00: 80: * LISTEN 2001/httpd
Tcp 0 0: 22:: * LISTEN 1659/sshd
[root@lamp ~] # tail / var/log/maillog # View postfix mail service log information
Feb 28 13:29:01 lamp postfix/postfix-script [27811]: starting the Postfix mail system
Feb 28 13:29:01 lamp postfix/master [27814]: daemon started-- version 2.10.10, configuration / etc/postfix
[root@lamp ~] # telnet localhost 25 # send email to this machine
Trying 127.0.0.1...
Connected to localhost.
Escape character is'^]'.
220 lamp.com ESMTP Postfix
Helo localhost
250 lamp.com
Mail from:root # Sender
250 2.1.0 Ok
Rcpt to:donggen # recipient
250 2.1.5 Ok
Data # message body
354 End data with.
Subject:How are you these days? # subject of email
Are you gua le ma?
. #. Closing text
250 2.0.0 Ok: queued as 01311413
Quit # quit exit sending email
221 2.0.0 Bye
Connection closed by foreign host.
[root@lamp ~] # tail / var/log/maillog # View log files
Feb 28 14:56:20 lamp postfix/master [28749]: daemon started-- version 2.10.10, configuration / etc/postfix
Feb 28 14:56:44 lamp postfix/smtpd [28763]: warning: dict_nis_init: NIS domain name not set-NIS lookups disabled
Feb 28 14:56:44 lamp postfix/smtpd [28763]: connect from localhost.localdomain [127.0.0.1]
Feb 28 14:57:27 lamp postfix/smtpd [28763]: 01311413: client=localhost.localdomain [127.0.0.1]
Feb 28 14:58:12 lamp postfix/cleanup [28766]: 01311413: message-id=
Feb 28 14:58:12 lamp postfix/qmgr [28751]: 01311413: from=, size=332, nrcpt=1 (queue active)
Feb 28 14:58:12 lamp postfix/local [28776]: warning: dict_nis_init: NIS domain name not set-NIS lookups disabled
Feb 28 14:58:12 lamp postfix/local [28776]: 01311413: to=, orig_to=, relay=local, delay=56, delays=56/0.01/0/0.01, dsn=2.0.0, status=sent (delivered to mailbox)
Feb 28 14:58:12 lamp postfix/qmgr [28751]: 01311413: removed
Feb 28 14:58:17 lamp postfix/smtpd [28763]: disconnect from localhost.localdomain [127.0.0.1]
[donggen@lamp ~] $mail # switch users and check email.
Heirloom Mail version 12.4 7-29-08. Type? For help.
"/ var/spool/mail/donggen": 1 message 1 new
N 1 root@lamp.com Tue Feb 28 14:58 14 root@lamp.com Tue Feb 452 "How are you these days?"
Status: R
Are you OK?
Postfix service startup script: you can use service postfix start | restart
The script is as follows: vim / etc/init.d/postfix
1. Edit the postfix service startup script
[root@lamp ~] # vim / etc/init.d/postfix
#! / bin/bash
#
# postfix Postfix Mail Transfer Agent
#
# description: Postfix is a Mail Transport Ageent,which is the progrom
# that moves mail from one mochine to another.
# processname:master
# pidfile:/var/spool/postfix/pid/master.pid
# config: / etc/postfix/main.cf
# config: / etc/postfix/master.cf
# Source function library.
. / etc/rc.d/init.d/functions
# Source networking configuretion.
. / etc/sysconfig/network
# Check that networking is up.
[$NETWORKING = "NO"] & & exit 3
[- x / usr/sbin/postfix] | | exit 4
[- d / etc/postfix] | | exit 5
[- d / var/spool/postfix] | | exit 6
RETVAL=0
Prog= "postfix"
Start () {
# start daemons.
Echo-n $"Starting postfix:"
/ usr/bin/newaliases > / dev/null 2 > & 1
/ usr/sbin/postfix start 2 > / dev/null 1 > & 2 & & success | | failure $$prog start "
RETVAL=$?
[$RETVAL-eq 0] & & touch / var/lock/subsys/postfix
Echo
Return $RETVAL
}
Stop () {
# stop daemons.
Echo-n $"Shutting down postfix:"
/ usr/sbin/postfix stop 2 > / dev/null 1 > & 2 & & success | | failure $$prog stop "
RETVAL=$?
[$RETVAL-eq 0] & & rm-f / var/lock/subsys/postfix
Echo
Return $RETVAL
}
Reload () {
Echo-n $"Reloading postfix:"
/ usr/sbin/postfix reload 2 > / dev/null 1 > & 2 & & success | | failure $$prog reload "
RETVAL=$?
Echo
Return $RETVAL
}
Abort () {
/ usr/sbin/postfix abort 2 > / dev/null 1 > & 2 & & success | | failure $$prog abort "
Return $?
}
Flush () {
/ usr/sbin/postfix flush 2 > / dev/null 1 > & 2 & & success | | failure $$prog flush "
Return $?
}
Check () {
/ usr/sbin/postfix check 2 > / dev/null 1 > & 2 & & success | | failure $$prog check "
Return $?
}
Restart () {
Stop
Start
}
# See how we were called.
Case "$1" in
Start)
Start
Stop)
Stop
Restart)
Stop
Start
Reload)
Reload
Abort)
Abort
Flush)
Flush
Check)
Check
Status)
Status master
Condrestart)
[- f / var/lock/subsys/postfix] & & restart | |:
*)
Echo $"Usage: $0 {start | stop | restart | reload | abort | flush | check | status | condrestart}"
Exit 1
Esac
Exit $?
# END
[root@lamp ~] # chmod + x / etc/init.d/postfix
[root@lamp ~] # chkconfig-- add postfix # add postfix to boot
[root@lamp ~] # chkconfig-- list postfix # check whether postfix starts automatically
[root@lamp ~] # service postfix restart
Close postfix: [OK]
Start postfix: [OK]
2. Do some basic configuration, test and start postfix and send messages.
Modify / etc/postfix/main.cf
Modify the following configurations (red section):
Myhostname = mail.lamp.com
Myorigin =
Mydomain =
Mydestination =
Mynetworks =
Description:
The myorigin parameter is used to indicate the domain name of the sender, that is, to disguise the sending address.
The myhostname parameter specifies the hostname of the host running the postfix mail system, which is set to the local machine name by default
The mydomain parameter specifies its own domain name. By default, postfix deletes the first part of myhostname as the value of mydomain.
The mydestination parameter specifies the domain name of the recipient when postfix receives the email, that is, the domain name to which your postfix system will receive the email.
The mynetworks parameter specifies the network address of your network, and the postfix system distinguishes whether the user is remote or local according to its value
If it is a local network user, allow it to access
The inet_interfaces parameter specifies the network interface on which the postfix system is listening
Note:
1. Parameter lines and comment lines cannot be on the same line in the configuration file of postfix
2. The value of any parameter does not need to be in quotation marks, otherwise, the quotation marks will be used as part of the parameter value.
3. Execute postfix reload after each modification of the parameter and its value to make it effective, but if you modify the inet_interfaces
Then you need to restart postfix
4. If you have multiple values for a parameter, you can put them on different lines. You only need to put an extra space before each subsequent line
Postfix will treat the line of text with the first character as a space or tab as a continuation of the previous line
3. Modify the host name
[root@lamp ~] # hostname mail.lamp.com # temporarily modify the host name and take effect immediately. Restart fails.
[root@lamp ~] # hostname
Mail.lamp.com
[root@lamp ~] # vim / etc/sysconfig/network # takes effect permanently. Modify the hostname and take effect after restart
NETWORKING=yes
HOSTNAME=mail.lamp.com
[root@mail ~] # hostname
Mail.lamp.com
4. Install and configure DNS server
[root@mail ~] # rpm-qa | grep bind # check whether DNS has been installed on the system
PackageKit-device-rebind-0.5.8-13.el6.x86_64
Bind-libs-9.7.0-5.P2.el6.x86_64
Samba-winbind-clients-3.5.4-68.el6.x86_64
Bind-utils-9.7.0-5.P2.el6.x86_64
Rpcbind-0.2.0-8.el6.x86_64
[root@mail ~] # rpm-e bind-libs bind-utils # Uninstall the installed bind first
[root@mail ~] # yum install bind.x86_64 bind-libs bind-utils
Loaded plugins: refresh-packagekit, rhnplugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Resolving Dependencies
-> Running transaction check
-> Package bind.x86_64 32 Vista 9.7.0-5.P2.el6 set to be updated
-> Package bind-libs.x86_64 32 Vista 9.7.0-5.P2.el6 set to be updated
-> Package bind-utils.x86_64 32 Vista 9.7.0-5.P2.el6 set to be updated
-> Finished Dependency Resolution
Dependencies Resolved
=
Install 3 Package (s)
Upgrade 0 Package (s)
Total download size: 4.4 M
Installed size: 8.9 M
Is this ok [y/N]: y
Downloading Packages:
-
Total 80 MB/s | 4.4 MB 00:00
Complete! # installation complete
[root@mail ~] # vim / etc/named.conf # Edit DNS configuration file
[root@mail ~] # service named start # start the DNS service
Start named: [OK]
[root@mail ~] # netstat-tlnp # View the listening port
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
Tcp 0 0 0.0.0. 014 56201 0.0.0. 0 LISTEN 1450/rpc.statd
Tcp 0 0 0.0.0.0 3306 0.0.0.015 * LISTEN 1958/mysqld
Tcp 0 0 10.109.134.237 53 0.0.0.0 * LISTEN 7794/named
Tcp 0 0 127.0.0.1 53 0.0.0.0 * LISTEN 7794/named
Tcp 0 0 192.168.122.1 53 0.0.0.0 * LISTEN 2229/dnsmasq
Tcp 0 0 0.0.0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0
Tcp 0 0 127.0.0.1 953 0.0.0.0 * LISTEN 7794/named
Tcp 0 0 0.0.0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0
[root@mail ~] # vim / etc/named.rfc1912.zones # Edit forward and reverse proxy settings
Add the following at the end:
Zone "lamp.com" IN {
Type master
File "lamp.com.zone"
Allow-update {none;}
Allow-transfer {none;}
}
Zone "134.109.10.in-addr.arpa" IN {
Type master
File "10.109.134.zone"
Allow-update {none;}
Allow-transfer {none;}
}
[root@mail ~] # named-checkconf # check the dns configuration file for syntax errors
[root@mail ~] # named-checkconf / etc/named.conf # specifies which DNS configuration file is checked for syntax errors
[root@mail ~] # cd / var/named/
[root@mail named] # vim lamp.com.zone # Edit the forward proxy file as follows
[root@mail named] # vim 10.109.134.zone # Edit the reverse proxy file as follows
[root@mail named] # chgrp named lamp.com.zone 10.109.134.zone # reorganized to named
[root@mail named] # chmod 640 10.109.134.zone lamp.com.zone # modify permission to 640
[root@mail named] # ll
Total dosage 36
-rw-r-. 1 root named 285 March 1 11:46 10.109.134.zone
Drwxrwx---. 2 named named 4096 March 1 11:01 data
Drwxrwx---. 2 named named 4096 March 1 11:02 dynamic
-rw-r-. 1 root named 292 March 1 11:43 lamp.com.zone
-rw-r-. 1 root named 1892 February 18 2008 named.ca
-rw-r-. 1 root named 152 December 15 2009 named.empty
-rw-r-. 1 root named 152 June 21 2007 named.localhost
-rw-r-. 1 root named 168 December 15 2009 named.loopback
Drwxrwx---. 2 named named 4096 May 26 2010 slaves
[root@mail named] # named-checkzone "lamp.com" lamp.com.zone # check whether the forward agent file is correct
Zone lamp.com/IN: loaded serial 2017030101
OK
[root@mail named] # named-checkzone "134.109.10.in-addr.arpa" 10.109.134.zone # check whether the reverse proxy profile is correct
Zone 134.109.10.in-addr.arpa/IN: loaded serial 2017030101
OK
[root@mail named] # service named restart # restart the named service
Stop named: [OK]
Start named: [OK]
[root@mail named] # chkconfig named on # add to boot list
[root@mail named] # dig-t MX lamp.com @ 10.109.134.237 # Test whether the parsing MX record is normal
; DiG 9.7.0-P2-RedHat-9.7.0-5.P2.el6-t MX lamp.com @ 10.109.134.237
;; global options: + cmd
;; Got answer:
;;-> > HEADERHEADER
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.