Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Résolu] [Postfix] unable to lookup localhost
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
Shadow AOK
n00b
n00b


Joined: 26 Jun 2006
Posts: 48
Location: Lyon, France

PostPosted: Tue Jul 17, 2007 8:23 am    Post subject: [Résolu] [Postfix] unable to lookup localhost Reply with quote

Bonjour,

J'obtiens ce message relativement énervant lorsque j'envoie un email depuis la ligne de commande ou qu'un autre processus (cron par exemple) tente de le faire :
postfix : unable to lookup localhost

Pourtant, j'ai bien localhost ainsi que le hostname de ma machine dans /etc/hosts sur 127.0.0.1 et les deux répondent parfaitement au ping.

Code:
<root@linux.domaine.tld> (expanded from <root>): unable to look up host
    localhost: No address associated with hostname

Reporting-MTA: dns; linux.domaine.tld
X-Postfix-Queue-ID: AF12988073
X-Postfix-Sender: rfc822; webmaster@domaine.tld
Arrival-Date: Tue, 17 Jul 2007 10:19:21 +0200 (CEST)

Final-Recipient: rfc822; root@linux.domaine.tld
Original-Recipient: rfc822; root
Action: failed
Status: 5.4.4
Diagnostic-Code: X-Postfix; unable to look up host localhost: No address
    associated with hostname

Received: by linux.domaine.tld (Postfix, from userid 0)
   id AF12988073; Tue, 17 Jul 2007 10:19:21 +0200 (CEST)
To: root@linux.domaine.tld
Subject: test
Message-Id: <20070717081921.AF12988073@linux.domaine.tld>
Date: Tue, 17 Jul 2007 10:19:21 +0200 (CEST)
From: webmaster@domaine.tld (root)


root renvoie vers le compte webmaster dans les alias.
le hostname est un FQDN valide : linux.domaine.tld.

Voici mon /etc/hosts :
127.0.0.1 localhost linux.domaine.tld linux localhost.domaine.tld

Et le $mydestination de postfix :
mydestination = $myhostname, localhost.$mydomain, localhost, linux, localdomain.localhost

A noter qu'avec recipient_canonical, je fais du rewrite, pour les utilisateurs dont le compte mail arrive sur ce serveur, sous cette forme :
adresse@domaine.tld -> adresse@linux.domaine.tld

Une idée ?
C'est assez casse-pied comme problème.


Last edited by Shadow AOK on Fri Jul 27, 2007 9:16 am; edited 3 times in total
Back to top
View user's profile Send private message
titoucha
Advocate
Advocate


Joined: 21 Jul 2005
Posts: 2374
Location: Genève

PostPosted: Tue Jul 17, 2007 8:26 am    Post subject: Reply with quote

Il faudrait que tu mettes ton titre en conformité avec les conventions du forum, cf ma signature.
_________________
Assurez-vous que le titre de votre message soit conforme aux conventions de ce forum (paragraphe 3/3 : Comment poster sur le forum ??)
Back to top
View user's profile Send private message
Shadow AOK
n00b
n00b


Joined: 26 Jun 2006
Posts: 48
Location: Lyon, France

PostPosted: Tue Jul 17, 2007 8:29 am    Post subject: Reply with quote

C'est fait :)
Back to top
View user's profile Send private message
Uggy
n00b
n00b


Joined: 27 Jan 2006
Posts: 56

PostPosted: Fri Jul 20, 2007 2:32 pm    Post subject: Reply with quote

"postconf -n" ?
Les logs ?
Back to top
View user's profile Send private message
Shadow AOK
n00b
n00b


Joined: 26 Jun 2006
Posts: 48
Location: Lyon, France

PostPosted: Mon Jul 23, 2007 6:30 am    Post subject: Reply with quote

# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
content_filter = smtp-amavis:[localhost]:10026
daemon_directory = /usr/lib/postfix
debug_peer_level = 2
default_destination_concurrency_limit = 20
home_mailbox = .maildir/
html_directory = /usr/share/doc/postfix-2.2.10/html
local_destination_concurrency_limit = 20
local_recipient_maps =
mail_owner = postfix
mailbox_command = /usr/bin/procmail
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
message_size_limit = 8388608
mydestination = $myhostname, localhost.$mydomain, localhost, linux, localdomain.localhost
mydomain = domaine.tld
myhostname = linux.domaine.tld
mynetworks = 127.0.0.0/8, 192.168.1.0/24
mynetworks_style = subnet
myorigin = $myhostname
newaliases_path = /usr/bin/newaliases
notify_classes = bounce, delay, policy, protocol, resource, software
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.2.10/readme
recipient_canonical_maps = hash:/etc/postfix/recipient_canonical
relay_domains =
relayhost = smtp.fai.tld
sample_directory = /etc/postfix
sender_canonical_maps = hash:/etc/postfix/sender_canonical
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
soft_bounce = no
unknown_local_recipient_reject_code = 550

