www.state-it.info

Gran base de respuestas a las preguntas de los desarrolladores
Header decor

Como hacer el envío de correos electrónicos a través de postfix rápida?

saytik 2017-04-04 17:45:24

Dispone de un servidor web, en ella postfix. Al enviar un mensaje, a través de PHP mail() pasa por 15 minutos hasta que la carta realmente va a desaparecer. Dime dónde cavar? Configuración de postfix tal:

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
myhostname = extmail.DOMAIN.com
mydomain = DOMAIN2.ru
myorigin = $myhostname
inet_protocols = all
mydestination = $myhostname, localhost.$mydomain, localhost
unknown_local_recipient_reject_code = 550

mynetworks_style = subnet

mynetworks = 127.0.0.0/8,89.21.77.88/32

relay_domains = mysql:/etc/postfix/mysql-virtual_relay_domains.cf

alias_maps = hash:/etc/aliases

alias_database = hash:/etc/aliases

smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)

debugger_command =
	 PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
	 ddd $daemon_directory/$process_name $process_id & sleep 5


sendmail_path = /usr/sbin/sendmail.postfix

newaliases_path = /usr/bin/newaliases.postfix

mailq_path = /usr/bin/mailq.postfix

setgid_group = postdrop

html_directory = no

manpage_directory = /usr/share/man

sample_directory = /usr/share/doc/postfix-2.6.6/samples

readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES

smtp_bind_address = 88.98.112.24

inet_protocols = ipv4
smtpd_recipient_restrictions =  permit_mynetworks,
                                permit_sasl_authenticated,
                                check_client_access hash:/etc/postfix/access-client,
                                check_sender_access hash:/etc/postfix/whitelist,
                                reject_unlisted_recipient,
                                reject_non_fqdn_sender,
                                reject_non_fqdn_recipient,
                                reject_unauth_destination,
                                reject_unauth_pipelining,
                                reject_invalid_hostname,
                                reject_unknown_sender_domain,
                                reject_unknown_recipient_domain,
                                reject_rbl_client cbl.abuseat.org,
                                reject_rbl_client relays.mail-abuse.org,
                                reject_rbl_client dnsbl.njabl.org,
                                reject_rbl_client combined.njabl.org,
                                reject_rbl_client bl.spamcop.net,
                                reject_rbl_client zen.spamhaus.org,
				permit

smtpd_client_restrictions = check_client_access hash:/etc/postfix/access-client,
                            permit_sasl_authenticated,
                            permit_mynetworks,
                            reject_unauth_destination,
                            reject_unknown_recipient_domain,
                            reject_invalid_hostname,
                            reject_non_fqdn_recipient
                            permit

# ограничения на приветствие отправителя HELO/EHLO
smtpd_helo_restrictions =   check_helo_access hash:/etc/postfix/helo_access,
                            permit_sasl_authenticated,
                            permit_mynetworks,
                            reject_non_fqdn_hostname,
                            reject_invalid_hostname,
                            reject_unknown_hostname,
                            permit



# ограничения, проверяемые на этапе MAIL FROM:
smtpd_sender_restrictions =
                            # принимаем почту на отправку с "чужих" хостов, если пользователь
                            # авторизовался по логину/паролю
                            permit_sasl_authenticated,
                            # "своим" можно и "просто"
                            permit_mynetworks,
                            # см комментарий к разделу smtpd_helo_restrictions
                            reject_non_fqdn_sender,
                            reject_unknown_sender_domain,
                            # если все вышеперечисленное подошло, идем дальше
                            permit

soft_bounce = no
myhostname = extmail.DOMAIN.com
mydomain = DOMAIN2.ru
myorigin = $myhostname
mydestination = localhost.$mydomain, localhost
alias_maps = hash:/etc/aliases
smtpd_banner = $myhostname ESMTP $mail_name

# ============================================================
# LIMITS
# ============================================================
message_size_limit = 51200000
smtpd_soft_error_limit = 10
smtpd_hard_error_limit = 15
smtpd_error_sleep_time = 20
anvil_rate_time_unit = 60s
smtpd_client_connection_count_limit = 20
smtpd_client_connection_rate_limit = 30
smtpd_client_message_rate_limit = 30
smtpd_client_event_limit_exceptions = 127.0.0.0/8
smtpd_client_connection_limit_exceptions = 127.0.0.0/8

