[/][/]
olicel a écrit :
salut,
J'ai un serveur sur lequel j'heberge un serveur de messagerie POSTFIX. J'aimerais empecher certaines adresses mail de mon serveur de recevoir et d'envoyer du courier ailleurs que sur mon domain(serveur).
Donc je pourrais mettre en regles des regles de filtrage ou niveau du champ "To" pour les entrées et au niveau du champ "From" pour les sorties.
Que dois-je utiliser pour ca ??
Je ne veux rien faire d'autres comme filtrage, et la solution la plus légére a mettre en place sera la mieux.
olivier
|
En fait, tout ce passe au niveau du fichier etc/postfix/main.cf
qui inclu des regles de securite + il fait references a d'autres fichiers qu'il faut avoir dans le meme repertoire et passes a la moulinette avec la commande postmap et postalias pour des fichiers comme aliases.
Voici ma quelques fichiers relatif a la securite si ça t'interesse(je ne les ai pas tous ici car je ne suis pas chez moi) :
le fichier /etc/postfix/main.cf :
# SOFT BOUNCE
soft_bounce = yes
# LOCAL PATHNAME INFORMATION
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
# QUEUE AND PROCESS OWNERSHIP
mail_owner = postfix
default_privs = nobody
# INTERNET HOST AND DOMAIN NAMES
myhostname = nomtamachine.nomtondomaine
mydomain = nomtondomaine
# SENDING MAIL
myorigin = $myhostname
myorigin = $mydomain
# RECEIVING MAIL
inet_interfaces = $myhostname, localhost
mydestination = $myhostname, localhost.$mydomain, $mydomain
# TRUST AND RELAY CONTROL
mynetworks = 192.168.4.0/24, 127.0.0.0/8
relay_domains = $mydestination
# INTERNET OR INTRANET
relayhost =nomtamachine.nomtondomaine:25
relayhost = $mydomain
# REJECTING UNKNOWN LOCAL USERS
#local_recipient_maps = $alias_maps unix:passwd.byname
# ADDRESS REWRITING
sender_canonical_maps = hashetc/postfix/canonical
# ADDRESS REDIRECTION (VIRTUAL DOMAIN)
virtual_maps = hashetc/postfix/virtual
# "USER HAS MOVED" BOUNCE MESSAGES
# TRANSPORT MAP
default_transport = smtp
transport_maps = hashetc/postfix/transport
# ALIAS DATABASE
alias_maps = hashetc/postfix/aliases
alias_database = hashetc/postfix/aliases
# ADDRESS EXTENSIONS (e.g., user+foo)
# DELIVERY TO MAILBOX
mail_spool_directory = /var/spool/mail
# EXTENSION (address extension), DOMAIN (domain part of address),
# IF YOU USE THIS TO DELIVER MAIL SYSTEM-WIDE, YOU MUST SET UP AN
# ALIAS THAT FORWARDS MAIL FOR ROOT TO A REAL USER.
mailbox_command = /usr/bin/procmail -a $DOMAIN -d $LOGNAME
# JUNK MAIL CONTROLS
#header_checks = regexpetc/postfix/header_checks
# FAST ETRN SERVICE
#fast_flush_domains = $relay_domains
#fast_flush_domains =
# SHOW SOFTWARE VERSION OR NOT
#smtpd_banner = $myhostname ESMTP $mail_name
#smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)
smtpd_banner = $myhostname ESMTP $mail_name ($mail_version) (Mandrake Linux)
# PARALLEL DELIVERY TO THE SAME DESTINATION
local_destination_concurrency_limit = 2
default_destination_concurrency_limit = 10
# DEBUGGING CONTROL
debug_peer_level = 2
#debug_peer_list = 127.0.0.1
#debug_peer_list = some.domain
debugger_command =
PATH=/usr/binusr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5
# OTHER OPTIONS (Mandrake)
delay_warning_time = 4
# INSTALL-TIME CONFIGURATION INFORMATION
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-1.1.11/samples
readme_directory = /usr/share/doc/postfix-1.1.11/README_FILES
# LIMITATIONS
defaultdestination_recipient_limite = 20
maximal_queue_lifetime = 5
header_sizelimit = 102400
message_size_limit = 10240000
queue_min_free = 10000000
smtpd_error_sleep_time = 5
smtpd_soft_error_limit = 10
smtpd_hard_error_limit = 10
# SECURITY
disable_vrfy_command = yes
smtpd_helo_required = yes
#
smtpd_recipient_restrictions = check_client_access hashetc/postfix/clients, permit_mynetworks, check_relay_domains,reject_invalid_hostname, reject_non_fqdn_hostname, reject_non_fqdn_sender, reject_non_fqdn_recipient,reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unauth_pipelining, reject_unauth_destination, check_recipient_access pcreetc/postfix/recipient_checks.pcre, check_sender_access hashetc/postfix/sender_checks,check_sender_access hashetc/postfix/freemail_access, check_client_access hashetc/postfix/client_checks, check_client_access pcreetc/postfix/client_checks.pcre, reject_rbl_client relays.ordb.org, reject_rbl_client inputs.relays.osirusoft.com, reject_rbl_client dialups.relays.osirusoft.com, reject_rbl_client spamhaus.relays.osirusoft.com, reject_rbl_client proxies.relays.monkeys.com, reject_rbl_client opm.blitzed.org, permit_mynetworks, check_relay_domains, maps_rbl_domains = rbl.maps.vix.com, dul.maps.vix.com, relays.ordb.org, bl.spamcop.net
smtpd_sender_restrictions = reject_unknown_sender_domain, check_client_access hashetc/postfix/clients, permit_mynetworks, check_relay_domains
smtpd_client_restrictions = check_client_access hashetc/postfix/access, check_relay_domains, reject_maps_rbl, permit_mynetworks, check_relay_domains, permit_auth_destination, reject_unauth_destination, reject_unknown_recipient_domain, permit_mx_backup, reject_unknown_client, reject_unknown_sender_domain, check_sender_access hashetc/postfix/access, reject_non_fqdn_sender, local_recipient_maps = $alias_maps unix:passwd.byname
header_checks = regexpetc/postfix/headers_checks
smtpd_restriction_classes = from_freemail_host
from_freemail_host = check_client_access hashetc/postfix/freemail_hosts, reject
le fichier /etc/postfix/client_checks.pcre :
# /etc/postfix/client_checks.pcre:
# Postfix' dbm/hash files don't allow CIDR notation, netmasks
# or address ranges, but you can achieve the same end with
# regular expressions.
#
# Again: these are in PCRE notation. But you could accomplish
# the same with POSIX RE's. (I just don't know how.)
# 10.9.8.0 - 10.9.9.255
/10\.9\.[89]\.\d+/ REJECT
# 10.9.8.0 - 10.9.10.255 is generally no good, but 10.9.8.7 is OK
/10\.9\.8\.7/ OK
/10\.9\.([89]|10)\.\d+/ 554 Go away. We don't want any!
le fichier /etc/postfix/recipient_checks.pcre:
# /etc/postfix/recipient_checks.pcre:
# Note: you have to have PCRE support support built in to Postfix
# at compile time to use this. (Tho I've been told the following
# are valid POSIX RE's that do the same thing.)
#
# Postfix doesn't relay by default. But it may *appear* to do so
# to some testers. The first two statements below remove all
# doubt.
/^\@/ 550 Invalid address format.
/[!%\@].*\@/ 550 This server disallows weird address syntax.
# Let email to the following destinations bypass all the remaining
# "reject" and "check" tests. We always want to let email for these
# recipients in.
/^postmaster\@/ OK
/^hostmaster\@/ OK
/^abuse\@/ OK
---------------
Linuxois1 ex- Linuxois pour perte de mot de passe et @ adresse mail n'existant plus.