Em primeiro lugar, SIM, estou ciente do outro post sobre isso, mas isso não me ajudou.
Pouco tempo atrás, nosso sysadmin deixou a empresa inesperadamente sem substituição ou entrega, e agora está em mim por enquanto. Sou apenas um desenvolvedor sem experiência em sysadmin.
Depois que ele saiu, nós alteramos as senhas raiz em todos os servidores, e também reinicializamos o servidor que executa o postfix. Mas desde então, nenhum email está sendo enviado.
Logs em /var/log/mail.log estão cheios de entradas como estas:
postfix/smtp[31834]: fatal: unknown service: smtp/tcp
postfix/smtpd[31815]: disconnect from unknown[IP censored]
postfix/qmgr[31806]: warning: private/smtp socket: malformed response
postfix/qmgr[31806]: warning: transport smtp failure -- see a previous warning/fatal/panic logfile record for the problem description
postfix/master[31799]: warning: process /usr/lib/postfix/smtp pid 31834 exit status 1
postfix/master[31799]: warning: /usr/lib/postfix/smtp: bad command startup -- throttling
Aqui estão os registros em torno do momento da reinicialização, que aconteceu entre 10:37 e 10:38:
10:31:36 postfix/qmgr[24341]: 1B4463E9C7E: from=<[email protected]>, size=1191, nrcpt=1 (queue active)
10:31:36 postfix/qmgr[24341]: E5F003F1132: from=<[email protected]>, size=12656, nrcpt=1 (queue active)
10:31:36 postfix/qmgr[24341]: 86E0E42A6A7: from=<>, size=5109, nrcpt=1 (queue active)
10:31:36 postfix/smtp[24765]: connect to b.zj.cn.x.ourdomain.tld[IP]:25: Connection refused
10:31:36 postfix/smtp[24766]: connect to b.zj.cn.x.ourdomain.tld[IP]:25: Connection refused
10:31:36 postfix/smtp[24765]: 1B4463E9C7E: to=<[email protected]>, relay=none, delay=29793, delays=29793/0.01/0/0, dsn=4.4.1, status=deferred (connect to b.zj.cn.x.ourdomain.tld[IP]:25: Connection refused)
10:31:36 postfix/smtp[24766]: E5F003F1132: to=<[email protected]>, relay=none, delay=29792, delays=29792/0.01/0/0, dsn=4.4.1, status=deferred (connect to b.zj.cn.x.ourdomain.tld[IP]:25: Connection refused)
10:31:57 postfix/smtp[24768]: connect to tmg-tmg-chn-shn-1-1.l.ourdomain.tld[IP]:25: Connection timed out
10:31:57 postfix/smtp[24768]: 86E0E42A6A7: to=<[email protected]>, relay=none, delay=29794, delays=29773/0.02/21/0, dsn=4.4.1, status=deferred (connect to tmg-tmg-chn-shn-1-1.l.ourdomain.tld[IP]:25: Connection timed out)
10:32:17 postfix/anvil[24722]: statistics: max connection rate 1/60s for (smtp:IP) at 10:28:55
10:32:17 postfix/anvil[24722]: statistics: max connection count 1 for (smtp:IP) at 10:28:55
10:32:17 postfix/anvil[24722]: statistics: max cache size 1 at 10:28:55
10:37:41 postfix/master[24334]: terminating on signal 15
10:37:45 opendkim[29682]: OpenDKIM Filter: mi_stop=1
10:37:45 opendkim[29682]: OpenDKIM Filter v2.0.1 terminating with status 0, errno = 0
10:38:51 opendkim[1188]: OpenDKIM Filter v2.0.1 starting (args: -x /etc/opendkim.conf -u opendkim -P /var/run/opendkim/opendkim.pid -p inet:[email protected])
10:39:03 spamd[1179]: logger: removing stderr method
10:39:05 spamd[1415]: spamd: server started on port 783/tcp (running version 3.3.1)
10:39:05 spamd[1415]: spamd: server pid: 1415
10:39:05 spamd[1415]: spamd: server successfully spawned child process, pid 1422
10:39:05 spamd[1415]: spamd: server successfully spawned child process, pid 1423
10:39:05 spamd[1415]: prefork: child states: II
10:39:23 postfix/master[1646]: daemon started -- version 2.7.1, configuration /etc/postfix
10:39:24 postfix/qmgr[1661]: A80B73EA677: from=<[email protected]>, size=1069, nrcpt=1 (queue active)
10:39:24 postfix/smtp[1663]: fatal: unknown service: smtp/tcp
10:39:24 postfix/qmgr[1661]: 981B73EAB53: from=<[email protected]>, size=1034, nrcpt=1 (queue active)
10:39:24 postfix/qmgr[1661]: 91A0F42A8CC: from=<>, size=3722, nrcpt=1 (queue active)
10:39:24 postfix/smtp[1664]: fatal: unknown service: smtp/tcp
10:39:24 postfix/smtp[1665]: fatal: unknown service: smtp/tcp
10:39:24 postfix/qmgr[1661]: 3E73F42A8CB: from=<>, size=24898, nrcpt=1 (queue active)
10:39:24 postfix/smtp[1666]: fatal: unknown service: smtp/tcp
10:39:25 postfix/qmgr[1661]: warning: private/smtp socket: malformed response
10:39:25 postfix/qmgr[1661]: warning: transport smtp failure -- see a previous warning/fatal/panic logfile record for the problem description
10:39:25 postfix/master[1646]: warning: process /usr/lib/postfix/smtp pid 1663 exit status 1
10:39:25 postfix/master[1646]: warning: /usr/lib/postfix/smtp: bad command startup -- throttling
Respostas para questões semelhantes giram em torno de se o smtp é ou não executado como chroot. O padrão parece ser sim no meu servidor Debian Squeeze, e todos os conselhos deles já estão acontecendo no meu servidor:
service postfix restart
/etc
all são copiados para /var/spool/postfix/etc
/var/spool/postfix/etc/services
contém o necessário entradas:
smtp 25/tcp mail
ssmtp 465/tcp smtps # SMTP over SSL
Eu também tentei fazer o smtp não chrooted, mas nada mudou. Uma coisa que me confunde um pouco é que, além de /etc/postfix/master.cf
, há outro arquivo desse tipo em /usr/lib/postfix/master.cf
.
Para completar, aqui estão os conteúdos / saídas do que as pessoas geralmente parecem pedir.
Saída de postconf -n
(censurado)
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
config_directory = /etc/postfix
html_directory = /usr/share/doc/postfix/html
inet_interfaces = mail.ourdomain.tld (...other IPs from our servers...) 127.0.0.1
lmtp_host_lookup = native
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
milter_default_action = accept
milter_protocol = 2
mydestination = mail.ourdomain.tld tmg-aly-chn-hng-1-0.ourdomain.tld localhost
myhostname = mail.ourdomain.tld
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 (...other IPs from our servers...)
myorigin = mail.ourdomain.tld
non_smtpd_milters = inet:127.0.0.1:8891
readme_directory = /usr/share/doc/postfix
recipient_delimiter = +
smtp_host_lookup = native
smtp_sasl_path = smtpd
smtp_sasl_security_options =
smtpd_banner = $myhostname ESMTP $mail_name
smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated, reject
smtpd_milters = inet:127.0.0.1:8891
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = smtpd
smtpd_sasl_security_options =
smtpd_tls_cert_file = ...our cert path...
smtpd_tls_key_file = ...our key path...
smtpd_tls_mandatory_protocols = !SSLv2,!SSLv3
smtpd_use_tls = yes
Conteúdo de /etc/postfix/master.cf
:
# ==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ==========================================================================
smtp inet n - - - - smtpd
#submission inet n - - - - smtpd
# -o smtpd_tls_security_level=encrypt
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_sasl_path=smtpd
# -o smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
#smtps inet n - - - - smtpd
# -o smtpd_tls_wrappermode=yes
# -o smtpd_sasl_auth_enable=yes
# -o smtpd_client_restrictions=permit_sasl_authenticated,reject
# -o milter_macro_daemon_name=ORIGINATING
#628 inet n - - - - qmqpd
pickup fifo n - - 60 1 pickup
cleanup unix n - - - 0 cleanup
qmgr fifo n - n 300 1 qmgr
#qmgr fifo n - - 300 1 oqmgr
tlsmgr unix - - - 1000? 1 tlsmgr
rewrite unix - - - - - trivial-rewrite
bounce unix - - - - 0 bounce
defer unix - - - - 0 bounce
trace unix - - - - 0 bounce
verify unix - - - - 1 verify
flush unix n - - 1000? 0 flush
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
smtp unix - - - - - smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay unix - - - - - smtp
-o smtp_fallback_relay=
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - - - - showq
error unix - - - - - error
retry unix - - - - - error
discard unix - - - - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - - - - lmtp
anvil unix - - - - 1 anvil
scache unix - - - - 1 scache
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent. See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
#
# ====================================================================
#
# Recent Cyrus versions can use the existing "lmtp" master.cf entry.
#
# Specify in cyrus.conf:
# lmtp cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
#
# Specify in main.cf one or more of the following:
# mailbox_transport = lmtp:inet:localhost
# virtual_transport = lmtp:inet:localhost
#
# ====================================================================
#
# Cyrus 2.1.5 (Amos Gouaux)
# Also specify in main.cf: cyrus_destination_recipient_limit=1
#
#cyrus unix - n n - - pipe
# user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
#
# ====================================================================
# Old example of delivery via Cyrus.
#
#old-cyrus unix - n n - - pipe
# flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
#
# ====================================================================
#
# See the Postfix UUCP_README file for configuration details.
#
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# Other external delivery methods.
#
ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe
flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix - n n - 2 pipe
flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman unix - n n - - pipe
flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
${nexthop} ${user}
Alguma idéia do que mais eu posso experimentar, onde posso procurar? Ele continua registrando unknown service: smtp/tcp
...
Tags debian postfix debian-squeeze