[U-co] restricciones de envio de correo postfix

Diego Umba sadmanrock en gmail.com
Vie Abr 17 13:29:44 UTC 2009


Buenos Dias


Tengo un inconveniente y este es el ultimo recurso que agoto antes de tomar
una desicion de un cambio de estructura con el fin de alcanzar el objetivo
de seguridad de correo de la organizacion en la cual me desempeño.
El contexto del problema radica que en la organizacion de acuerdo a los
perfiles de usuario se deben tener restricciones de salida externa (salida
de correos por fuera del dominio) a algunos empleados y otros con salida de
correos a todos los dominios.
La estructura actual de correos cuenta con lo siguiente servidor de correos
postfix, dovecot, dbmail, ldap y herramientas de control antiespam como
Mailscanner, Clamav y Postgrey, la cual esta configurada de la siguiente
forma:
Postfix esta enlazada con dbmail y dbmail esta enlazada con ldap para traer
los usuarios y guardar los correos entrantes en el servidor.
He leido en los ultimos dias todo lo referente a los 3 programas y como se
enlazan pero no he encontrado informacion para tener restricciones para
salida de correo unicamente a algunos usuarios con dbmail y postfix.
Si alguna persona tiene algun manual explicativo de este proceso o tiene
sugerencias de soluciones a este inconveniente se lo agradeceria mucho.
Informo los archivos de configuracion del postfix main.cf, master.cf, porque
se que esto podria ser de gran ayuda.


# 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 = mail.abogadoscac.com.co
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = ####, #######, ########, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 192.168.0.0/24
192.168.2.0/29
mailbox_size_limit = 209725440
recipient_delimiter = +
inet_interfaces = all
local_recipient_maps =
header_checks = regexp:/etc/postfix/header_checks
mailbox_transport = dbmail-lmtp:127.0.0.1:24

smtpd_helo_required = yes

smtpd_helo_restrictions = reject_invalid_hostname

smtpd_recipient_restrictions =
                            permit_mynetworks,
                            reject_invalid_hostname,
                            reject_non_fqdn_sender,
                            reject_non_fqdn_recipient,
                            reject_unknown_recipient_domain,
                            reject_unauth_pipelining,
                            reject_unknown_sender_domain,
                            reject_unauth_destination,
#                           check_sender_access
hash:/etc/postfix/restricted_out

smtpd_data_restrictions = reject_unauth_pipelining
#smtpd_restriction_classes = nac_out
#nac_out = check_recipient_access hash:/etc/postfix/filtro_nac,
reject_unauth_destination, reject

Nota: Los comentarios # en los smtpd_recipient_restrictions son debidos a
algunas pruebas que se hicieron para la restriccion

Archivo de configuracion master.cf

#  -o milter_macro_daemon_name=ORIGINATING
#628      inet  n       -       -       -       -       qmqpd
pickup    fifo  n       -       -       60      1       pickup
cleanup   unix  n       -       -       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
#qmgr     fifo  n       -       -       300     1       oqmgr
tlsmgr    unix  -       -       -       1000?   1       tlsmgr
rewrite   unix  -       -       -       -       -       trivial-rewrite
bounce    unix  -       -       -       -       0       bounce
defer     unix  -       -       -       -       0       bounce
trace     unix  -       -       -       -       0       bounce
verify    unix  -       -       -       -       1       verify
flush     unix  n       -       -       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       -       -       -       smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay     unix  -       -       -       -       -       smtp
        -o smtp_fallback_relay=
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       -       -       -       showq
error     unix  -       -       -       -       -       error
retry     unix  -       -       -       -       -       error
discard   unix  -       -       -       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       -       -       -       lmtp
anvil     unix  -       -       -       -       1       anvil
scache    unix  -       -       -       -       1       scache
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent.  See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.# Also specify
in main.cf: maildrop_destination_recipient_limit=1
#
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
#
# See the Postfix UUCP_README file for configuration details.
#
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail
($recipient)
#
# Other external delivery methods.
#
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender
$recipient
scalemail-backend unix  -       n       n       -       2       pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store
${nexthop} ${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py# Also
specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
#
# See the Postfix UUCP_README file for configuration details.
#
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail
($recipient)
#
# Other external delivery methods.
#
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender
$recipient
scalemail-backend unix  -       n       n       -       2       pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store
${nexthop} ${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}

dbmail-lmtp     unix    -       -       n       -       -       lmtp# (c)
2000-2006 IC&S, The Netherlands
#


Gracias por la atencion prestada

Diego Armando Umba
Ubuntu User:#24876
Linux User:#481001
"El hombre más poderoso, es aquel que es totalmente, dueño de sí mismo"



Más información sobre la lista de distribución Ubuntu-co