Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[postfix] Relay access denied (résolu)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index French
View previous topic :: View next topic  
Author Message
digimag
Guru
Guru


Joined: 14 May 2005
Posts: 451
Location: Toulouse, France

PostPosted: Tue Sep 08, 2009 4:22 pm    Post subject: [postfix] Relay access denied (résolu) Reply with quote

Bonjour,

Je viens de passer un week-end entier à essayer de faire fonctionner mon smtp. N'étant pas familier avec Postfix, j'ai suivi le guide.

Quelqu'un qui a compris le fonctionnement de Postfix pourrait-il expliquer quelles sont exactement les variables qui déterminent si oui ou non :

  1. L'envoi depuis le serveur sera autorisé au client (queued).
  2. Le serveur transmettra effectivement le e-mail du client après l'avoir mis dans la file d'attente.
  3. Le mail reçu depuis un autre serveur SMTP sera accepté stocké sur la machine.
  4. Le mail reçu depuis un autre serveur SMTP sera renvoyé à une autre machine (relay).


Tout ceci m'a l'air bien confus. Par exemple je sais pas si le 1 et le 4 sont équivalents : un serveur qui veut m'envoyer un message sur mon serveur se connecte et effectue les mêmes commandes que le client qui veut envoyer du courrier à une autre machine ?

Je ne veux pas vous encombrer avec tous les logs et tous les paramètres, mais par exemple en ce moment, bien que je puisse envoyer du courrier à d'autres serveurs avec SMTP AUTH PLAIN sans SSL (c'est ok car j'ai Squirrel Mail en local, et le serveur web a SSL), je ne reçois pas de messages sur ma boîte e-mail.