Et voici les logs :
Jul 23 08:29:20 linux postfix/qmgr[8343]: 1C47188064: from=<>, size=2303, nrcpt=1 (queue active)
Jul 23 08:29:20 linux postfix/bounce[25806]: F30FD88063: sender non-delivery notification: 1C47188064
Jul 23 08:29:20 linux postfix/cleanup[25803]: 1E6BB8807D: message-id=<20070723062920.1E6BB8807D@linux.domaine.tld>
Jul 23 08:29:20 linux postfix/qmgr[8343]: 1E6BB8807D: from=<double-bounce@linux.domaine.tld>, size=1923, nrcpt=1 (queue active)
Jul 23 08:29:20 linux postfix/bounce[25806]: F30FD88063: postmaster non-delivery notification: 1E6BB8807D
Jul 23 08:29:20 linux postfix/qmgr[8343]: F30FD88063: removed
Jul 23 08:29:20 linux postfix/local[25808]: 1E6BB8807D: to=<webmaster@linux.domaine.tld>, orig_to=<postmaster>, relay=local, delay=0.15, delays=0.01/0.05/0/0.09, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail)
Jul 23 08:29:20 linux postfix/qmgr[8343]: 1E6BB8807D: removed
Jul 23 08:29:20 linux postfix/local[25807]: 1C47188064: to=<webmaster@linux.domaine.tld>, orig_to=<root@linux.domaine.tld>, relay=local, delay=0.16, delays=0/0.07/0/0.09, dsn=2.0.0, status=sent (delivered to command: /usr/bin/procmail)
Jul 23 08:29:20 linux postfix/qmgr[8343]: 1C47188064: removed

A noter que ce serveur n'est pas un serveur MX, il récupère les emails via fetchmail et les envoie via le SMTP du fai.
Back to top
View user's profile Send private message
F!nTcH
Tux's lil' helper
Tux's lil' helper


Joined: 15 Jul 2007
Posts: 149

PostPosted: Mon Jul 23, 2007 11:57 am    Post subject: Reply with quote

Essaye de mettre cette ligne en remplacement dans ton /etc/hosts
Code:

127.0.0.1 localhost.localdomain localhost


Mets l'autre ligne en commentaire, comme ça si ça résoud pas, tu peux revert facilement ;)
Back to top
View user's profile Send private message
Shadow AOK
n00b
n00b


Joined: 26 Jun 2006
Posts: 48
Location: Lyon, France

PostPosted: Tue Jul 24, 2007 6:05 am    Post subject: Reply with quote

Le problème reste le même :) (je n'ai pas rebooté ceci dit)

J'ai activé (plus moyen de retrouver dans quel fichier c'était) le MultiLine où je ne sais plus quelle option qui permet de prendre en compte toutes les entrées du /etc/hosts lorsqu'il y en a plusieurs pour une seule ip, mais ça n'a pas arrangé les choses.
Back to top
View user's profile Send private message
F!nTcH
Tux's lil' helper
Tux's lil' helper


Joined: 15 Jul 2007
Posts: 149

PostPosted: Tue Jul 24, 2007 12:13 pm    Post subject: Reply with quote

Hum curieux ... enfin au moins t'auras essayé ;)

J'ai pensé à ça par rapport à la résolution de nom qui est faite sur 127.0.0.1 et sur cette ligne du postconf :
Code:

mydestination = $myhostname, localhost.$mydomain, localhost, linux, localdomain.localhost


Et ce malgré :
Code:

mydomain = domaine.tld
myhostname = linux.domaine.tld
Back to top
View user's profile Send private message
Shadow AOK
n00b
n00b


Joined: 26 Jun 2006
Posts: 48
Location: Lyon, France

PostPosted: Tue Jul 24, 2007 12:22 pm    Post subject: Reply with quote

Ce n'est pas un problème très ennuyeux, mais à chaque fois que le serveur m'envoie un mail, ça rajoute une erreur :)
Et pourtant il est à jour.
Back to top
View user's profile Send private message
Uggy
n00b
n00b


Joined: 27 Jan 2006
Posts: 56

PostPosted: Thu Jul 26, 2007 10:36 pm    Post subject: Reply with quote

Très étrange que le message "unable to look up host localhost: No address associated with hostname" n'apparaisse pas dans les logs Postfix que tu as posté... il y avait rien avant tes lignes ??
Back to top
View user's profile Send private message
Uggy
n00b
n00b


Joined: 27 Jan 2006
Posts: 56

PostPosted: Thu Jul 26, 2007 10:43 pm    Post subject: Reply with quote

