Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
2557 connectés 

  FORUM HardWare.fr
  Linux et OS Alternatifs
  Logiciels

  Configuration Postfix Debian

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Configuration Postfix Debian

n°1341491
hinomura
Posté le 16-07-2013 à 13:56:19  profilanswer
 

Bonjour,
 
J'ai installé un serveur web sur une VM dans une de nos infra, et j'y ai migré les données de l'un de nos anciens serveurs clos au 30 juin ( merci ovh ).
 
Mon ancien serveur datait de Mathusalem (distrib red hat 7.2 de 2006 ), php4, mysql4, qmail.
 
Il faisait office de serveur dns pour le domaine example.fr qu'il hébergeait.
 
Ma nouvelle machine tourne sous debian 7, php5 et postfix pour la gestion des mails ( sortants, pas besoin de recevoir de mails ).
Tuto suivi pour l'install de postfix (entre autres):
http://www.lafermeduweb.net/billet [...] ml#postfix
 
Là où ça bloque:
Au début, j'ai laissé postfix en écoute, et j'avais le problème du "backscatter" où mon install renvoyait des mails qui ne lui était pas destiné à des adresses d'expéditeurs faussées.
Donc j'ai changé le inet_interfaces sur loopback pour ne plus écouter les mails entrants et agir en tant que spammeur ( j'ai conscience que ce n'est pas "la solution" mais un contournement, j'ai essayé deux trois trucs par rapport aux docs trouvés, mais j'avoue n'être pas calé sur les serveurs mails .. )
S'il y a ici des compétences pour m'aider à solutionner ce problème (encore que, ne pas recevoir de mails n'est pas génant )

 
Le second problème:
Plus important, mes mails sont encore refusés par "pas mal" / "un certain nombre de serveurs" et, ceci dit, ça s'est bien amélioré par rapport au début ( création d'un "transport" spécifique pour free/orange entre autres ).
J'ai le cas par des systèmes qui considèrent mes mails en spam ( ok il y a des liens et du texte dedans, mais ce n'est pas du spam ).
L'ancien serveur n'était pas considéré comme spam.
Donc j'ai plus l'impression que c'est un problème de configuration générale ( DNS/Hostname/SPF ? ) que de postfix ?

 
Parfois le serveur me donne l'info comme quoi mes mails sont considérés comme du spam, des fois il se contente d'un "bounce or trace service failure" ..
 
Voilà un petit florilège:

Code :
  1. 501 Connection rejected by policy [7.7] xxxxxx, please visit www.messagelabs.com/support for more details about this error message.
  2. Final-Recipient: rfc822; xxxxxxxxx@hotmail.fr
  3. Action: failed
  4. Status: 4.3.0
  5. Remote-MTA: dns; mx3.hotmail.com
  6. Diagnostic-Code: smtp; 550 Requested action not taken: mailbox unavailable
  7. Final-Recipient: rfc822; xxxxxxx@konicaminolta.fr
  8. Action: failed
  9. Status: 4.3.0
  10. Remote-MTA: dns; mx11a.antispameurope.de
  11. Diagnostic-Code: smtp; 554 5.5.4
  12. Final-Recipient: rfc822; xxx@free.fr
  13. Action: failed
  14. Status: 4.0.0
  15. Remote-MTA: dns; mx1.free.fr
  16. Diagnostic-Code: smtp; 451 too many errors from your ip (xxx.xxx.xxx.xxx), please
  17.     visit http://postmaster.free.fr/


 
Mon serveur a bien un hostname srvweb01.example.fr
il a bien un reverse DNS sur cette adresse avec son IP
 
Voilà ma config
postconf -n