Par exemple, je vais m'envoyer un e-mail sur alex -Chez- lilt.li depuis mon compte gmail digimag -Chez- gmail.com :
syslog-ng wrote:
Sep 8 18:04:36 lilt postfix/postfix-script[21665]: refreshing the Postfix mail system
Sep 8 18:04:36 lilt postfix/master[20816]: reload configuration /etc/postfix
[...]
Sep 8 18:05:57 lilt postfix/smtpd[21673]: connection established
Sep 8 18:05:57 lilt postfix/smtpd[21673]: master_notify: status 0
Sep 8 18:05:57 lilt postfix/smtpd[21673]: name_mask: resource
Sep 8 18:05:57 lilt postfix/smtpd[21673]: name_mask: software
Sep 8 18:05:57 lilt postfix/smtpd[21673]: xsasl_cyrus_server_create: SASL service=smtp, realm=(null)
Sep 8 18:05:57 lilt postfix/smtpd[21673]: name_mask: noanonymous
Sep 8 18:05:57 lilt postfix/smtpd[21673]: connect from mail-bw0-f216.google.com[209.85.218.216]
Sep 8 18:05:57 lilt postfix/smtpd[21673]: match_list_match: mail-bw0-f216.google.com: no match
Sep 8 18:05:57 lilt postfix/smtpd[21673]: match_list_match: 209.85.218.216: no match
Sep 8 18:05:57 lilt postfix/smtpd[21673]: match_list_match: mail-bw0-f216.google.com: no match
Sep 8 18:05:57 lilt postfix/smtpd[21673]: match_list_match: 209.85.218.216: no match
Sep 8 18:05:57 lilt postfix/smtpd[21673]: match_hostname: mail-bw0-f216.google.com ~? lilt.li
Sep 8 18:05:57 lilt postfix/smtpd[21673]: match_hostaddr: 209.85.218.216 ~? lilt.li
Sep 8 18:05:57 lilt postfix/smtpd[21673]: match_list_match: mail-bw0-f216.google.com: no match
Sep 8 18:05:57 lilt postfix/smtpd[21673]: match_list_match: 209.85.218.216: no match
Sep 8 18:05:57 lilt postfix/smtpd[21673]: match_hostname: mail-bw0-f216.google.com ~? 127.0.0.0/8
Sep 8 18:05:57 lilt postfix/smtpd[21673]: match_hostaddr: 209.85.218.216 ~? 127.0.0.0/8
Sep 8 18:05:57 lilt postfix/smtpd[21673]: match_list_match: mail-bw0-f216.google.com: no match
Sep 8 18:05:57 lilt postfix/smtpd[21673]: match_list_match: 209.85.218.216: no match
Sep 8 18:05:57 lilt postfix/smtpd[21673]: auto_clnt_open: connected to private/anvil
Sep 8 18:05:57 lilt postfix/smtpd[21673]: send attr request = connect
Sep 8 18:05:57 lilt postfix/smtpd[21673]: send attr ident = smtp:209.85.218.216
Sep 8 18:05:57 lilt postfix/smtpd[21673]: private/anvil: wanted attribute: status
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute name: status
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute value: 0
Sep 8 18:05:57 lilt postfix/smtpd[21673]: private/anvil: wanted attribute: count
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute name: count
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute value: 1
Sep 8 18:05:57 lilt postfix/smtpd[21673]: private/anvil: wanted attribute: rate
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute name: rate
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute value: 1
Sep 8 18:05:57 lilt postfix/smtpd[21673]: private/anvil: wanted attribute: (list terminator)
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute name: (end)
Sep 8 18:05:57 lilt postfix/smtpd[21673]: > mail-bw0-f216.google.com[209.85.218.216]: 220 mail.lilt.li ESMTP Postfix
Sep 8 18:05:57 lilt postfix/smtpd[21673]: < mail-bw0-f216.google.com[209.85.218.216]: EHLO mail-bw0-f216.google.com
Sep 8 18:05:57 lilt postfix/smtpd[21673]: > mail-bw0-f216.google.com[209.85.218.216]: 250-mail.lilt.li
Sep 8 18:05:57 lilt postfix/smtpd[21673]: > mail-bw0-f216.google.com[209.85.218.216]: 250-PIPELINING
Sep 8 18:05:57 lilt postfix/smtpd[21673]: > mail-bw0-f216.google.com[209.85.218.216]: 250-SIZE 10240000
Sep 8 18:05:57 lilt postfix/smtpd[21673]: > mail-bw0-f216.google.com[209.85.218.216]: 250-VRFY
Sep 8 18:05:57 lilt postfix/smtpd[21673]: > mail-bw0-f216.google.com[209.85.218.216]: 250-ETRN
Sep 8 18:05:57 lilt postfix/smtpd[21673]: > mail-bw0-f216.google.com[209.85.218.216]: 250-STARTTLS
Sep 8 18:05:57 lilt postfix/smtpd[21673]: > mail-bw0-f216.google.com[209.85.218.216]: 250-AUTH LOGIN PLAIN
Sep 8 18:05:57 lilt postfix/smtpd[21673]: match_list_match: mail-bw0-f216.google.com: no match
Sep 8 18:05:57 lilt postfix/smtpd[21673]: match_list_match: 209.85.218.216: no match
Sep 8 18:05:57 lilt postfix/smtpd[21673]: > mail-bw0-f216.google.com[209.85.218.216]: 250-AUTH=LOGIN PLAIN
Sep 8 18:05:57 lilt postfix/smtpd[21673]: > mail-bw0-f216.google.com[209.85.218.216]: 250-ENHANCEDSTATUSCODES
Sep 8 18:05:57 lilt postfix/smtpd[21673]: > mail-bw0-f216.google.com[209.85.218.216]: 250-8BITMIME
Sep 8 18:05:57 lilt postfix/smtpd[21673]: > mail-bw0-f216.google.com[209.85.218.216]: 250 DSN
Sep 8 18:05:57 lilt postfix/smtpd[21673]: < mail-bw0-f216.google.com[209.85.218.216]: MAIL FROM:<digimag -Chez- gmail.com>
Sep 8 18:05:57 lilt postfix/smtpd[21673]: extract_addr: input: <digimag -Chez- gmail.com>
Sep 8 18:05:57 lilt postfix/smtpd[21673]: smtpd_check_addr: addr=digimag -Chez- gmail.com
Sep 8 18:05:57 lilt postfix/smtpd[21673]: connect to subsystem private/rewrite
Sep 8 18:05:57 lilt postfix/smtpd[21673]: send attr request = rewrite
Sep 8 18:05:57 lilt postfix/smtpd[21673]: send attr rule = local
Sep 8 18:05:57 lilt postfix/smtpd[21673]: send attr address = digimag -Chez- gmail.com
Sep 8 18:05:57 lilt postfix/smtpd[21673]: private/rewrite socket: wanted attribute: flags
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute name: flags
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute value: 0
Sep 8 18:05:57 lilt postfix/smtpd[21673]: private/rewrite socket: wanted attribute: address
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute name: address
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute value: digimag -Chez- gmail.com
Sep 8 18:05:57 lilt postfix/smtpd[21673]: private/rewrite socket: wanted attribute: (list terminator)
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute name: (end)
Sep 8 18:05:57 lilt postfix/smtpd[21673]: rewrite_clnt: local: digimag -Chez- gmail.com -> digimag -Chez- gmail.com
Sep 8 18:05:57 lilt postfix/smtpd[21673]: send attr request = resolve
Sep 8 18:05:57 lilt postfix/smtpd[21673]: send attr sender =
Sep 8 18:05:57 lilt postfix/smtpd[21673]: send attr address = digimag -Chez- gmail.com
Sep 8 18:05:57 lilt postfix/smtpd[21673]: private/rewrite socket: wanted attribute: flags
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute name: flags
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute value: 0
Sep 8 18:05:57 lilt postfix/smtpd[21673]: private/rewrite socket: wanted attribute: transport
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute name: transport
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute value: smtp
Sep 8 18:05:57 lilt postfix/smtpd[21673]: private/rewrite socket: wanted attribute: nexthop
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute name: nexthop
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute value: gmail.com
Sep 8 18:05:57 lilt postfix/smtpd[21673]: private/rewrite socket: wanted attribute: recipient
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute name: recipient
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute value: digimag -Chez- gmail.com
Sep 8 18:05:57 lilt postfix/smtpd[21673]: private/rewrite socket: wanted attribute: flags
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute name: flags
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute value: 4096
Sep 8 18:05:57 lilt postfix/smtpd[21673]: private/rewrite socket: wanted attribute: (list terminator)
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute name: (end)
Sep 8 18:05:57 lilt postfix/smtpd[21673]: resolve_clnt: `' -> `digimag -Chez- gmail.com' -> transp=`smtp' host=`gmail.com' rcpt=`digimag -Chez- gmail.com' flags= class=default
Sep 8 18:05:57 lilt postfix/smtpd[21673]: ctable_locate: install entry key digimag -Chez- gmail.com
Sep 8 18:05:57 lilt postfix/smtpd[21673]: extract_addr: in: <digimag -Chez- gmail.com>, result: digimag -Chez- gmail.com
Sep 8 18:05:57 lilt postfix/smtpd[21673]: fsspace: .: block size 4096, blocks free 465624
Sep 8 18:05:57 lilt postfix/smtpd[21673]: smtpd_check_queue: blocks 4096 avail 465624 min_free 0 msg_size_limit 10240000
Sep 8 18:05:57 lilt postfix/smtpd[21673]: > mail-bw0-f216.google.com[209.85.218.216]: 250 2.1.0 Ok
Sep 8 18:05:57 lilt postfix/smtpd[21673]: < mail-bw0-f216.google.com[209.85.218.216]: RCPT TO:<alex -Chez- lilt.li>
Sep 8 18:05:57 lilt postfix/smtpd[21673]: extract_addr: input: <alex -Chez- lilt.li>
Sep 8 18:05:57 lilt postfix/smtpd[21673]: smtpd_check_addr: addr=alex -Chez- lilt.li
Sep 8 18:05:57 lilt postfix/smtpd[21673]: send attr request = rewrite
Sep 8 18:05:57 lilt postfix/smtpd[21673]: send attr rule = local
Sep 8 18:05:57 lilt postfix/smtpd[21673]: send attr address = alex -Chez- lilt.li
Sep 8 18:05:57 lilt postfix/smtpd[21673]: private/rewrite socket: wanted attribute: flags
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute name: flags
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute value: 0
Sep 8 18:05:57 lilt postfix/smtpd[21673]: private/rewrite socket: wanted attribute: address
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute name: address
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute value: alex -Chez- lilt.li
Sep 8 18:05:57 lilt postfix/smtpd[21673]: private/rewrite socket: wanted attribute: (list terminator)
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute name: (end)
Sep 8 18:05:57 lilt postfix/smtpd[21673]: rewrite_clnt: local: alex -Chez- lilt.li -> alex -Chez- lilt.li
Sep 8 18:05:57 lilt postfix/smtpd[21673]: send attr request = resolve
Sep 8 18:05:57 lilt postfix/smtpd[21673]: send attr sender =
Sep 8 18:05:57 lilt postfix/smtpd[21673]: send attr address = alex -Chez- lilt.li
Sep 8 18:05:57 lilt postfix/smtpd[21673]: private/rewrite socket: wanted attribute: flags
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute name: flags
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute value: 0
Sep 8 18:05:57 lilt postfix/smtpd[21673]: private/rewrite socket: wanted attribute: transport
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute name: transport
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute value: smtp
Sep 8 18:05:57 lilt postfix/smtpd[21673]: private/rewrite socket: wanted attribute: nexthop
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute name: nexthop
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute value: lilt.li
Sep 8 18:05:57 lilt postfix/smtpd[21673]: private/rewrite socket: wanted attribute: recipient
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute name: recipient
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute value: alex -Chez- lilt.li
Sep 8 18:05:57 lilt postfix/smtpd[21673]: private/rewrite socket: wanted attribute: flags
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute name: flags
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute value: 4096
Sep 8 18:05:57 lilt postfix/smtpd[21673]: private/rewrite socket: wanted attribute: (list terminator)
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute name: (end)
Sep 8 18:05:57 lilt postfix/smtpd[21673]: resolve_clnt: `' -> `alex -Chez- lilt.li' -> transp=`smtp' host=`lilt.li' rcpt=`alex -Chez- lilt.li' flags= class=default
Sep 8 18:05:57 lilt postfix/smtpd[21673]: ctable_locate: install entry key alex -Chez- lilt.li
Sep 8 18:05:57 lilt postfix/smtpd[21673]: extract_addr: in: <alex -Chez- lilt.li>, result: alex -Chez- lilt.li
Sep 8 18:05:57 lilt postfix/smtpd[21673]: send attr request = rewrite
Sep 8 18:05:57 lilt postfix/smtpd[21673]: send attr rule = local
Sep 8 18:05:57 lilt postfix/smtpd[21673]: send attr address = double-bounce
Sep 8 18:05:57 lilt postfix/smtpd[21673]: private/rewrite socket: wanted attribute: flags
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute name: flags
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute value: 0
Sep 8 18:05:57 lilt postfix/smtpd[21673]: private/rewrite socket: wanted attribute: address
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute name: address
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute value: double-bounce -Chez- mail.lilt.li
Sep 8 18:05:57 lilt postfix/smtpd[21673]: private/rewrite socket: wanted attribute: (list terminator)
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute name: (end)
Sep 8 18:05:57 lilt postfix/smtpd[21673]: rewrite_clnt: local: double-bounce -> double-bounce -Chez- mail.lilt.li
Sep 8 18:05:57 lilt postfix/smtpd[21673]: >>> START Recipient address RESTRICTIONS <<<
Sep 8 18:05:57 lilt postfix/smtpd[21673]: generic_checks: name=permit_sasl_authenticated
Sep 8 18:05:57 lilt postfix/smtpd[21673]: generic_checks: name=permit_sasl_authenticated status=0
Sep 8 18:05:57 lilt postfix/smtpd[21673]: generic_checks: name=permit_mynetworks
Sep 8 18:05:57 lilt postfix/smtpd[21673]: permit_mynetworks: mail-bw0-f216.google.com 209.85.218.216
Sep 8 18:05:57 lilt postfix/smtpd[21673]: match_hostname: mail-bw0-f216.google.com ~? 127.0.0.0/8
Sep 8 18:05:57 lilt postfix/smtpd[21673]: match_hostaddr: 209.85.218.216 ~? 127.0.0.0/8
Sep 8 18:05:57 lilt postfix/smtpd[21673]: match_list_match: mail-bw0-f216.google.com: no match
Sep 8 18:05:57 lilt postfix/smtpd[21673]: match_list_match: 209.85.218.216: no match
Sep 8 18:05:57 lilt postfix/smtpd[21673]: generic_checks: name=permit_mynetworks status=0
Sep 8 18:05:57 lilt postfix/smtpd[21673]: generic_checks: name=reject_unauth_destination
Sep 8 18:05:57 lilt postfix/smtpd[21673]: reject_unauth_destination: alex -Chez- lilt.li
Sep 8 18:05:57 lilt postfix/smtpd[21673]: permit_auth_destination: alex -Chez- lilt.li
Sep 8 18:05:57 lilt postfix/smtpd[21673]: ctable_locate: leave existing entry key alex -Chez- lilt.li
Sep 8 18:05:57 lilt postfix/smtpd[21673]: NOQUEUE: reject: RCPT from mail-bw0-f216.google.com[209.85.218.216]: 554 5.7.1 <alex -Chez- lilt.li>: Relay access denied; from=<digimag -Chez- gmail.com> to=<alex -Chez- lilt.li> proto=ESMTP helo=<mail-bw0-f216.google.com>
Sep 8 18:05:57 lilt postfix/smtpd[21673]: generic_checks: name=reject_unauth_destination status=2
Sep 8 18:05:57 lilt postfix/smtpd[21673]: > mail-bw0-f216.google.com[209.85.218.216]: 554 5.7.1 <alex -Chez- lilt.li>: Relay access denied
Sep 8 18:05:57 lilt postfix/smtpd[21673]: < mail-bw0-f216.google.com[209.85.218.216]: QUIT
Sep 8 18:05:57 lilt postfix/smtpd[21673]: > mail-bw0-f216.google.com[209.85.218.216]: 221 2.0.0 Bye
Sep 8 18:05:57 lilt postfix/smtpd[21673]: match_hostname: mail-bw0-f216.google.com ~? 127.0.0.0/8
Sep 8 18:05:57 lilt postfix/smtpd[21673]: match_hostaddr: 209.85.218.216 ~? 127.0.0.0/8
Sep 8 18:05:57 lilt postfix/smtpd[21673]: match_list_match: mail-bw0-f216.google.com: no match
Sep 8 18:05:57 lilt postfix/smtpd[21673]: match_list_match: 209.85.218.216: no match
Sep 8 18:05:57 lilt postfix/smtpd[21673]: send attr request = disconnect
Sep 8 18:05:57 lilt postfix/smtpd[21673]: send attr ident = smtp:209.85.218.216
Sep 8 18:05:57 lilt postfix/smtpd[21673]: private/anvil: wanted attribute: status
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute name: status
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute value: 0
Sep 8 18:05:57 lilt postfix/smtpd[21673]: private/anvil: wanted attribute: (list terminator)
Sep 8 18:05:57 lilt postfix/smtpd[21673]: input attribute name: (end)
Sep 8 18:05:57 lilt postfix/smtpd[21673]: disconnect from mail-bw0-f216.google.com[209.85.218.216]
Sep 8 18:05:57 lilt postfix/smtpd[21673]: master_notify: status 1
Sep 8 18:05:57 lilt postfix/smtpd[21673]: connection closed
Sep 8 18:06:02 lilt postfix/smtpd[21673]: auto_clnt_close: disconnect private/tlsmgr stream
Sep 8 18:06:02 lilt postfix/smtpd[21673]: rewrite stream disconnect


