In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to install Postfix email under Linux. It is very detailed and has certain reference value. Friends who are interested must read it!
The construction of this set of mail system, from how to send mail to receive mail to authentication to virtual user virtual domain, as well as anti-virus and anti-spam are introduced in detail. In the process of building, the necessary parameter explanation and principle are told, so that we can better understand the mail system.
Uninstall the native postfix$ rpm-Q postfixpostfix-2.6.6-2.2.el6_1.x86_64 $rpm-ev postfix--nodeps environment preparation
\ 1. YUM should be configured.
\ 2. The compilation environment should be configured.
PS: if there is a problem with these two steps, you can see the YUM and compilation section provided on this website.
Install MySQL server $yum install mysql-server mysqlmysql- devel perl-DBD-MySQL$ chkconfig mysqld on$ service mysqld restart$ rpm-Q mysqlmysql-5.1.71-1.el6.x86_64 install cyrus-sasl and start saslauthd service $yum install cyrus-sasl cyrus-sasl-devel$ service saslauthd start$ chkconfig saslauthd on view postfix user $id postfixuid=89 (postfix) gid=89 (postfix) group = 89 (postfix), 12 (mail)
For users who send e-mail, use the postfix users that come with the system. Remember UID:89 and GID:89. These two ID numbers will be used in many places. If this ID number is changed, then there will be a lot of directory permissions that need to be changed in Postfix installation.
Compile and install postfix-2.11.7$ tar zxvf postfix-2.11.7.tar.gz$ cd postfix-2.11.7$ make makefiles' CCARGS=-DHAS_MYSQL-I/usr/include/mysql-DUSE_SASL_AUTH-DUSE_CYRUS_SASL-I/usr/include/sasl-DUSE_TLS''AUXLIBS=-L/usr/lib64/mysql-lmysqlclient-lz-lm-L/usr/lib/sasl2-lsasl2-lssl-lcrypto'$ tar zxvf postfix-2.11.7.tar. Gz$ cd postfix-2.11.7$ make makefiles' CCARGS=-DHAS_MYSQL-I/usr/include/mysql-DUSE_SASL_AUTH-DUSE_CYRUS_SASL-I/usr/include/sasl-DUSE_TLS''AUXLIBS=-L/usr/lib64/mysql-lmysqlclient-lz-lm-L/usr/lib/sasl2-lsasl2-lssl-lcrypto'#-DHAS_MYSQL-I/usr/include/mysql / / enable Mysql storage Specify header file #-DUSE_SASL_AUTH-DUSE_CYRUS_SASL-I/usr/include/sasl / / enable SASL (cyrus) authentication framework; #-DUSE_TLS / enable SSL function; # AUXLIBS=-L/usr/lib64/mysql-lmysqlclient / / find Mysql client library file; #-lz / / compressed pants file; #-lm-L/usr/lib64/sasl2 / / module file #-lsasl2-lssl-lcrypto / / encrypt library files
The following information indicates that the configuration is successful
[src/posttls-finger] cat. /.. / conf/makedefs.out Makefile.in > Makefilerm-f Makefile; (cat conf/makedefs.out Makefile.in) > Makefile$ make$ make install
Follow the prompts below to enter the relevant path (the default value in the [] sign, followed by the input value after "]", which means the default value is used.
Install_root: [/] # specify Postfix installation directory, default tempdir: [/ root/postfix-2.11.7] / tmp/postfix# specify Postfix temporary file directory config_directory: [/ etc/postfix] # specify Postfix configuration file directory, default command_directory: [/ usr/sbin] # specify Postfix binary file directory, default daemon_directory: [/ usr/libexec/postfix] # specify Postfix server process Default data_directory: [/ var/lib/postfix] # specifies Postfix writable file directory, default html_directory: [no] / var/www/html/postfix# specifies Postfix help file, you can use web server to open mail_owner: [postfix] # specify Postfix owner, default mailq_path: [/ usr/bin/mailq] # specify Postfix queue program path Default manpage_directory: [/ usr/local/man] newaliases_path: [/ usr/bin/newaliases] # specify Postfix generation alias command location, default queue_directory: [/ var/spool/postfix] # specify Postfix queue directory, default readme_directory: [no] sendmail_path: [/ usr/sbin/sendmail] # specify Postfix client (smtp), default setgid_group: [postdrop] # specify Postfix delivery group (default has this group) But without this user), by default
PS: you can press Ctrl+ Backspace to delete characters if you make a mistake.
Add SysV style service scripts
[root@localhost ~] # vim / ETC processname rc.dUnip init.dUnix postfixtures bind Bash binder # chkconfig: 2345 80 3 torque description: Postfix is a Mail Transport Agent, which is the program\ # 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 configuration.. / 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=0prog= "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 1esacexit $? # END [root@localhost ~] # chmod + x / etc/rc.d/init.d/postfix [root@localhost ~] # chkconfig-add postfix [root@localhost ~] # chkconfig postfix on [root@localhost ~] # service postfix startPostfix related commands # Open postfix;$ postfix start # check configuration; $postfix check # reload; $postfix reload $postconf [OPTION]-d: show Postfix default configuration -n: show newly modified configuration;-m: display supported storage file types such as hash,mysql;-a: show client plug-in types that support sasl
Installation completed
If there are no postfix users using UID 89 above, the following error will be reported when checking postfix.
$postfix checkpostsuper: fatal: scan_dir_push: open directory defer: Permission denied
The reason is that when compiling and installing, several directories under the Postfix queue directory / var/spoole/postfix/, will use the directories with postfix in the system, because the system uses postfix (UID:89) users by default to delete, so these directories cannot find postfix users, and when opened, some permissions will be reported in error, and the following directory permissions can be modified as follows, if there are some other directories as well.
$chown-R postfix.root / var/spool/postfix/defer/$ chown-R postfix.root / var/spool/postfix/deferred/$ chown-R postfix.root / var/spool/postfix/private/$ chown-R postfix.postdrop / var/spool/postfix/public/$ chown-R postfix.postdrop / var/spool/postfix/maildrop/$ chown-R postfix.root / var/lib/postfix/Postfix process master: this process is the brain of the Postfix mail system, which produces all other processes. Smtpd: handles all externally connected requests as a server-side program. Smtp: handles all requests to initiate a connection as a client program. Qmgr: it is the heart of the Postfix mail system, processing and controlling all messages in the mail queue. Local: this is Postfix's own local delivery agent MDA, which is responsible for saving mail to the mailbox.
The above is all the contents of the article "how to install Postfix Mail under Linux". Thank you for reading! Hope to share the content to help you, more related knowledge, 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.