Postfix relay con hotmail,cv.gva.es,gmail

Por Paco Aldarias Raya

Impreso: 12 de noviembre 2007

Email: pacolinux arroba inicia punto es

Web: http://aldarias.es/pacodebian

Con Linux Debian. En Valencia (España)

El documento tiene version .html, y .pdf, cambiando en el navegador la parte final podrás acceder a ambos.

Este documento es de libre reproducción siempre que se cite su fuente.

Realizado con: LATEX

Índice General

1 Introducción

Hay cierto servidor de correo que requieren que quien envia el correo sea un servidor web confiable. Este es el caso de hotmail, gmail y cv.gva.es. Esto evita el spam.

Si tenemos un servidor con ip dinámica los correos no podrán ser enviados, para ello haremos relay (reenviar a través de otro servidor smtp).

2 Postfix

myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
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

# [...]
#
# SASL SUPPORT FOR SERVERS
#
# The following options set parameters needed by Postfix to enable
# Cyrus-SASL support for authentication of mail servers.
#
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous


## TLS Settings
smtp_tls_loglevel = 1
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_tls_cert_file = /etc/postfix/FOO-cert.pem
smtp_tls_key_file = /etc/postfix/FOO-key.pem
smtp_use_tls = yes
smtpd_tls_received_header = yes
smtpd_use_tls = yes

# configuracao tls
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous

# alias de mapeamento interno para externo
smtp_generic_maps = hash:/etc/postfix/generic


myhostname = aldarias.es
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = aldarias.es, localhost

##Ejecutar: postmap hash/etc/postfix/sasl_passwd
#http://groups.google.com/group/es.comp.lenguajes.php/browse_thread/thread/dbfd2147e02c2781/1d9694007dc0553b
relayhost = smtp.ono.es
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options =

#relayhost =

mynetworks = 127.0.0.0/8 192.168.2.0/24
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

mailbox_size_limit =  104857600
message_size_limit = 104857600


# Courier-Imap
home_mailbox = Maildir/


## SOPORTE SASL
#smtpd_sasl_auth_enable=yes
#smtpd_sasl_security_options=noanonymous
#broken_sasl_auth_clients=yes
#smtpd_sasl_local_domain=
smtpd_helo_required=yes
disable_vrfy_command=yes
postalias = hash:/etc/postfix/access
smtpd_sender_restrictions = hash:/etc/postfix/access, permit_sasl_authenticated, permit_mynetworks
smtpd_recipient_restrictions=permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination

# alias de mapeamento interno para externo
smtp_generic_maps = hash:/etc/postfix/generic


#http://bulma.net/body.phtml?nIdNoticia=2233
#Cambiar el servidor de envio
postmap = hash:/etc/postfix/transport
transport_maps = hash:/etc/postfix/transport

#Ejecutar: postmap hash:sasl_passwd
relayhost = smtp.gmail.com
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
sender_canonical_maps = hash:/etc/postfix/sender_canonical
smtp_sasl_security_options =

#BLoquear por IP
#Hacer: postmap hash:/etc/postfix/maps/access_client
#http://www.akadia.com/services/postfix_uce.html
smtpd_client_restrictions =
  check_client_access hash:/etc/postfix/maps/access_client,permit
header_checks = regexp:/etc/postfix/maps/header_checks
mime_header_checks = regexp:/etc/postfix/maps/mime_header_checks

#http://www.akadia.com/services/postfix_mta.html
# Email inexistentes
#postmap hash:/etc/postfix/relocated
relocated_maps = hash:/etc/postfix/relocated

3 Indicar con quien queremos hacer relay

cat /etc/postfix/transport

gmail.com      smtp:[smtp.gmail.com]:587
hotmail.com    smtp:scorreo.cv.gva.es
cv.gva.es      smtp:scorreo.cv.gva.es
ono.com        smtp:smtp.ono.com

4 Identificarnos en los SMTP

cat /etc/postfix/sasl_passwd

smtp.ono.com  paco.aldarias:micontraseña
scorreo.cv.gva.es faldarias526v:micontraseña
[smtp.gmail.com]:587 paco.aldarias:micontraseña

5 Crear el certificado para GMAIL: tls

  1. Generar el certificado:

    /usr/lib/ssl/misc/CA.pl -newca
    

  2. Generar clave privada:

    openssl req -new -nodes
    

  3. Firmarla

    openssl ca -out FOO-cert.pem -infiles FOO-req.pem
    

  4. Copiarla en /etc/postfix

    cp demoCA/cacert.pem FOO-key.pem FOO-cert.pem /etc/postfix
    chmod 644 /etc/postfix/FOO-cert.pem /etc/postfix/cacert.pem
    chmod 400 /etc/postfix/FOO-key.pem
    

  5. Añadir la firma

    cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem >> /etc/postfix/cacert.pem
    

6 Bibliografia

  1. http://prantran.blogspot.com/2007/01/getting-postfix-to-work-on-ubuntu-with.html


Índice de Materias

Sobre este documento...

Postfix relay con hotmail,cv.gva.es,gmail

This document was generated using the LaTeX2HTML translator Version 2002-2-1 (1.71)

Copyright © 1993, 1994, 1995, 1996, Nikos Drakos, Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999, Ross Moore, Mathematics Department, Macquarie University, Sydney.

The command line arguments were:
latex2html postfixrelay -split 0 -local_icons 1 -show_section_numbers -no_auto_link -no_navigation

The translation was initiated by Paco on 2007-11-12


Paco 2007-11-12