Je ne comprends pas ce qui se passe. Pourriez-vous m'éclairer, quels paramètres font que le courrier est rejeté ?

En vous remerciant d'avance,

Alex.
_________________
Sacha


Last edited by digimag on Wed Sep 09, 2009 12:43 pm; edited 2 times in total
Back to top
View user's profile Send private message
guilc
Bodhisattva
Bodhisattva


Joined: 15 Nov 2003
Posts: 3326
Location: Paris - France

PostPosted: Tue Sep 08, 2009 4:25 pm    Post subject: Reply with quote

Ca veut dire que postfix ne se considère pas comme le nœud terminal pour le domaine litl.li. Donc il considère qu'il doit relayer. Mais il n'a pas le droit de relayer. Donc mail rejeté.

Que donne "postconf mydestination virtual_mailbox_domains" ?
_________________
Merci de respecter les règles du forum.

Mon site perso : https://www.xwing.info
Mon PORTDIR_OVERLAY : https://gentoo.xwing.info ou layman -a xwing
Back to top
View user's profile Send private message
digimag
Guru
Guru


Joined: 14 May 2005
Posts: 451
Location: Toulouse, France

PostPosted: Tue Sep 08, 2009 4:48 pm    Post subject: Reply with quote

guilc wrote:
Ca veut dire que postfix ne se considère pas comme le nœud terminal pour le domaine litl.li. Donc il considère qu'il doit relayer. Mais il n'a pas le droit de relayer. Donc mail rejeté.

