Saludos.
Estoy intentando colocar un server de mensajes MTA en mi ubuntu 8.04. He instalado el postfix, pero he tenido problemas para enivar un mensaje por un script en PHP utilizando la funcion mail().
Nota: a pesar que he googleado y he visto los mensajes que tratan de postfix en el foro no he conseguido hacer que funcione.
El servidor es local.
Mi /etc/postfix/main.cf:
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = no
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
myhostname = n0dix
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = n0dix, localhost.localdomain, , localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
Mi /etc/php5/apache2/php.ini (lo que se refiere a SMTP)es:
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25
; For Win32 only.
;sendmail_from = [email protected]
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = sendmail -t -i
El /var/log/mail.log es (simplificado):
Aug 7 16:52:46 n0dix postfix/qmgr[5772]: 50DCF1E4421: from=<www-data@n0dix>, size=410, nrcpt=1 (queue active)
Aug 7 16:52:46 n0dix postfix/qmgr[5772]: 615311E4401: from=<www-data@n0dix>, size=410, nrcpt=1 (queue active)
Aug 7 16:55:17 n0dix postfix/smtp[17925]: connect to alt1.gmail-smtp-in.l.google.com[72.14.205.114]:25: Connection timed out
Aug 7 16:55:17 n0dix postfix/smtp[17927]: connect to alt2.gmail-smtp-in.l.google.com[72.14.221.27]:25: Connection timed out
Aug 7 16:55:17 n0dix postfix/smtp[17928]: 192D31E43EB: to=<[email protected]>, relay=none, delay=47728, delays=47577/0.02/150/0, dsn=4.4.1, status=deferred (connect to alt1.gmail-smtp-in.l.google.com[72.14.205.27]:25: Connection timed out)
Aug 7 16:55:17 n0dix postfix/error[18316]: 29D801E43E7: to=<[email protected]>, relay=none, delay=43017, delays=42867/151/0/0.12, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to alt2.gmail-smtp-in.l.google.com[72.14.221.27]:25: Connection timed out)
Mi script de PHP es:
$send = mail("[email protected]","Hola soy yo","Es para ver si funciona","From: [email protected]");
Alguna sugerencia?