# ============================================================
# QUEUE
# ============================================================
maximal_queue_lifetime = 1d
bounce_queue_lifetime = 1d


# ============================================================
# TLS
# ============================================================
smtp_tls_security_level = may
smtpd_tls_security_level = may
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
smtp_tls_session_cache_database = btree:$data_directory/smtp_tls_session_cache
smtpd_tls_key_file = /etc/postfix/certs/key.pem
smtpd_tls_cert_file = /etc/postfix/certs/cert.pem
tls_random_source = dev:/dev/urandom

# ============================================================
# SASL
# ============================================================
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_authenticated_header = yes
smtpd_helo_required = no

# ============================================================
# VIRTUAL
# ============================================================
virtual_mailbox_base = /var/vmail
virtual_minimum_uid = 1000
virtual_uid_maps = static:1000
virtual_gid_maps = static:1000
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1

home_mailbox = Maildir/

virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_mailbox_domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual_mailbox_maps.cf
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual_alias_maps.cf

content_filter=amavisfeed:[127.0.0.1]:10024

krimtsev 2017-04-04 18:00:35

y ¿por qué tienes 2 veces en конфиге?

myhostname = extmail.DOMAIN.com
mydomain = DOMAIN2.ru
myorigin = $myhostname

lo mismo para los dominios de замазывали, y la IP no.

lo de configurar el tiempo estándar se indica. Tal vez el problema no está en postfix y con el servidor?


Sovigod 2017-04-04 18:05:56

Deje que el mejor es el log del paso de la carta.


saytik 2017-04-04 18:11:02

krimtsev: la ip cambiado, simplemente para ver que allí no hay errores. Y cuáles pueden ser los problemas con el servidor?


saytik 2017-04-04 18:11:17

Sovigod: por favor, Dígame cómo conseguirlo, voy a publicar


saytik 2017-04-04 18:23:32

Sovigod: Parece que?