Que donne "postconf mydestination virtual_mailbox_domains" ?
Code:
# postconf mydestination virtual_mailbox_domains
mydestination = $myhostname, localhost
virtual_mailbox_domains = $virtual_mailbox_maps


Pourtant le domaine lilt.li est bien présent dans mes tables MySQL. La preuve, SMTP AUTH fonctionne pour envoyer du courrier et j'arrive très bien à m'y connecter en IMAP.

Code:
mysql> SELECT * FROM users WHERE email="alex -Chez- lilt.li";
+----+--------------+--------+------+------+------+--------------+-----------------------------------+-------+---------+
| id | email        | clear  | name | uid  | gid  | homedir      | maildir                           | quota | postfix |
+----+--------------+--------+------+------+------+--------------+-----------------------------------+-------+---------+
|  2 | alex -Chez- lilt.li | XXXXXX | Alex | 1003 | 1006 | /home/vmail/ | /home/vmail/lilt.li/alex/Maildir/ |       | y       |
+----+--------------+--------+------+------+------+--------------+-----------------------------------+-------+---------+
1 row in set (0.00 sec)

Code:
mysql> SELECT * FROM transport;
+----+-------------------+-------------+
| id | domain            | destination |
+----+-------------------+-------------+
|  1 | xn--phnix-csa.net | local:      |
|  2 | lilt.li           | virtual:    |
+----+-------------------+-------------+
2 rows in set (0.01 sec)

