par
Nico128 » 11 mai 2009, 16:12
Hello!
En php, je récupère les mail reçu de postmaster lorsqu'un envoi à échoué. Donc j'obtiens une variable avec ce texte par exemple :
Code : Tout sélectionner
Return-Path:
Received: from [url=http://www.phpfrance.com/hebergement/click.php?id=1]webmail.infomaniak.ch[/url] (mta-[url=http://www.phpfrance.com/hebergement/click.php?id=1]web2.infomaniak.ch[/url] [84.16.68.35])
(authenticated bits=0)
by [url=http://www.phpfrance.com/hebergement/click.php?id=1]smtp1.infomaniak.ch[/url] (8.14.2/8.14.2) with ESMTP id n4B7hegM007915
for ; Mon, 11 May 2009 09:43:40 +0200
Date: Mon, 11 May 2009 09:43:40 +0200
From: Gestion des notes
To: [email protected]
Subject: BOUUFUFFw
Message-ID: <[email protected]>
X-Mailer: [url=http://www.phpfrance.com/hebergement/click.php?id=1]Infomaniak[/url] Webmail
X-Origin-IP: 212.117.127.161
MIME-Version: 1.0
X-Priority: 3 (Normal)
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Antivirus: Dr.Web (R) for Mail Servers on smtp1 host
X-Antivirus-Code: 100000
Le but, c'est que j'arrive à récupérer l'adresse email invalide dans tout ce foullis (
[email protected]).
C'est avec des regex, j'ai essayé mais je ne suis arrivé à rien du tout.
Donc un peu d'aide me serait la bienvenue
Merci davance!
Edit : Finalement, j'ai trouvé ça :
/ [\w]+@.+\.[a-z]{2,6}/i
Mais je suis persuadé qu'il y a moyen de faire mieux. Car avec l'exemple que j'ai pris, cela marche. Mais il y a sûrement des exceptions avec lesquelles ça ne marchera plus ?
Hello!
En php, je récupère les mail reçu de postmaster lorsqu'un envoi à échoué. Donc j'obtiens une variable avec ce texte par exemple :
[code]Return-Path:
Received: from [url=http://www.phpfrance.com/hebergement/click.php?id=1]webmail.infomaniak.ch[/url] (mta-[url=http://www.phpfrance.com/hebergement/click.php?id=1]web2.infomaniak.ch[/url] [84.16.68.35])
(authenticated bits=0)
by [url=http://www.phpfrance.com/hebergement/click.php?id=1]smtp1.infomaniak.ch[/url] (8.14.2/8.14.2) with ESMTP id n4B7hegM007915
for ; Mon, 11 May 2009 09:43:40 +0200
Date: Mon, 11 May 2009 09:43:40 +0200
From: Gestion des notes
To:
[email protected]Subject: BOUUFUFFw
Message-ID: <
[email protected]>
X-Mailer: [url=http://www.phpfrance.com/hebergement/click.php?id=1]Infomaniak[/url] Webmail
X-Origin-IP: 212.117.127.161
MIME-Version: 1.0
X-Priority: 3 (Normal)
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Antivirus: Dr.Web (R) for Mail Servers on smtp1 host
X-Antivirus-Code: 100000[/code]
Le but, c'est que j'arrive à récupérer l'adresse email invalide dans tout ce foullis (
[email protected]).
C'est avec des regex, j'ai essayé mais je ne suis arrivé à rien du tout.
Donc un peu d'aide me serait la bienvenue :-D
Merci davance!
Edit : Finalement, j'ai trouvé ça :
[php]/ [\w]+@.+\.[a-z]{2,6}/i[/php]
Mais je suis persuadé qu'il y a moyen de faire mieux. Car avec l'exemple que j'ai pris, cela marche. Mais il y a sûrement des exceptions avec lesquelles ça ne marchera plus ?