Ton Postfix serait pas chrooté par hasard ?
Back to top
View user's profile Send private message
Shadow AOK
n00b
n00b


Joined: 26 Jun 2006
Posts: 48
Location: Lyon, France

PostPosted: Fri Jul 27, 2007 6:30 am    Post subject: Reply with quote

Non, postfix n'est pas chrooté :)

Voici les logs :
Code:
Jul 27 08:28:18 linux postfix/pickup[16345]: A3818880B4: uid=0 from=<root>
Jul 27 08:28:18 linux postfix/cleanup[18538]: A3818880B4: message-id=<20070727062818.A3818880B4@linux.domaine.tld>
Jul 27 08:28:18 linux postfix/qmgr[6219]: A3818880B4: from=<root@linux.domaine.tld>, size=321, nrcpt=1 (queue active)
Jul 27 08:28:18 linux postfix/smtp[18540]: A3818880B4: to=<webmaster@linux.domaine.tld>, orig_to=<webmaster>, relay=none, delay=0.11, delays=0.08/0.02/0/0, dsn=5.4.4, status=bounced (unable to look up ho
st localhost: No address associated with hostname)
Jul 27 08:28:18 linux postfix/cleanup[18538]: C2BE0880B5: message-id=<20070727062818.C2BE0880B5@linux.domaine.tld>
Jul 27 08:28:18 linux postfix/bounce[18541]: A3818880B4: sender non-delivery notification: C2BE0880B5
Jul 27 08:28:18 linux postfix/cleanup[18538]: C5AC0880B6: message-id=<20070727062818.C5AC0880B6@linux.domaine.tld>
Jul 27 08:28:18 linux postfix/bounce[18541]: A3818880B4: postmaster non-delivery notification: C5AC0880B6
Jul 27 08:28:18 linux postfix/qmgr[6219]: A3818880B4: removed
Jul 27 08:28:18 linux postfix/qmgr[6219]: C2BE0880B5: from=<>, size=2271, nrcpt=1 (queue active)
Jul 27 08:28:18 linux postfix/qmgr[6219]: C5AC0880B6: from=<double-bounce@linux.domaine.tld>, size=1891, nrcpt=1 (queue active)
Jul 27 08:28:18 linux postfix/local[18542]: C2BE0880B5: to=<webmaster@linux.domaine.tld>, orig_to=<root@linux.domaine.tld>, relay=local, delay=0.08, delays=0.02/0.01/0/0.06, dsn=2.0.0, status=sent (d
elivered to command: /usr/bin/procmail)
Jul 27 08:28:18 linux postfix/qmgr[6219]: C2BE0880B5: removed
Jul 27 08:28:18 linux postfix/local[18543]: C5AC0880B6: to=<webmaster@linux.domaine.tld>, orig_to=<postmaster>, relay=local, delay=0.08, delays=0.02/0.01/0/0.05, dsn=2.0.0, status=sent (delivered to comm
and: /usr/bin/procmail)
Jul 27 08:28:18 linux postfix/qmgr[6219]: C5AC0880B6: removed


D'ailleurs, j'aurais apparamment un message endommagé, mais il n'apparait pas dans la queue, il serait donc délivré ?
Jul 27 08:25:34 linux postfix/postfix-script: warning: damaged message: corrupt/9936E880B0
Back to top
View user's profile Send private message
ultrabug
Developer
Developer


Joined: 24 Jan 2005
Posts: 698
Location: Paris

PostPosted: Fri Jul 27, 2007 8:39 am    Post subject: Reply with quote

Shadow AOK wrote:
Non, postfix n'est pas chrooté :)