_________________
Sacha


Last edited by digimag on Wed Sep 09, 2009 12:43 pm; edited 1 time in total
Back to top
View user's profile Send private message
guilc
Bodhisattva
Bodhisattva


Joined: 15 Nov 2003
Posts: 3326
Location: Paris - France

PostPosted: Tue Sep 08, 2009 7:27 pm    Post subject: Reply with quote

Bah dans ce cas, c'est ton virtual_mailbox_domains qui est mal configuré.

Il devrait ressembler à "virtual_mailbox_domains = mysql:/etc/postfix/nom_fichier" ou quelque chose dans le genre, et le "nom_fichier" contenant le nécessaire pour faire la requête dans ta base (select domain from transport where domain='%s';)


Et "postconf virtual_mailbox_maps" ??
_________________
Merci de respecter les règles du forum.

Mon site perso : https://www.xwing.info
Mon PORTDIR_OVERLAY : https://gentoo.xwing.info ou layman -a xwing
Back to top
View user's profile Send private message
digimag
Guru
Guru


Joined: 14 May 2005
Posts: 451
Location: Toulouse, France

PostPosted: Tue Sep 08, 2009 8:52 pm    Post subject: Reply with quote

Code:
# postconf virtual_mailbox_maps
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-maps.cf

Code:
# cat /etc/postfix/mysql-virtual-maps.cf
user            = mailsql
password        = CACHÉ
dbname          = mailsql
table           = users
select_field    = maildir
where_field     = email
additional_conditions = and postfix = 'y'
hosts           = unix:/var/run/mysqld/mysqld.sock