Apr  4 18:48:46 server postfix/cleanup[1825]: warning: E45831005F6: virtual_alias_maps map lookup problem for [email protected]
Apr  4 18:49:11 server postfix/cleanup[1825]: warning: 5453A100780: virtual_alias_maps map lookup problem for [email protected]
Apr  4 18:49:11 server postfix/cleanup[1825]: warning: 5485C100780: virtual_alias_maps map lookup problem for [email protected]
Apr  4 18:49:14 server postfix/cleanup[1825]: warning: 57D36100780: virtual_alias_maps map lookup problem for [email protected]
Apr  4 18:49:14 server postfix/cleanup[1825]: warning: 5801D100780: virtual_alias_maps map lookup problem for [email protected]
Apr  4 18:50:16 server postfix/cleanup[2753]: warning: 16A791005F6: virtual_alias_maps map lookup problem for [email protected]
Apr  4 18:50:16 server postfix/cleanup[2753]: warning: 190E7100593: virtual_alias_maps map lookup problem for [email protected]
Apr  4 18:50:20 server amavis[7169]: (07169-17) Passed CLEAN {RelayedOpenRelay}, <[email protected]> -> <[email protected]>, Message-ID: <[email protected]>, mail_id: h8exgSLwFfOi, Hits: -1.901, size: 487, queued_as: 2DAB11005FE, 4577 ms
Apr  4 18:50:20 server postfix/lmtp[2757]: 0147310057A: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=71, delays=66/0.03/0/4.6, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 2DAB11005FE)
Apr  4 18:50:21 server postfix/smtp[2760]: 2DAB11005FE: to=<[email protected]>, relay=gmail-smtp-in.l.google.com[64.233.164.26]:25, delay=1.6, delays=0.5/0/0.66/0.41, dsn=2.0.0, status=sent (250 2.0.0 OK 1491317421 q15si9398259lfe.107 - gsmtp)
Apr  4 18:51:14 server postfix/cleanup[2753]: warning: 0A5591002FC: virtual_alias_maps map lookup problem for [email protected]
Apr  4 18:52:14 server postfix/cleanup[2753]: warning: 679871002FC: virtual_alias_maps map lookup problem for [email protected]
Apr  4 18:53:14 server postfix/cleanup[2753]: warning: 676221002FC: virtual_alias_maps map lookup problem for [email protected]
Apr  4 18:54:15 server postfix/cleanup[3260]: warning: E49571003C4: virtual_alias_maps map lookup problem for [email protected]
Apr  4 18:54:15 server postfix/cleanup[3260]: warning: E68A51003C4: virtual_alias_maps map lookup problem for [email protected]
Apr  4 18:55:14 server postfix/cleanup[3260]: warning: 1AC231003C4: virtual_alias_maps map lookup problem for [email protected]
Apr  4 18:56:14 server postfix/cleanup[3260]: warning: 2ABBA10040B: virtual_alias_maps map lookup problem for [email protected]
Apr  4 18:57:14 server postfix/cleanup[3260]: warning: 2BD9210040B: virtual_alias_maps map lookup problem for [email protected]
Apr  4 18:58:18 server amavis[7169]: (07169-19) Passed CLEAN {RelayedOpenRelay}, <[email protected]> -> <[email protected]>, Message-ID: <[email protected]>, mail_id: A1a5AmW__6pZ, Hits: -1.901, size: 486, queued_as: B8289100407, 3216 ms
Apr  4 18:58:18 server postfix/lmtp[4303]: 6C69110040B: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=573, delays=569/0.03/0/3.2, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as B8289100407)
Apr  4 18:58:20 server postfix/smtp[4307]: B8289100407: to=<[email protected]>, relay=gmail-smtp-in.l.google.com[64.233.162.27]:25, delay=3.1, delays=1.2/0.03/1.6/0.34, dsn=2.0.0, status=sent (250 2.0.0 OK 1491317900 f18si9401571lfe.108 - gsmtp)
Apr  4 19:17:51 server postfix/cleanup[8456]: warning: 5929610040B: virtual_alias_maps map lookup problem for [email protected]
Apr  4 19:18:02 server postfix/cleanup[8884]: warning: 0537D1005BF: virtual_alias_maps map lookup problem for [email protected]
Apr  4 19:18:31 server postfix/cleanup[8884]: warning: 85E801005BF: virtual_alias_maps map lookup problem for [email protected]
Apr  4 19:19:31 server postfix/cleanup[8884]: warning: 677671005BF: virtual_alias_maps map lookup problem for [email protected]
Apr  4 19:20:14 server postfix/cleanup[8884]: warning: C1CBD10087D: virtual_alias_maps map lookup problem for [email protected]


ulrich-schnauss 2017-04-04 21:29:58

saytik: es decir, la abundancia de варнингов no te importa? :)


saytik 2017-04-05 10:43:45

ulrich-schnauss: confunde. Pero que pasa con eso?


ulrich-schnauss 2017-04-05 13:16:00

saytik: el problema con la búsqueda de usuarios virtuales en la base de datos. ¿Por qué busca el nombre del destinatario en su base de usuarios de correo


Total answers: 1

athacker 2017-04-04 19:02:28

poco delicadas pregunta -- y usted los registros de leer probado? :-) Allí ya que todas las fases de la carta por las instancias se reflejan. Aquí está, en el que los de devolución.

saytik 2017-04-04 19:21:00

Anteriormente sacó de log /var/log/maillog. Esto qué es? O necesita otro log? Por favor, dígame, cómo conseguirlo?


athacker 2017-04-05 10:38:38

saytik: Es el que, sólo muy обрывочно. Un montón de advertencias de error virtual_alias_maps, y en medio de dos mensajes de correos electrónicos que amavis'ohmios. El hecho de la recepción de la carta en la citada parcela de registro no se observa.


saytik 2017-04-05 10:44:32

athacker: se Debe enviar un correo (el discurso sobre la larga el envío). Y como la "rastrear" el propósito de esta carta? Por un identificador? Esperando por logs a través de grep.


Preguntas relacionadas:

Footer decor

© www.state-it.info | Base of answers to questions for developers and programmers.