Code :
  1. append_dot_mydomain = no
  2. biff = no
  3. broken_sasl_auth_clients = yes
  4. config_directory = /etc/postfix
  5. disable_vrfy_command = yes
  6. inet_interfaces = loopback-only
  7. mailbox_size_limit = 0
  8. mydestination = localhost.localdomain, lcoalhost
  9. myhostname = srvweb01.example.fr
  10. mynetworks = 127.0.0.0/8, mon_adresse_ip_publique
  11. myorigin = example.fr
  12. recipient_delimiter = +
  13. relay_recipient_maps = hash:/etc/postfix/relay_recipients
  14. relayhost =
  15. slow_destination_concurrency_limit = 2
  16. slow_destination_recipient_limit = 20
  17. smtp_bind_address = mon_adresse_ip_publique
  18. smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
  19. smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_non_fqdn_hostname, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unauth_destination, reject_unauth_pipelining, reject_invalid_hostname
  20. smtpd_data_restrictions = reject_multi_recipient_bounce
  21. smtpd_helo_required = yes
  22. smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_invalid_helo_hostname, reject_non_fqdn_helo_hostname, reject_unknown_helo_hostname, reject_unknown_reverse_client_hostname, reject_unauth_pipelining, reject_unknown_sender_domain, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unauth_destination, reject_unknown_recipient_domain, reject_unverified_recipient
  23. smtpd_sasl_auth_enable = yes
  24. smtpd_sasl_local_domain = $myhostname
  25. smtpd_sasl_security_options = noanonymous
  26. smtpd_sender_restrictions = permit_mynetworks, warn_if_reject reject_unverified_sender
  27. transport_maps = hash:/etc/postfix/transport
  28. virtual_alias_maps = mysql:/etc/postfix/mysql-virtual_aliases.cf,mysql:/etc/postfix/mysql-virtual_aliases_comptes.cf
  29. virtual_gid_maps = static:5000
  30. virtual_mailbox_base = /var/spool/vmail/
  31. virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual_domaines.cf
  32. virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual_comptes.cf
  33. virtual_uid_maps = static:5000


 
master.cf

Code :
  1. #
  2. # Postfix master process configuration file.  For details on the format
  3. # of the file, see the master(5) manual page (command: "man 5 master" ).
  4. #
  5. # Do not forget to execute "postfix reload" after editing this file.
  6. #
  7. # ==========================================================================
  8. # service type  private unpriv  chroot  wakeup  maxproc command + args
  9. #               (yes)   (yes)   (yes)   (never) (100)
  10. # ==========================================================================
  11. smtp      inet  n       -       -       -       -       smtpd
  12. # -o content_filter=spamchk
  13. slow          unix  -       -       n       -       5       smtp
  14.    -o syslog_name=postfix-slow
  15.    -o smtp_destination_concurrency_limit=3
  16.    -o slow_destination_rate_delay=1
  17. #smtp      inet  n       -       -       -       1       postscreen
  18. #smtpd     pass  -       -       -       -       -       smtpd
  19. #dnsblog   unix  -       -       -       -       0       dnsblog
  20. #tlsproxy  unix  -       -       -       -       0       tlsproxy
  21. #submission inet n       -       -       -       -       smtpd
  22. #  -o syslog_name=postfix/submission
  23. #  -o smtpd_tls_security_level=encrypt
  24. #  -o smtpd_sasl_auth_enable=yes
  25. #  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
  26. #  -o milter_macro_daemon_name=ORIGINATING
  27. #smtps     inet  n       -       -       -       -       smtpd
  28. #  -o syslog_name=postfix/smtps
  29. #  -o smtpd_tls_wrappermode=yes
  30. #  -o smtpd_sasl_auth_enable=yes
  31. #  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
  32. #  -o milter_macro_daemon_name=ORIGINATING
  33. #628       inet  n       -       -       -       -       qmqpd
  34. pickup    fifo  n       -       -       60      1       pickup
  35. cleanup   unix  n       -       -       -       0       cleanup
  36. qmgr      fifo  n       -       n       300     1       qmgr
  37. #qmgr     fifo  n       -       n       300     1       oqmgr
  38. tlsmgr    unix  -       -       -       1000?   1       tlsmgr
  39. rewrite   unix  -       -       -       -       -       trivial-rewrite
  40. #bounce    unix  -       -       -       -       0       bounce
  41. defer     unix  -       -       -       -       0       bounce
  42. trace     unix  -       -       -       -       0       bounce
  43. verify    unix  -       -       -       -       1       verify
  44. flush     unix  n       -       -       1000?   0       flush
  45. proxymap  unix  -       -       n       -       -       proxymap
  46. proxywrite unix -       -       n       -       1       proxymap
  47. smtp      unix  -       -       -       -       -       smtp
  48. relay     unix  -       -       -       -       -       smtp
  49. #       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
  50. showq     unix  n       -       -       -       -       showq
  51. error     unix  -       -       -       -       -       error
  52. retry     unix  -       -       -       -       -       error
  53. discard   unix  -       -       -       -       -       discard
  54. local     unix  -       n       n       -       -       local
  55. virtual   unix  -       n       n       -       -       virtual
  56. lmtp      unix  -       -       -       -       -       lmtp
  57. anvil     unix  -       -       -       -       1       anvil
  58. scache    unix  -       -       -       -       1       scache
  59. #
  60. # ====================================================================
  61. # Interfaces to non-Postfix software. Be sure to examine the manual
  62. # pages of the non-Postfix software to find out what options it wants.
  63. #
  64. # Many of the following services use the Postfix pipe(8) delivery
  65. # agent.  See the pipe(8) man page for information about ${recipient}
  66. # and other message envelope options.
  67. # ====================================================================
  68. #
  69. # maildrop. See the Postfix MAILDROP_README file for details.
  70. # Also specify in main.cf: maildrop_destination_recipient_limit=1
  71. #
  72. maildrop  unix  -       n       n       -       -       pipe
  73.   flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
  74. #
  75. # ====================================================================
  76. #
  77. # Recent Cyrus versions can use the existing "lmtp" master.cf entry.
  78. #
  79. # Specify in cyrus.conf:
  80. #   lmtp    cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
  81. #
  82. # Specify in main.cf one or more of the following:
  83. #  mailbox_transport = lmtp:inet:localhost
  84. #  virtual_transport = lmtp:inet:localhost
  85. #
  86. # ====================================================================
  87. #
  88. # Cyrus 2.1.5 (Amos Gouaux)
  89. # Also specify in main.cf: cyrus_destination_recipient_limit=1
  90. #
  91. #cyrus     unix  -       n       n       -       -       pipe
  92. #  user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
  93. #
  94. # ====================================================================
  95. # Old example of delivery via Cyrus.
  96. #
  97. #old-cyrus unix  -       n       n       -       -       pipe
  98. #  flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
  99. #
  100. # ====================================================================
  101. #
  102. # See the Postfix UUCP_README file for configuration details.
  103. #
  104. uucp      unix  -       n       n       -       -       pipe
  105.   flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
  106. #
  107. # Other external delivery methods.
  108. #
  109. ifmail    unix  -       n       n       -       -       pipe
  110.   flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
  111. bsmtp     unix  -       n       n       -       -       pipe
  112.   flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
  113. scalemail-backend unix        -        n        n        -        2        pipe
  114.   flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
  115. mailman   unix  -       n       n       -       -       pipe
  116.   flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  117.   ${nexthop} ${user}
  118. #spamchk   unix  -       n       n       -       10      pipe
  119. # flags=Rq user=nobody argv=/usr/local/bin/spamchk -f ${sender} -- ${recipient}
  120. #slow down trafic to some smtp relou


 