Ce qui est bizarre, c'est que dans le doc le fichier mysql-transport.cf est créé mais n'est mentionné nulle part dans la conf postfix.
_________________
Sacha
Back to top
View user's profile Send private message
guilc
Bodhisattva
Bodhisattva


Joined: 15 Nov 2003
Posts: 3326
Location: Paris - France

PostPosted: Wed Sep 09, 2009 6:40 am    Post subject: Reply with quote

Ca pourrait presque marcher.
Mais le problème c'est que virtual_mailbox_domains fait une recherche sur un domaine alors que là, ta recherche porte sur une adresse mail.

L'enjeu de virtual_mailbox_domains est de retourner quelque chose (quoi on s'en tape un peu, le résultat n'est pas utilisé) lorsqu'on cherche le domaine.

Donc je te suggère ceci :
Code:
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-domains.cf

Code:
# cat /etc/postfix/mysql-virtual-domains.cf
user            = mailsql
password        = CACHÉ
dbname          = mailsql
table           = transport
select_field    = domain
where_field     = domain
hosts           = unix:/var/run/mysqld/mysqld.sock


Cela devrait fonctionner !



Quant à ton mysql-transport.cf, il doit sans doute servir pour la variable virtual_transport. Je ne connais pas ta conf, mais je suppose qu'il doit servir à sélectionner le transport de livraison du mail de manière dynamique ;)
_________________
Merci de respecter les règles du forum.