Voici les logs :
Code:
Jul 27 08:28:18 linux postfix/pickup[16345]: A3818880B4: uid=0 from=<root>
Jul 27 08:28:18 linux postfix/cleanup[18538]: A3818880B4: message-id=<20070727062818.A3818880B4@linux.domaine.tld>
Jul 27 08:28:18 linux postfix/qmgr[6219]: A3818880B4: from=<root@linux.domaine.tld>, size=321, nrcpt=1 (queue active)
Jul 27 08:28:18 linux postfix/smtp[18540]: A3818880B4: to=<webmaster@linux.domaine.tld>, orig_to=<webmaster>, relay=none, delay=0.11, delays=0.08/0.02/0/0, dsn=5.4.4, status=bounced (unable to look up ho
st localhost: No address associated with hostname)
Jul 27 08:28:18 linux postfix/cleanup[18538]: C2BE0880B5: message-id=<20070727062818.C2BE0880B5@linux.domaine.tld>
Jul 27 08:28:18 linux postfix/bounce[18541]: A3818880B4: sender non-delivery notification: C2BE0880B5
Jul 27 08:28:18 linux postfix/cleanup[18538]: C5AC0880B6: message-id=<20070727062818.C5AC0880B6@linux.domaine.tld>
Jul 27 08:28:18 linux postfix/bounce[18541]: A3818880B4: postmaster non-delivery notification: C5AC0880B6
Jul 27 08:28:18 linux postfix/qmgr[6219]: A3818880B4: removed
Jul 27 08:28:18 linux postfix/qmgr[6219]: C2BE0880B5: from=<>, size=2271, nrcpt=1 (queue active)
Jul 27 08:28:18 linux postfix/qmgr[6219]: C5AC0880B6: from=<double-bounce@linux.domaine.tld>, size=1891, nrcpt=1 (queue active)
Jul 27 08:28:18 linux postfix/local[18542]: C2BE0880B5: to=<webmaster@linux.domaine.tld>, orig_to=<root@linux.domaine.tld>, relay=local, delay=0.08, delays=0.02/0.01/0/0.06, dsn=2.0.0, status=sent (d
elivered to command: /usr/bin/procmail)
Jul 27 08:28:18 linux postfix/qmgr[6219]: C2BE0880B5: removed
Jul 27 08:28:18 linux postfix/local[18543]: C5AC0880B6: to=<webmaster@linux.domaine.tld>, orig_to=<postmaster>, relay=local, delay=0.08, delays=0.02/0.01/0/0.05, dsn=2.0.0, status=sent (delivered to comm
and: /usr/bin/procmail)
Jul 27 08:28:18 linux postfix/qmgr[6219]: C5AC0880B6: removed


D'ailleurs, j'aurais apparamment un message endommagé, mais il n'apparait pas dans la queue, il serait donc délivré ?
Jul 27 08:25:34 linux postfix/postfix-script: warning: damaged message: corrupt/9936E880B0



Salut :)

Es-tu sûr de ta config antivirus via le content filter ?
Code:
content_filter = smtp-amavis:[localhost]:10026


Deja, je serais toi, j'enleverais ça pour mieux segmenter les sources d'erreur.

Pour ton message corrompu, non il n'a pas été routé. Il est dans /var/spool/postfix/corrupt

Bon courage
Back to top
View user's profile Send private message
Shadow AOK
n00b
n00b


Joined: 26 Jun 2006
Posts: 48
Location: Lyon, France

PostPosted: Fri Jul 27, 2007 8:48 am    Post subject: Reply with quote

Rofl, sans le content filter ça marche.

Mais normalement la configuration est bonne, cela pointe sur amavis qui est installé sur la même machine.
Ceci dit, le pointage est fait dans le master.cf donc je ne dois pas avoir besoin de renseigner cette variable.

Merci pour ton aide :) (et aux autres également)
Back to top
View user's profile Send private message
ultrabug
Developer
Developer


Joined: 24 Jan 2005
Posts: 698
Location: Paris

PostPosted: Fri Jul 27, 2007 8:52 am    Post subject: Reply with quote

Shadow AOK wrote:
Rofl, sans le content filter ça marche.

Mais normalement la configuration est bonne, cela pointe sur amavis qui est installé sur la même machine.
Ceci dit, le pointage est fait dans le master.cf donc je ne dois pas avoir besoin de renseigner cette variable.

Merci pour ton aide :) (et aux autres également)


Je t'en prie, pour qu'il marche tu n'as qu'a mettre ceci :

Code:
content_filter = smtp-amavis:127.0.0.1:10026


Ce devrait marcher
Back to top
View user's profile Send private message
Shadow AOK
n00b
n00b


Joined: 26 Jun 2006
Posts: 48
Location: Lyon, France

PostPosted: Fri Jul 27, 2007 9:02 am    Post subject: Reply with quote

Même en 127.0.0.1 ça ne marche pas mais tout bien reconsidéré c'est normal, je ne dois pas renseigner l'option :)
Merci.
Back to top
View user's profile Send private message
ultrabug
Developer
Developer


Joined: 24 Jan 2005
Posts: 698
Location: Paris

PostPosted: Fri Jul 27, 2007 9:03 am    Post subject: Reply with quote

k

Un ptit (résolu) dans le topic plz ;)

Bonne journée
Back to top
View user's profile Send private message
Uggy
n00b
n00b


Joined: 27 Jan 2006
Posts: 56

PostPosted: Fri Jul 27, 2007 9:04 am    Post subject: Reply with quote

Je prefere les logs complets :)

Remplace
content_filter = smtp-amavis:[localhost]:10026
par
content_filter = smtp-amavis:[127.0.0.1]:10026
Back to top
View user's profile Send private message
Uggy
n00b
n00b


Joined: 27 Jan 2006
Posts: 56

PostPosted: Fri Jul 27, 2007 9:06 am    Post subject: Reply with quote

Arf je prend un café 5 minutes..et pan... 10 messages intermédiaires :)
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