4 Replies Latest reply on Nov 6, 2011 6:03 AM by plarts

    CFPOP and the FROM variable

    plarts Level 1

      I use CFPOP too read mails,

      And I want to do different processing following the email adress found in the

      FROM variable.


      But, depending of the Mail agent sending mails,

      The FROM variable contains different types of values :

      1 - can be the Email (alone)

      2 - can be the name of the person, without any email

      3 - can be the name of the person followed by the email

      4 - can be the name of the person followed by an email of the mail server.


      As I need to find the Email of the sender, only in cases 1 and 3 can give me the right email.


      Can someone explain this ?

      I do not see anything in CF to solve this, even in programming or in the CF administrator.


      I have the impression that , what is retruned in the "FROM" depends of the mail server ?


      Thanks for any help, explanation on that subject,


        • 1. Re: CFPOP and the FROM variable
          Dan Bracuk Level 5

          What happens if you use the header variable instead of the from?

          • 2. Re: CFPOP and the FROM variable
            plarts Level 1

            Thanks for your suggestion,

            the header variable does not give the Email adress of the sender,

            it gives the same : the person name.


            here is the result of that variable :

            Received: from [] by email.images-creations.fr [] with SmartMax MailMax for track@stw.fr; Tue, 18 Oct 2011 16:56:29 +0200 Return-Path: X-SmartMax-AuthUser: Received: from mx1-1.images-creations.fr (localhost []) by mx1-1-relay.images-creations.fr (Postfix) with ESMTP id 76EC432E0D9 for ; Tue, 18 Oct 2011 16:56:26 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mx1-1.images-creations.fr X-Spam-Level: ***** X-Spam-Status: No, score=6.0 required=8.0 tests=BAYES_50,HTML_MESSAGE, LIMSI_S36,RCVD_IN_NJABL_PROXY,TVD_SPACE_RATIO autolearn=no version=3.2.5 Received: from smtp.smtpout.orange.fr (smtp12.smtpout.orange.fr []) by mx1-1.images-creations.fr (Postfix) with ESMTP id 63CFE32E0D5 for ; Tue, 18 Oct 2011 16:56:26 +0200 (CEST) Received: from StationDev ([]) by mwinf5d47 with ME id mEwR1h00J0qnSTU03EwRkh; Tue, 18 Oct 2011 16:56:26 +0200 X-ME-engine: default From: "Pierre LARDE" To: Subject: 13744 Date: Tue, 18 Oct 2011 16:56:24 +0200 Message-ID: <000501cc8da6$1b58e540$520aafc0$@fr> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0006_01CC8DB6.DEE1B540" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcyNpfyCtDyvnB33RuaPaOwckewWUg== Content-Language: fr


            the From is there also the name , not an Email.


            Thanks for any other suggestion,


            • 3. Re: CFPOP and the FROM variable
              plarts Level 1

              I found another variable : "replyto"


              I tried it,

              but it gives the same content as the "from" variable

              so, no use.


              And I get the name of the sender, not the Email.

              example : "Ricken Patel - Avaaz.org"  , this is what is returned in "from" or "replyto"

              This is not an Email adress, so I cannot answer via a cfmail.

              • 4. Re: CFPOP and the FROM variable
                plarts Level 1

                Solution is there :

                The email adress is present in the "from" variable inside brakets < >

                So it is not displayed.

                With a cfdump, it can be seen.

                Male a findnocase of "<" , if found, Email is inside < >.

                Then just make a string extraction of the email inside the brakets, if brakets exist.


                Ans the valid Email is there.