Mon site perso : https://www.xwing.info
Mon PORTDIR_OVERLAY : https://gentoo.xwing.info ou layman -a xwing
Back to top
View user's profile Send private message
digimag
Guru
Guru


Joined: 14 May 2005
Posts: 451
Location: Toulouse, France

PostPosted: Wed Sep 09, 2009 11:10 am    Post subject: Reply with quote

guilc, merci, t'es le meilleur je t'aime ! :D

J'ai créé le fichier /etc/postfix/mysql-domains.cfavec
Code:
user            = mailsql
password        = CACHÉ
dbname          = mailsql
table           = transport
select_field    = domain
where_field     = domain
hosts           = unix:/var/run/mysqld/mysqld.sock
Et dans /etc/postfix/main.cf j'ai rajouté :
Code:
virtual_mailbox_domains = mysql:/etc/postfix/mysql-domains.cf
Et je suis très heureux, ça fonctionne enfin.

P.S. Dans la doc il y a un passage concernant le contenu de main.cf pas très clair :
Quote:
virtual_transport = virtual
(Les domaines listés par les mydestination ne doivent pas être listés
dans les paramètres virtual_mailbox_domains)

virtual_mailbox_domains = virt-domain.com, $other-virtual-domain.com
Ne sachant pas quoi mettre, j'ai rien mis dedans, je pensais que ça devait être automatique avec MySQL. Maintenant, ça l'est.

Toute à l'heure j'ai voulu soumettre l'idée aux auteurs, Ken Nowack et Ezra Gorman, mais leurs adresses mail sont invalides.
_________________
Sacha
Back to top
View user's profile Send private message
guilc
Bodhisattva
Bodhisattva


Joined: 15 Nov 2003
Posts: 3326
Location: Paris - France

PostPosted: Wed Sep 09, 2009 12:11 pm    Post subject: Reply with quote

Oui il faut bien le spécifier. La valeur par défaut n'est pas correcte dans ton cas.

Tel que suggéré dans ta doc, il faut rentrer la liste des domaines à la mano.
Tu peux aussi utiliser une liste des domaines dans un fichier (virtual_mailbox_domains = /etc/postfix/domains.cf, un domaine par ligne)
Tu peux aussi utiliser une table de hash (virtual_mailbox_domains = hash:/etc/postfix/domains.cf)

Mais c'est clair que si comme toi tu as tout dans mysql, autant l'utiliser pour ça aussi, ça évite de copier la liste des domaines à plusieurs endroits ;)
_________________
Merci de respecter les règles du forum.

Mon site perso : https://www.xwing.info
Mon PORTDIR_OVERLAY : https://gentoo.xwing.info ou layman -a xwing
Back to top
View user's profile Send private message
man in the hill
Veteran
Veteran


Joined: 15 Dec 2005
Posts: 1552
Location: Madinina

PostPosted: Tue Nov 03, 2009 10:48 pm    Post subject: Reply with quote

digimag wrote:
Ce qui est bizarre, c'est que dans le doc le fichier mysql-transport.cf est créé mais n'est mentionné nulle part dans la conf postfix.


Cest vrai que la partie conf de postfix avec les tables est un peu space dans la doc ! Si tu veux utiliser la table transport, il faut rajouter:
Code:

transport_maps = mysql:/etc/postfix/mysql-transport.cf
virtual_transport = $transport_maps


Merci guilc et digimag car ce topic m'a aidé !

@ +
_________________
Get Up and Go !
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index French All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum