
El archivo main.cf es el que tiene la
mayoría de la configuración del Postfix. El mismo se 'adapta' a las
necesidades de cada Servidor de Correo, siendo, por ejemplo, mas o menos
restrictivo con las listas RBLs, con los filtrados de encabezados y del cuerpo
del mensaje, etc. etc.
Del sitio de Jeffrey Poslums,
Security Sage, traduje buena
parte del contenido, y obtuve el archivo main.cf de Len Conrad - el cual
pueden descargarlo aquí -, que debajo figura.
Pero me repito en que siendo esto dinámico, y personalizable, verifiquen y
entiendan bien cada línea de la configuración, para así tomar lo que
necesiten.
Este archivo es para Postfix
2.0.0-20030101 versión NO OFICIAL, sino Experimental o SNAPSHOT.
# config file works with postfix-2.0.0-20030101.tar.gz
# and recent versions around there. NOT with "release",
# only with the "experimental" snapshots.
#
# IMGate BASIC configuration file
# Copyright 2003, Len Conrad ( LConrad@Go2France.com)
#
# Cuando se lista un "parámetro =" en múltiples líneas, NO lo
# comenten con un "#" en el medio, ya que truncará la lista en ese punto.
#
#always_bcc = harvest-headers@$myhostname
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
# IMGate: completen los ***** con sus datos respectivos
# sugerencia: mx1.midominio.com
myhostname = *****
# midominio.com
mydomain = *****
myorigin = $myhostname
append_at_myorigin = yes
mydestination = $myhostname, localhost.$mydomain
# IMGate: agreguen sus redes ip acá, con el formato "a.b.c.d/n,"
# una por línea, comenzando con un espacio o TAB en la primer
# columna, y una ',' ( coma ) al final de cada línea, excepto la última
#
mynetworks =
127.0.0.0/8,
*****,
*****
transport_maps = hash:/etc/postfix/transport.map
relay_domains = $mynetworks, hash:/etc/postfix/transport.map
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
smtpd_recipient_restrictions =
reject_unauth_pipelining,
reject_non_fqdn_sender,
reject_non_fqdn_recipient,
reject_unknown_recipient_domain,
hash:/etc/postfix/to_recipients_bw.map,
reject_unknown_sender_domain,
permit_mynetworks,
reject_unauth_destination,
check_client_access hash:/etc/postfix/mta_clients_bw.map,
check_sender_access regexp:/etc/postfix/from_senders.regexp,
check_sender_access hash:/etc/postfix/from_senders_bw.map,
check_helo_access hash:/etc/postfix/helo_hostnames.map,
check_sender_access hash:/etc/postfix/from_senders_slet.map,
check_sender_access hash:/etc/postfix/from_senders_clueless.map,
check_sender_access hash:/etc/postfix/from_senders_bogus.map,
check_sender_access hash:/etc/postfix/from_senders_mybogus.map,
reject_rbl_client blackholes.wirehub.net,
reject_rbl_client bl.spamcop.net,
reject_rbl_client list.dsbl.org,
reject_rbl_client dnsbl.njabl.org,
reject_rbl_client relays.ordb.org,
reject_rbl_client dynablock.wirehub.net,
reject_rbl_client proxies.relays.monkeys.com,
reject_rbl_client dialups.relays.osirusoft.com,
reject_rbl_client spamhaus.relays.osirusoft.com,
reject_rbl_client orbs.dorkslayers.com,
reject_rbl_client socks.relays.osirusoft.com,
reject_rbl_client inputs.relays.osirusoft.com,
reject_rbl_client relays.visi.com,
reject_rbl_client opm.blitzed.org,
reject_unverified_sender,
permit
header_checks = pcre:/etc/postfix/header_checks.regexp
#header_checks = regexp:/etc/postfix/header_checks.regexp si no compilamos
Postfix con PCRE
body_checks = pcre:/etc/postfix/body_checks.regexp
#body_checks = regexp:/etc/postfix/body_checks.regexp
smtpd_helo_required = yes
strict_rfc821_envelopes = yes
# IMGate: Modifique el anuncio acorde a sus preferencias
smtpd_banner = $myhostname - ESMTP - $mail_name - Attn: el correo SPAM no se
permite y será castigado.
notify_classes =
resource,
software,
bounce,
2bounce,
delay,
policy,
protocol
double_bounce_sender = double-bounce
#
# IMGate: Reemplazar ***** con la dirección de email correspondiente, como mx1-admin@midominio.com.
#
bounce_notice_recipient = *****
delay_notice_recipient = *****
error_notice_recipient = *****
empty_address_recipient = MAILER-DAEMON
local_destination_concurrency_limit = 2
default_destination_concurrency_limit = 100
default_destination_recipient_limit = 20
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5
debug_peer_level = 2
readme_directory = /etc/postfix/README
sample_directory = /etc/postfix/samples
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
manpage_directory = /usr/local/man
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
# Valores de IMGate que sobrescriben los del postfix por defecto
#
disable_vrfy_command = yes
smtpd_helo_required = yes
smtp_always_send_ehlo = yes
biff = no
maximal_queue_lifetime = 7200s
delay_warning_time = 1
smtpd_hard_error_limit = 2
strict_rfc821_envelopes = yes
strict_7bit_headers = yes
unknown_address_reject_code = 554
unknown_client_reject_code = 554
unknown_hostname_reject_code = 554
delay_warning_time = 1
bounce_size_limit = 5000
header_size_limit = 256
message_size_limit = 5000000
ignore_mx_lookup_error = yes
queue_minfree = 20480000
smtpd_timeout = 20s
smtp_connect_timeout = 60s
smtp_data_done_timeout = 60s
smtp_data_init_timeout = 60s
smtp_data_xfer_timeout = 60s
smtp_helo_timeout = 60s
smtp_mail_timeout = 60s
smtp_quit_timeout = 60s
smtp_rcpt_timeout = 60s
# SAV o "sender address verification"
address_verify_map = hash:/var/log/address_verify.map
address_verify_positive_expire_time = 31d
address_verify_positive_refresh_time = 7d
address_verify_negative_cache = yes
address_verify_negative_expire_time = 3d
address_verify_negative_refresh_time = 3h
unverified_sender_reject_code = 554
Definiremos algunas cosas acá: