[postfix-es] Problemas envío desde www-data

Gorka gorkapostfix en yahoo.es
Jue Sep 17 16:59:14 CEST 2009


Tengo Postfix según el ISP Style Tutorial para Etch.

El envío de correos desde mi propia web me da dos tipos de problemas:



PROBLEMA 1:

Resulta que mi web envía un mail al cliente cuando este realiza cierta
acción, esto lo hace siempre bien. 
Este mail se envía con copia a mí, esto lo hace siempre mal porque me
encuentro ese mail en la carpeta /.spam/
Necesito estos acuses de recibo

¿por qué el mismo mensaje enviado a una cuenta de yahoo, por ejemplo, no lo
considera spam y en cambio a una cuenta de mi propio dominio sí?

El mail.log me dice lo siguiente (uno y dos son mis dominios virtuales de
correo):

Sep 17 12:11:00 servidor amavis[24441]: (24441-10) Passed SPAM,
<www-data en servidor.uno.es> -> <miusuario en dos.com>, quarantine:
spam-WqO5-m1Su8sk.gz, Message-ID:
<20090917101100.31C0BAE85D9 en servidor.uno.es>, mail_id: WqO5-m1Su8sk, Hits:
3.409, queued_as: 65DBDAE85DC, 252 ms
Sep 17 12:11:00 servidor postfix/smtp[25441]: 31C0BAE85D9:
to=<miusuario en dos.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.27,
delays=0.01/0.01/0/0.25, dsn=2.6.0, status=sent (250 2.6.0 Ok, id=24441-10,
from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 65DBDAE85DC)
Sep 17 12:11:00 servidor postfix/pipe[25370]: 65DBDAE85DC:
to=<miusuario en dos.com>, relay=dovecot, delay=0.09, delays=0.06/0/0/0.03,
dsn=2.0.0, status=sent (delivered via dovecot service)

En el main.cf tengo …

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10024
inet_interfaces = all
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mydestination = servidor.uno.es, localhost.uno.es, localhost, mail.uno.es
myhostname = servidor.uno.es
mynetworks = 127.0.0.0/8 10.0.0.0/24
myorigin = /etc/mailname
receive_override_options = no_address_mappings
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_client_restrictions = permit_mynetworks permit_sasl_authenticated
reject_unauth_pipelining reject_rbl_client bl.spamcop.net reject_rbl_client
dynablock.njabl.org reject_rbl_client zen.spamhaus.org reject_rbl_client
list.dsbl.org reject_rbl_client sbl-xbl.spamhaus.org, reject_rbl_client
dnsbl.njabl.org, reject_rbl_client dul.dnsbl.sorbs.net, reject_rbl_client
l1.spews.dnsbl.sorbs.net, reject_rbl_client bogusmx.rfc-ignorant.org,
reject_rbl_client cbl.abuseat.org, check_policy_service inet:127.0.0.1:60000
smtpd_delay_reject = yes
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks,  permit_sasl_authenticated,
check_helo_access hash:/etc/postfix/helo_access,  reject_non_fqdn_hostname,
reject_invalid_hostname,  permit
smtpd_recipient_restrictions = reject_unauth_pipelining,
reject_non_fqdn_recipient, reject_unknown_recipient_domain,
permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination,
check_sender_access hash:/etc/postfix/sender_access, check_recipient_access
hash:/etc/postfix/recipient_access, permit
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_sender_restrictions = permit_mynetworks,  permit_sasl_authenticated,
reject_non_fqdn_sender,  reject_unknown_sender_domain,  permit
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/ssl/certs/postfix.pem
smtpd_tls_key_file = /etc/ssl/private/postfix.pem
smtpd_tls_loglevel = 1
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_alias_maps =
mysql:/etc/postfix/mysql-virtual-alias-maps.cf,mysql:/etc/postfix/mysql-emai
l2email.cf
virtual_gid_maps = static:5000
virtual_mailbox_domains =
mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_transport = dovecot
virtual_uid_maps = static:5000

Esto tiene que ser cualquier tontería, pero no doy con ello.



PROBLEMA 2:

-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
848F1AE8541     2811 Tue Sep 15 09:06:03  www-data en servidor.uno.es
(host rojo3.usc.es[193.144.75.13] said: 450 <www-data en servidor.uno.es>:
Sender address rejected: Domain not found (in reply to RCPT TO command))
                                         raquel.sanguijuelo en usc.es

El servidor de este destinatario (y algún otro servidor de algún otro
destinatario también me lo ha hecho) lógicamente protesta porque no
encuentra el dominio ‘servidor.uno.es’. Es normal.

¿Cómo hacer que www-data envíe desde micuenta en dos.com?

Para enviar los mensajes tengo en PHP la siguiente función (evidentemente en
la vble $from va micuenta en dos.com y en $to va raquel.sanguijuelo en usc.es):

function mail_attachment ($from , $to, $subject, $message, $attachment)
{
  $email_from = $from; // Who the email is from
  $email_subject = $subject; // The Subject of the email
  $email_txt = $message; // Message that the email has in it
  $email_to = $to; // Who the email is to

  $headers = "From: ".$email_from;
  $msg_txt=" ";
  $semi_rand = md5(time());
  $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
  $headers .= "\nMIME-Version: 1.0\n" .
  "Content-Type: multipart/mixed;\n" .
  " boundary=\"{$mime_boundary}\"";
  $email_txt .= $msg_txt;
  $email_message .= "This is a multi-part message in MIME format.\n\n" .
  "--{$mime_boundary}\n" .
  "Content-Type:text/html; charset=\"iso-8859-1\"\n" .
  "Content-Transfer-Encoding: 7bit\n\n" .
  $email_txt . "\n\n";

  $ok = @mail($email_to, $email_subject, $email_message, $headers);

  if($ok)
  {
    //echo "El mensaje se ha enviado correctamente";
  } else
  {
    die("El mensaje no ha podido ser enviado.");
  }
}



More information about the postfix-es mailing list