Postfix--fail--1


DNS

DNS主配置文件

[root@mail ~]# cat /etc/named.conf
//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//
options {
 listen-on port 53 { any; };
 listen-on-v6 port 53 { ::1; };
 directory "/var/named";
 dump-file "/var/named/data/cache_dump.db";
 statistics-file "/var/named/data/named_stats.txt";
 memstatistics-file "/var/named/data/named_mem_stats.txt";
 allow-query { any; };
 recursion yes;
 dnssec-enable yes;
 dnssec-validation yes;
 /* Path to ISC DLV key */
 bindkeys-file "/etc/named.iscdlv.key";
 managed-keys-directory "/var/named/dynamic";
};
logging {
 channel default_debug {
 file "data/named.run";
 severity dynamic;
 };
};
zone "benet.com" IN {
 type master;
 file "benet.com.zone";
};
zone "." IN {
 type hint;
 file "named.ca";
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
[root@mail ~]#

DNS zone文件

[root@mail ~]# cat /var/named/benet.com.zone
$TTL 86400
@ IN SOA benet.com. admin.benet.com. (
 20160718
 4H
 30M
 12H
 1D
)
@ IN NS ns1.benet.com.
 IN MX 10 mail.benet.com.
ns1 IN A 173.16.16.100
mail IN A 173.16.16.100
[root@mail ~]#

编译安装Postfix

cyrus软件包

[root@mail ~]# rpm -qa | grep cyrus
cyrus-sasl-lib-2.1.23-13.el6_3.1.x86_64
cyrus-sasl-devel-2.1.23-13.el6_3.1.x86_64
cyrus-sasl-2.1.23-13.el6_3.1.x86_64
cyrus-sasl-plain-2.1.23-13.el6_3.1.x86_64
[root@mail ~]#

软件包

[root@mail ~]# ls
anaconda-ks.cfg install.log postfix-2.4.6.tar.gz README_FILES
dovecot-1.1.4.tar.gz install.log.syslog postfix-2.4.6-vda-ng.patch squirrelmail-1.4.13.tar.bz2
dovecot-2.0.21.tar.gz mysql-5.0.56.tar.gz postfix.sh zh_CN-1.4.13-20071220.tar.bz2
[root@mail ~]#
[root@mail ~]# cat /etc/group | grep postfix
mail:x:12:mail,postfix
postfix:x:89:
[root@mail ~]# cat /etc/group | grep postdrop
postdrop:x:90:
[root@mail ~]#

编一个脚本来定制编译安装


[root@mail postfix-2.4.6]# vi build.sh 

make makefiles \
'CCARGS=-DHAS_MYSQL -I/usr/local/mysql/include/mysql \
-DUSE_SASL_AUTH \
-DUSE_CYRUS_SASL -I/usr/include/sasl' \
'AUXLIBS=-L/usr/local/mysql/lib/mysql -lmysqlclient  -lz  -lm  \
-L/usr/lib/sasl2  -lsasl2 '

~                                                                                                       
~                                                                                                       
~                                                                                                       
~                                                                                                       
~                                                                                                                                                                                                     "build.sh" 7L, 225C

postfix主配置文件内容

[root@mail ~]# cat /etc/postfix/main.cf
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
home_mailbox = Maildir/
html_directory = no
inet_interfaces = 173.16.16.100
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $mydomain
mydomain = benet.com
myhostname = mail.benet.com
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 550
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
mynetworks = 173.16.16.100
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
[root@mail ~]#

dovecot

dovecot

[root@mail ~]# cat /etc/pam.d/dovecot
#%PAM-1.0
auth required pam_nologin.so
auth include system-auth
account include system-auth
session include system-auth
[root@mail ~]#

dovecot配置文件

[root@mail ~]# cat /etc/dovecot/dovecot.conf
## Dovecot configuration file
# If you're in a hurry, see http://wiki2.dovecot.org/QuickConfiguration
# "doveconf -n" command gives a clean output of the changed settings. Use it
# instead of copy&pasting files when posting to the Dovecot mailing list.
# '#' character and everything after it is treated as comments. Extra spaces
# and tabs are ignored. If you want to use either of these explicitly, put the
# value inside quotes, eg.: key = "# char and trailing whitespace "
# Default values are shown for each setting, it's not required to uncomment
# those. These are exceptions to this though: No sections (e.g. namespace {})
# or plugin settings are added by default, they're listed only as examples.
# Paths are also just examples with the real defaults being based on configure
# options. The paths listed here are for configure --prefix=/usr
# --sysconfdir=/etc --localstatedir=/var
# Protocols we want to be serving.
protocols = imap pop3 lmtp
# A comma separated list of IPs or hosts where to listen in for connections.
# "*" listens in all IPv4 interfaces, "::" listens in all IPv6 interfaces.
# If you want to specify non-default ports or anything more complex,
# edit conf.d/master.conf.
#listen = *, ::
# Base directory where to store runtime data.
#base_dir = /var/run/dovecot/
# Name of this instance. Used to prefix all Dovecot processes in ps output.
#instance_name = dovecot
# Greeting message for clients.
#login_greeting = Dovecot ready.
# Space separated list of trusted network ranges. Connections from these
# IPs are allowed to override their IP addresses and ports (for logging and
# for authentication checks). disable_plaintext_auth is also ignored for
# these networks. Typically you'd specify your IMAP proxy servers here.
#login_trusted_networks =
# Sepace separated list of login access check sockets (e.g. tcpwrap)
#login_access_sockets =
# Show more verbose process titles (in ps). Currently shows user name and
# IP address. Useful for seeing who are actually using the IMAP processes
# (eg. shared mailboxes or if same uid is used for multiple accounts).
#verbose_proctitle = no
# Should all processes be killed when Dovecot master process shuts down.
# Setting this to "no" means that Dovecot can be upgraded without
# forcing existing client connections to close (although that could also be
# a problem if the upgrade is e.g. because of a security fix).
#shutdown_clients = yes
# If non-zero, run mail commands via this many connections to doveadm server,
# instead of running them directly in the same process.
#doveadm_worker_count = 0
# UNIX socket or host:port used for connecting to doveadm server
#doveadm_socket_path = doveadm-server
# Space separated list of environment variables that are preserved on Dovecot
# startup and passed down to all of its child processes. You can also give
# key=value pairs to always set specific settings.
#import_environment = TZ
##
## Dictionary server settings
##
# Dictionary can be used to store key=value lists. This is used by several
# plugins. The dictionary can be accessed either directly or though a
# dictionary server. The following dict block maps dictionary names to URIs
# when the server is used. These can then be referenced using URIs in format
# "proxy::".
dict {
 #quota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext
 #expire = sqlite:/etc/dovecot/dovecot-dict-sql.conf.ext
}
# Most of the actual configuration gets included below. The filenames are
# first sorted by their ASCII value and parsed in that order. The 00-prefixes
# in filenames are intended to make it easier to understand the ordering.
!include conf.d/10-auth.conf
ssl = no
disable_plaintext_auth = no
mail_location = maildir:~/Maildir
# A config file can also tried to be included without giving an error if
# it's not found:
!include_try local.conf
[root@mail ~]#
[root@mail ~]# netstat -utpln | grep dovecot
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 32046/dovecot
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 32046/dovecot
tcp 0 0 :::110 :::* LISTEN 32046/dovecot
tcp 0 0 :::143 :::* LISTEN 32046/dovecot
[root@mail ~]#
[root@mail ~]# telnet mail.benet.com 110
Trying 173.16.16.100...
Connected to mail.benet.com.
Escape character is '^]'.
+OK Dovecot ready.
USER lisi
+OK
PASS 123123
+OK Logged in.
LIST
+OK 1 messages:
1 490
.
RETR 1
+OK 490 octets
Return-Path: 
X-Original-To: [email protected]
Delivered-To: [email protected]
Received: from mail.benet.com (unknown [173.16.16.100])
 by mail.benet.com (Postfix) with SMTP id AC329C13F1
 for ; Sat, 16 Jul 2016 06:16:48 +0800 (CST)
Subject:A Test Mail!
Message-Id: <[email protected]>
Date: Sat, 16 Jul 2016 06:16:48 +0800 (CST)
From: [email protected]
To: undisclosed-recipients:;
Dear Lisi:
This is a test mail by Xiaoqi.
.
QUIT
+OK Logging out.
Connection closed by foreign host.
[root@mail ~]#
[root@mail ~]# tail -f /var/log/maillog
Jul 16 08:51:13 mail postfix/smtpd[32127]: warning: smtpd_sasl_auth_enable is true, but SASL support is not compiled in
Jul 16 08:51:13 mail postfix/smtpd[32127]: connect from unknown[173.16.16.2]
Jul 16 08:51:13 mail postfix/smtpd[32127]: lost connection after EHLO from unknown[173.16.16.2]
Jul 16 08:51:13 mail postfix/smtpd[32127]: disconnect from unknown[173.16.16.2]
Jul 16 08:54:33 mail postfix/anvil[32129]: statistics: max connection rate 1/60s for (smtp:173.16.16.2) at Jul 16 08:51:13
Jul 16 08:54:33 mail postfix/anvil[32129]: statistics: max connection count 1 for (smtp:173.16.16.2) at Jul 16 08:51:13
Jul 16 08:54:33 mail postfix/anvil[32129]: statistics: max cache size 1 at Jul 16 08:51:13
Jul 16 13:40:06 mail dovecot: master: Fatal: Dovecot is already running with PID 32046 (read from /usr/local/var/run/dovecot/master.pid)
Jul 16 13:41:20 mail dovecot: pop3-login: Login: user=, method=PLAIN, rip=173.16.16.100, lip=173.16.16.100, mpid=32302, secured
Jul 16 13:41:44 mail dovecot: pop3(lisi): Disconnected: Logged out top=0/0, retr=1/506, del=0/1, size=490
[root@mail ~]# telnet mail.benet.com 25
Trying 173.16.16.100...
Connected to mail.benet.com.
Escape character is '^]'.
220 mail.benet.com ESMTP Postfix
EHLO mail.benet.com
250-mail.benet.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
AUTH LOGIN
502 5.5.2 Error: command not recognized

results matching ""

    No results matching ""