[postfix-es] Empeñado en entrar como spam

Gorka gorkapostfix en yahoo.es
Mie Mayo 19 09:14:16 CEST 2010


> nombre de Federico Alberto Sayd
> Enviado el: lunes, 17 de mayo de 2010 17:37
> 
> Gorka escribió:
> > Hola a todos.
> >
> > Tengo una web que envía un mail a un alias de mi propio dominio con
> el
> > propio alias como supuesto remitente. El caso es que no consigo que
> la
> > puntuación del spam-flag baje de 6.31, y no quiero subir esta cifra
> porque
> > ya me parece demasiado alta. Le he pasado algunos de estos mensajes
> al
> > filtro bayes para que aprenda que son ham y no spam, … pero no parece
> que la
> > puntuación baje de 7, por más mensajes que le meto.
> > ¿Puedo hacer algo más?
> >
> > He intentado que se admitan todos los mensajes a esta cuenta
> insertando en
> > el recipient_access la línea
> > alias en midominio.es OK
> > y luego he hecho el
> > postmap hash:/etc/postfix/recipient_access
> > correspondiente, … pero no ha tenido ningún efecto.
> > La posición del check_recipient_access
> hash:/etc/postfix/recipient_access es
> > la última en del smtpd_recipient_restrictions, … justo antes del
> permit.
> > ¿He utilizado la nomenclatura correctamente y el parámetro está en la
> > posición correcta? ¿O ni siquiera esto influye para nada?
> >
> > (Tengo el servidor de correo configurado siguiendo las instrucciones
> para
> > Postfix + Dovecot del "ISPmail tutorial para Debian Etch" de
> Christoph Haas)
> >
> > Muchísimas gracias.
> > Un saludo.
> >
> >
> >
> >
> El tema es que quien te está puntuando tus mails como spam no es
> postfix, sino spamassasin. Mas allá de que es un off topic, cómo tienes
> configurado el spamassassin? Usas amavis, mailscanner, algún milter o
> un
> filtro de procmail? Las excepciones o listas blancas tendrás que
> pasarselas a spamassassin, no a postfix.
> 
> Saludos

Tengo configurado postfix, spamassasin y amavis siguiendo al pie de la letra
el "ISPmail tutorial para Debian Etch". 

De todas formas creo que tengo que destacar que cuando mi web envía un mail
con alias en dominio.es en el $from entra como spam, pero si lo envío con
alias2 en dominio.es en el $from ya no tiene tanto score y no entra como spam.
Creo que por ahí van los tiros.

La función PHP a la que me refiero es esta:

    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) 
            die("Error"); 
    }

La llamada a esta función es esta:

	mail_attachment("alias en dominio.es", "usuario en dominio.es" , "asunto",
$cuerpomensaje, 'mail_attachment.php');

El postconf -n me tira lo siguiente:

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
message_size_limit = 20480000
mydestination = maquina.dominio.es, localhost.dominio.es, localhost,
correo.dominio.es
myhostname = maquina.dominio.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

En la cabecera del mail que me entra como spam tengo (independientemente de
que de un error de BAD HEADER, que no sé por qué lo da):

Return-Path: <webmaster en dominio.es>
Delivered-To: usuario en dominio.es
Received: from localhost (localhost [127.0.0.1])
	by maquina.dominio.es (Postfix) with ESMTP id 7BF6EAEAF6C
	for <usuario en dominio.es>; Mon, 17 May 2010 16:55:50 +0200 (CEST)
X-Quarantine-ID: <Lcb4RL9+YJNy>
X-Virus-Scanned: Debian amavisd-new at maquina.dominio.es
X-Amavis-Alert: BAD HEADER MIME error: error: part did not end with expected
	boundary
X-Spam-Flag: YES
X-Spam-Score: 7.132
X-Spam-Level: ******
X-Spam-Status: Yes, score=7.132 tagged_above=undef required=6.31
	tests=[AWL=0.345, BAYES_00=-2.599, DNS_FROM_OPENWHOIS=1.13,
	FH_DATE_PAST_20XX=3.188, HTML_IMAGE_ONLY_16=1.526,
HTML_MESSAGE=0.001,
	HTML_MIME_NO_HTML_TAG=0.097, HTML_SHORT_LINK_IMG_2=0.001,
	MIME_HTML_ONLY=1.457, NO_RELAYS=-0.001,
SUBJECT_NEEDS_ENCODING=0.001,
	SUBJ_ILLEGAL_CHARS=1.586]
Received: from maquina.dominio.es ([127.0.0.1])
	by localhost (maquina.dominio.es [127.0.0.1]) (amavisd-new, port
10024)
	with ESMTP id Lcb4RL9+YJNy for <usuario en dominio.es>;
	Mon, 17 May 2010 16:55:50 +0200 (CEST)
Received: by maquina.dominio.es (Postfix, from userid 33)
	id 4BE82AEAF61; Mon, 17 May 2010 16:55:50 +0200 (CEST)
To: usuario en dominio.es
Subject: ***SPAM*** =?iso-8859-1?Q?Informaci=F3n_Online
From: alias en dominio.es
MIME-Version: 1.0
Content-Type: multipart/mixed;
 boundary="==Multipart_Boundary_xaaa1036c681879510ac686ad125cf7a1x"
Message-Id: <20100517145550.4BE82AEAF61 en maquina.dominio.es>
Date: Mon, 17 May 2010 16:55:50 +0200 (CEST)

En el php.ini tengo:

sendmail_path = "/usr/sbin/sendmail -t -i -f webmaster en dominio.es"

Espero que no sea demasiada información.





More information about the postfix-es mailing list