LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Having problem with voting form double opt-in (https://www.linuxquestions.org/questions/programming-9/having-problem-with-voting-form-double-opt-in-939901/)

countrydj 04-15-2012 09:33 AM

Having problem with voting form double opt-in
 
Hi Guys...

I have written a script, in php and mysql, to record votes.
What the script does is to display a form, with about 20 fields, to vote for your choice in about 20 categories.
I have made only 3 fields compulsary; Name, Email and Country.
In order to avoid spam and duplication I have used a double opt-in system.
i.e. when the 'Vote Now' button is clicked the script sends an email to the voter and includes a link back to the script to register the vote. It also checks that the email has not previously voted.

I have a voter who says that she does not receive a verification email to return the vote. She also says that she has 3 friends who do not receive the verification email.

In order to check possible problems, I have sent an email direct from my computer which she received. I have also sent an email directly from the server command line which she received.
I thought a possibility was because of the long link so I sent an email direcly from the server and included the verification link. She received that also.

Her email address is: @hotmail.co.uk and a friend is: @hotmail.com.
I checked for hotmail email addresses in the database and other people have registered their votes with a hotmail email address. Therefore it is not hotmail that is blocking mail from a form.

I am now stumped as to why she cannot receive.

Can anybody think of any possible reason that I can check ???

Thanks,

Nominal Animal 04-15-2012 09:46 AM

A common problem is insufficient headers (no From: field), or discrepancy between the From: header and the envelope sender.

Send a message to yourself using the server commandline, then vote using the same e-mail address. (You can send them to me, if you want me to take a look.) The two messages should have identical header fields. Most e-mail clients don't show the header details, so be sure to switch on the detailed header view. Better yet, save the e-mails as text files, obscure any identifying fields, and post them here, and we can take a look.

countrydj 04-15-2012 10:44 AM

Hi NA...
Thanks for your prompt reply>
here is the email from the command line:
Quote:

Subject:
Test
From:
ukzone@redvelvet.gvl99.co.uk
Date:
Sun, 15 Apr 2012 16:31:32 +0100
To:
na@in-uk.co.uk
X-Account-Key:
account1
X-UIDL:
000249a33c615554
X-Mozilla-Status:
0001
X-Mozilla-Status2:
00080000
Return-Path:
<ukzone@redvelvet.gvl99.co.uk>
Received:
from redvelvet.gvl99.co.uk (localhost [127.0.0.1]) by redvelvet.gvl99.co.uk (8.14.4/8.14.4) with ESMTP id q3FFVWgQ012225 for <na@in-uk.co.uk>; Sun, 15 Apr 2012 16:31:32 +0100
Received:
(from root@localhost) by redvelvet.gvl99.co.uk (8.14.4/8.14.4/Submit) id q3FFVWuR012224 for na@in-uk.co.uk; Sun, 15 Apr 2012 16:31:32 +0100
Message-ID:
<201204151531.q3FFVWuR012224@redvelvet.gvl99.co.uk>
User-Agent:
Heirloom mailx 12.4 7/29/08
MIME-Version:
1.0
Content-Type:
text/plain; charset=us-ascii
Content-Transfer-Encoding:
7bit

Please DO NOT reply to this email. It is an unattended mailbox.

To validate your email address, please click the following link:

http://bcmawards.co.uk/vote/voting-f...fb1141d21543b7

---------------------------------------------------------------------------------------------------



Here is the email from the form:
Quote:

Subject:
BCMAwards 2012 Validation Email
From:
noreply@bcmawards.co.uk
Date:
Sun, 15 Apr 2012 16:25:53 +0100
To:
na@in-uk.co.uk
X-Account-Key:
account1
X-UIDL:
000249a23c615554
X-Mozilla-Status:
0001
X-Mozilla-Status2:
00080000
Return-Path:
<apache@redvelvet.gvl99.co.uk>
Received:
from redvelvet.gvl99.co.uk (localhost [127.0.0.1]) by redvelvet.gvl99.co.uk (8.14.4/8.14.4) with ESMTP id q3FFPrtf011948 for <na@in-uk.co.uk>; Sun, 15 Apr 2012 16:25:54 +0100
Received:
(from apache@localhost) by redvelvet.gvl99.co.uk (8.14.4/8.14.4/Submit) id q3FFPrRO011947; Sun, 15 Apr 2012 16:25:53 +0100
Message-ID:
<201204151525.q3FFPrRO011947@redvelvet.gvl99.co.uk>
X-PHP-Originating-Script:
504:voting-form.php

Please DO NOT reply to this email. It is an unattended mailbox.

To validate your email address, please click the following link:

http://bcmawards.co.uk/vote/voting-f...fb1141d21543b7


The main difference that I can see, in the headers of the voting form is:
Quote:

X-PHP-Originating-Script:
504:voting-form.php

hth

John C

Nominal Animal 04-15-2012 01:54 PM

The output is line-wrapped, so it'd be better if you could retry using the e-mail address I provided for you privately for this. It is OK if there are a couple of extra copies.

I suspect the problem is in the From: headers. Consider this in the e-mail sent by the form:
Code:

From: noreply@bcmawards.co.uk
Received: from redvelvet.gvl99.co.uk (localhost [127.0.0.1]) by redvelvet.gvl99.co.uk (8.14.4/8.14.4) with ESMTP id q3FFPrtf011948 for <recipient>; Sun, 15 Apr 2012 16:25:54 +0100
Received: (from apache@localhost) by redvelvet.gvl99.co.uk (8.14.4/8.14.4/Submit) id q3FFPrRO011947; Sun, 15 Apr 2012 16:25:53 +0100

In the command-line message, the From: header is
Code:

From: ukzone@redvelvet.gvl99.co.uk
If the From: header does not match the host (early) in the receive chain, most spam filters assume the message is spam. That is a common spoofing technique, after all. I suggest you check this by replacing the value your form supplies for the From: header to something@redvelvet.gvl99.co.uk .


All times are GMT -5. The time now is 06:18 AM.