jaymzwise | Salut,
Mon serveur de messagerie tourne sous Debian Lenny : Postfix, SpamAssassin, ClamAV et Amavis.
Tout tourne correctement, les mails passent bien à travers ClamAV et SpamAssassin.
Le problème c'est que même les mails locaux passent à travers Amavis et je souhaiterais que ce ne soit pas le cas, au moins pour SpamAssassin (Certains de nos mails en interne sont considérés comme des spams).
J'ai bien tenté de modifier le local.cf et d'y rajouter les paramètres trusted_networks et internal_networks mais pas de changement, je dois surement pas modifier ce qu'il faut.
Voici mes fichiers de conf :
postconf -n
Code :
- alias_database = hash:/etc/postfix/aliases
- alias_maps = hash:/etc/postfix/aliases
- append_dot_mydomain = no
- biff = no
- bounce_template_file = /etc/postfix/bounce.cf
- config_directory = /etc/postfix
- content_filter = smtp-amavis:[127.0.0.1]:10024
- header_checks = regexp:/etc/postfix/header_checks
- home_mailbox = Maildir/
- inet_interfaces = all
- local_recipient_maps = $alias_maps
- mailbox_size_limit = 0
- message_size_limit = 20000000
- mydestination = $mydomain, $myhostname.$mydomain, localhost.$mydomain
- mydomain = x.x
- myhostname = x.x.x
- mynetworks = X, X, X, X, 127.0.0.0/8
- myorigin = $mydomain
- receive_override_options = no_address_mappings
- recipient_delimiter = +
- relay_domains = x.x
- relayhost = [smtp-msa.orange.fr]:587
- smtp_sasl_auth_enable = yes
- smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
- smtp_sasl_security_options =
- smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
- smtpd_client_restrictions = permit_mynetworks
- smtpd_delay_reject = yes
- smtpd_helo_required = yes
- smtpd_helo_restrictions = permit_mynetworks, reject_invalid_hostname, reject_unauth_pipelining, reject_non_fqdn_hostname
- smtpd_recipient_restrictions = permit_mynetworks, check_sender_access hash:/etc/postfix/sender_whitelist, permit_sasl_authenticated,reject_unverified_recipient, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unauth_destination, permit
- smtpd_sender_restrictions = permit_mynetworks, check_sender_access hash:/etc/postfix/sender_whitelist, reject_unknown_sender_domain, reject_unauth_destination
|
master.cf
Code :
- #
- # Postfix master process configuration file. For details on the format
- # of the file, see the master(5) manual page (command: "man 5 master" ).
- #
- # ==========================================================================
- # service type private unpriv chroot wakeup maxproc command + args
- # (yes) (yes) (yes) (never) (100)
- # ==========================================================================
- # smtp inet n - - - - smtpd
- smtp inet n - - - - smtpd
- #submission inet n - - - - smtpd
- # -o smtpd_enforce_tls=yes
- # -o smtpd_sasl_auth_enable=yes
- # -o smtpd_client_restrictions=permit_sasl_authenticated,reject
- #smtps inet n - - - - smtpd
- # -o smtpd_tls_wrappermode=yes
- # -o smtpd_sasl_auth_enable=yes
- # -o smtpd_client_restrictions=permit_sasl_authenticated,reject
- #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
- smtp unix - - - - - smtp
- # When relaying mail as backup MX, disable fallback_relay to avoid MX loops
- relay unix - - - - - smtp
- -o fallback_relay=
- # -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
- showq unix n - - - - showq
- error 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
- ${nexthop} ${user}
- smtp-amavis unix - - n - 2 smtp -o smtp_data_done_timeout=1200 -o smtp_send_xforward_command=yes -o disable_dns_lookups=yes -o max_use=20
- 127.0.0.1:10025 inet n - - - - smtpd -o content_filter= -o local_recipient_maps= -o relay_recipient_maps= -o smtpd_restriction_classes= -o smtpd_client_restrictions= -o smtpd_helo_restrictions= -o smtpd_sender_restrictions= -o smtpd_recipient_restrictions=permit_mynetworks,reject -o smtpd_data_restrictions=reject_unauth_pipelining -o smtpd_end_of_data_restrictions= -o mynetworks=127.0.0.0/8 -o strict_rfc821_envelopes=yes -o smtpd_error_sleep_time=0 -o smtpd_soft_error_limit=1001 -o smtpd_hard_error_limit=1000 -o smtpd_client_connection_count_limit=0 -o smtpd_client_connection_rate_limit=0 -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks
|
20-debian_defaults
Code :
- use strict;
- # ADMINSTRATORS:
- # Debian suggests that any changes you need to do that should never
- # be "updated" by the Debian package should be made in another file,
- # overriding the settings in this file.
- #
- # The package will *not* overwrite your settings, but by keeping
- # them separate, you will make the task of merging changes on these
- # configuration files much simpler...
- # see /usr/share/doc/amavisd-new/examples/amavisd.conf-default for
- # a list of all variables with their defaults;
- # see /usr/share/doc/amavisd-new/examples/amavisd.conf-sample for
- # a traditional-style commented file
- # [note: the above files were not converted to Debian settings!]
- #
- # for more details see documentation in /usr/share/doc/amavisd-new
- # and at http://www.ijs.si/software/amavisd/amavisd-new-docs.html
- $QUARANTINEDIR = "$MYHOME/virusmails";
- $mydomain = 'x.x';
- @local_domains_maps = ( [".$mydomain" ] );
- $log_recip_templ = undef; # disable by-recipient level-0 log entries
- $DO_SYSLOG = 1; # log via syslogd (preferred)
- $syslog_ident = 'amavis'; # syslog ident tag, prepended to all messages
- $syslog_facility = 'mail';
- $syslog_priority = 'debug'; # switch to info to drop debug output, etc
- $enable_db = 1; # enable use of BerkeleyDB/libdb (SNMP and nanny)
- $enable_global_cache = 1; # enable use of libdb-based cache if $enable_db=1
- $inet_socket_port = 10024; # default listenting socket
- $sa_spam_subject_tag = '{Spam?}';
- # $sa_spam_modifies_subj = 1;
- $sa_tag_level_deflt = 5.0; # add spam info headers if at, or above that level
- $sa_tag2_level_deflt = 6.31; # add 'spam detected' headers at that level
- $sa_kill_level_deflt = 6.31; # triggers spam evasive actions
- $sa_dsn_cutoff_level = 10; # spam level beyond which a DSN is not sent
- $defang_spam = 1; # le spam bascule en piece jointe, rapport dans le mail
- $sa_mail_body_size_limit = 200*1024; # don't waste time on SA if mail is larger
- $sa_local_tests_only = 0; # only tests which do not require internet access?
- # Quota limits to avoid bombs (like 42.zip)
- $MAXLEVELS = 14;
- $MAXFILES = 1500;
- $MIN_EXPANSION_QUOTA = 100*1024; # bytes
- $MAX_EXPANSION_QUOTA = 300*1024*1024; # bytes
- # You should:
- # Use D_DISCARD to discard data (viruses)
- # Use D_BOUNCE to generate local bounces by amavisd-new
- # Use D_REJECT to generate local or remote bounces by the calling MTA
- # Use D_PASS to deliver the message
- #
- # Whatever you do, *NEVER* use D_REJECT if you have other MTAs *forwarding*
- # mail to your account. Use D_BOUNCE instead, otherwise you are delegating
- # the bounce work to your friendly forwarders, which might not like it at all.
- #
- # On dual-MTA setups, one can often D_REJECT, as this just makes your own
- # MTA generate the bounce message. Test it first.
- #
- # Bouncing viruses is stupid, always discard them after you are sure the AV
- # is working correctly. Bouncing real SPAM is also useless, if you cannot
- # D_REJECT it (and don't D_REJECT mail coming from your forwarders!).
- $final_virus_destiny = D_DISCARD; # (data not lost, see virus quarantine)
- $final_banned_destiny = D_BOUNCE; # D_REJECT when front-end MTA
- $final_spam_destiny = D_PASS; # D_BOUNCE;
- $final_bad_header_destiny = D_PASS; # False-positive prone (for spam)
- $virus_admin = "admins\@cer83.net"; # due to D_DISCARD default
- # Leave empty (undef) to add no header
- $X_HEADER_LINE = "Debian $myproduct_name at $mydomain";
- # REMAINING IMPORTANT VARIABLES ARE LISTED HERE BECAUSE OF LONGER ASSIGNMENTS
- #
- # DO NOT SEND VIRUS NOTIFICATIONS TO OUTSIDE OF YOUR DOMAIN. EVER.
- #
- # These days, almost all viruses fake the envelope sender and mail headers.
- # Therefore, "virus notifications" became nothing but undesired, aggravating
- # SPAM. This holds true even inside one's domain. We disable them all by
- # default, except for the EICAR test pattern.
- #
- @viruses_that_fake_sender_maps = (new_RE(
- [qr'\bEICAR\b'i => 0], # av test pattern name
- [qr/.*/ => 1], # true for everything else
- ));
- @keep_decoded_original_maps = (new_RE(
- # qr'^MAIL$', # retain full original message for virus checking (can be slow)
- qr'^MAIL-UNDECIPHERABLE$', # recheck full mail if it contains undecipherables
- qr'^(ASCII(?! cpio)|text|uuencoded|xxencoded|binhex)'i,
- # qr'^Zip archive data', # don't trust Archive::Zip
- ));
- # for $banned_namepath_re, a new-style of banned table, see amavisd.conf-sample
- $banned_filename_re = new_RE(
- # qr'^UNDECIPHERABLE$', # is or contains any undecipherable components
- # block certain double extensions anywhere in the base name
- qr'\.[^./]*\.(exe|vbs|pif|scr|bat|cmd|com|cpl|dll)\.?$'i,
- qr'\{[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}\}?'i, # Windows Class ID CLSID, strict
- qr'^application/x-msdownload$'i, # block these MIME types
- qr'^application/x-msdos-program$'i,
- qr'^application/hta$'i,
- # qr'^application/x-msmetafile$'i, # Windows Metafile MIME type
- # qr'^\.wmf$', # Windows Metafile file(1) type
- # qr'^message/partial$'i, qr'^message/external-body$'i, # rfc2046 MIME types
- # [ qr'^\.(Z|gz|bz2)$' => 0 ], # allow any in Unix-compressed
- # [ qr'^\.(rpm|cpio|tar)$' => 0 ], # allow any in Unix-type archives
- # [ qr'^\.(zip|rar|arc|arj|zoo)$'=> 0 ], # allow any within such archives
- qr'.\.(exe|vbs|pif|scr|bat|cmd|com|cpl)$'i, # banned extension - basic
- # qr'.\.(ade|adp|app|bas|bat|chm|cmd|com|cpl|crt|emf|exe|fxp|grp|hlp|hta|
- # inf|ins|isp|js|jse|lnk|mda|mdb|mde|mdw|mdt|mdz|msc|msi|msp|mst|
- # ops|pcd|pif|prg|reg|scr|sct|shb|shs|vb|vbe|vbs|
- # wmf|wsc|wsf|wsh)$'ix, # banned ext - long
- # qr'.\.(mim|b64|bhx|hqx|xxe|uu|uue)$'i, # banned extension - WinZip vulnerab.
- qr'^\.(exe-ms)$', # banned file(1) types
- # qr'^\.(exe|lha|tnef|cab|dll)$', # banned file(1) types
- );
- # See http://support.microsoft.com/default.aspx?scid=kb;EN-US;q262631
- # and http://www.cknow.com/vtutor/vtextensions.htm
- # ENVELOPE SENDER SOFT-WHITELISTING / SOFT-BLACKLISTING
- @score_sender_maps = ({ # a by-recipient hash lookup table,
- # results from all matching recipient tables are summed
- # ## per-recipient personal tables (NOTE: positive: black, negative: white)
- # 'user1@example.com' => [{'bla-mobile.press@example.com' => 10.0}],
- # 'user3@example.com' => [{'.ebay.com' => -3.0}],
- # 'user4@example.com' => [{'cleargreen@cleargreen.com' => -7.0,
- # '.cleargreen.com' => -5.0}],
- ## site-wide opinions about senders (the '.' matches any recipient)
- '.' => [ # the _first_ matching sender determines the score boost
- new_RE( # regexp-type lookup table, just happens to be all soft-blacklist
- [qr'^(bulkmail|offers|cheapbenefits|earnmoney|foryou)@'i => 5.0],
- [qr'^(greatcasino|investments|lose_weight_today|market\.alert)@'i=> 5.0],
- [qr'^(money2you|MyGreenCard|new\.tld\.registry|opt-out|opt-in)@'i=> 5.0],
- [qr'^(optin|saveonlsmoking2002k|specialoffer|specialoffers)@'i => 5.0],
- [qr'^(stockalert|stopsnoring|wantsome|workathome|yesitsfree)@'i => 5.0],
- [qr'^(your_friend|greatoffers)@'i => 5.0],
- [qr'^(inkjetplanet|marketopt|MakeMoney)\d*@'i => 5.0],
- ),
- # read_hash("/var/amavis/sender_scores_sitewide" ),
- { # a hash-type lookup table (associative array)
- 'nobody@cert.org' => -3.0,
- 'cert-advisory@us-cert.gov' => -3.0,
- 'owner-alert@iss.net' => -3.0,
- 'slashdot@slashdot.org' => -3.0,
- 'securityfocus.com' => -3.0,
- 'ntbugtraq@listserv.ntbugtraq.com' => -3.0,
- 'security-alerts@linuxsecurity.com' => -3.0,
- 'mailman-announce-admin@python.org' => -3.0,
- 'amavis-user-admin@lists.sourceforge.net'=> -3.0,
- 'amavis-user-bounces@lists.sourceforge.net' => -3.0,
- 'spamassassin.apache.org' => -3.0,
- 'notification-return@lists.sophos.com' => -3.0,
- 'owner-postfix-users@postfix.org' => -3.0,
- 'owner-postfix-announce@postfix.org' => -3.0,
- 'owner-sendmail-announce@lists.sendmail.org' => -3.0,
- 'sendmail-announce-request@lists.sendmail.org' => -3.0,
- 'donotreply@sendmail.org' => -3.0,
- 'ca+envelope@sendmail.org' => -3.0,
- 'noreply@freshmeat.net' => -3.0,
- 'owner-technews@postel.acm.org' => -3.0,
- 'ietf-123-owner@loki.ietf.org' => -3.0,
- 'cvs-commits-list-admin@gnome.org' => -3.0,
- 'rt-users-admin@lists.fsck.com' => -3.0,
- 'clp-request@comp.nus.edu.sg' => -3.0,
- 'surveys-errors@lists.nua.ie' => -3.0,
- 'emailnews@genomeweb.com' => -5.0,
- 'yahoo-dev-null@yahoo-inc.com' => -3.0,
- 'returns.groups.yahoo.com' => -3.0,
- 'clusternews@linuxnetworx.com' => -3.0,
- lc('lvs-users-admin@LinuxVirtualServer.org') => -3.0,
- lc('owner-textbreakingnews@CNNIMAIL12.CNN.COM') => -5.0,
- # soft-blacklisting (positive score)
- 'sender@example.net' => 3.0,
- '.example.net' => 1.0,
- },
- ], # end of site-wide tables
- });
- 1; # insure a defined return
|
local.cf
Code :
- # This is the right place to customize your installation of SpamAssassin.
- #
- # See 'perldoc Mail::SpamAssassin::Conf' for details of what can be
- # tweaked.
- #
- # Only a small subset of options are listed below
- #
- ###########################################################################
- # Add *****SPAM***** to the Subject header of spam e-mails
- #
- # rewrite_header Subject {Spam?}
- # rewrite_subject 1
- # Save spam messages as a message/rfc822 MIME attachment instead of
- # modifying the original message (0: off, 2: use text/plain instead)
- #
- report_safe 1
- # Set which networks or hosts are considered 'trusted' by your mail
- # server (i.e. not spammers)
- #
- clear_internal_networks
- clear_trusted_networks
- internal_networks x.x/16
- trusted_networks x.x/16
- # Set file-locking method (flock is not safe over NFS, but is faster)
- #
- # lock_method flock
- # Set the threshold at which a message is considered spam (default: 5.0)
- #
- # required_score 5.0
- # Use Bayesian classifier (default: 1)
- #
- # use_bayes 1
- # Bayesian classifier auto-learning (default: 1)
- #
- # bayes_auto_learn 1
- # Set headers which may provide inappropriate cues to the Bayesian
- # classifier
- #
- # bayes_ignore_header X-Bogosity
- # bayes_ignore_header X-Spam-Flag
- # bayes_ignore_header X-Spam-Status
- bayes_auto_expire 0
|
|