Je suis complètement open à tout discussion sur le sujet, vous pouvez me lancer des pierres pour tout ce qui n'est pas admin-linux proof ( enfin bon en même temps j'ai eu deux mois pour remonter un serveur complet, migrer, paramétrer etc alors fuck ! ), car c'est le seul point noir de l'install, les mails. Tout le reste est au poil.
 
Merci aux pros  :jap:

mood
Publicité
Posté le 16-07-2013 à 13:56:19  profilanswer
 

n°1341664
e_esprit
Posté le 18-07-2013 à 13:58:14  profilanswer
 

Tu peux communiquer les infos suivantes par MP :
- nom(s) de domaine que ton serveur sert (en envoi uniquement donc ?)
- adresse IP de ton serveur
- nom DNS de ta machine
 
Ca permettra de vérifier que c'est pas de coté là que ça coince.
 
Pour le problème de backscatter : http://www.postfix.org/ADDRESS_VER [...] EADME.html


---------------
Ce n'est point ma façon de penser qui a fait mon malheur, c'est celle des autres.

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Linux et OS Alternatifs
  Logiciels

  Configuration Postfix Debian

 

Sujets relatifs
Débit serveur Debian soudainement extrêmement faibleDEBIAN 7 echec installation PHP5
DEBIAN 7 Probleme installation module perl DBDDEBIAN echec installation Paquet apache2 php5...
Installer VNC sur Debian sans GUI...Linux (Debian 6) : clone over internet ?
Configuration Réseaux sous JauntyPostfix deliverfy Local et Externe
Configuration de maildir sous debian avec postfix et pop3-courier[POSTFIX] Aide pour la configuration sur Debian
Plus de sujets relatifs à : Configuration Postfix Debian


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR