I'm surprised to be the first to request this.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

basicmagic.net’s picture

subscribe

Stomper’s picture

This module seems like a very powerful if not a core-necessary module. I'd like to know the D7 plans.

andros’s picture

subscribe

earth1’s picture

Version: master » 6.x-1.2
Assigned: Unassigned » earth1
Category: task » bug
earth1’s picture

D7

designcrs’s picture

subscribing

andros’s picture

subscribing

theullrich’s picture

since there is yet to be a reply i am guessing not. But would like it still.

mgifford’s picture

Has anyone tried to run this through Coder? I can see this being very powerful, especially when tied to tools like the Webform module.

Murz’s picture

subscribing

majortom’s picture

Subscribing

skizzo’s picture

subscribing

oadaeh’s picture

Version: 6.x-1.2 » master
Assigned: earth1 » Unassigned
Category: bug » task

Reverting back to the correct values.

oadaeh’s picture

FileSize
8.33 KB

So this looked like it would be quick and easy enough to do, so I did. Unfortunately, it wasn't as quick as I anticipated, but that's the way it usually goes. I think I did my week's worth of #d5dChallenge with this one task.

Here are some things to keep in mind:

  • I do not use this module, so I may have incorrectly interpreted some level of functionality.
  • The attachment is a patch against the master or 6.x-1.x version.

Here's what I did:

  • Ran the module through Coder Upgrade.
  • Ran the module through Coder, with only the 'Converting 6.x modules to 7.x' and 'Drupal Security Checks' options selected, but set on 'minor (most)'. (There was very little picked up here.)
  • Fixed anything that wasn't caught after that. (There was a bit of work here.)
  • Tested the basic functionality to make sure it did what I thought it was supposed to do.

Here's what I did NOT do:

  • Fix any style guide inconsistencies that were not automatically corrected by Coder Upgrade.
  • Replace the PHP deprecated ereg() function w/something better. (I attempted it, but it quickly devolved into figuring out regular expressions, which I'm not good at, and therefore, it is time consuming for me.)

I will attempt to fix any bugs that are a result of this patch, as I have time for them, but I am not fixing bugs that were already reported.

As an aside, I might be willing to take on the maintainer (or co-maintainer) role of this module, as it is a small-ish module and a mail based module (I already maintain a number of mail based modules). However, since I don't use it, my time spent on this would be fairly small (but then I would fix already reported bugs). :^)

mgifford’s picture

I applied the patch, enabled the module & got this error "Email verify has tried contacting the mail host but did not receive a reply. Check with your hosting provider that the function fsockopen() is properly configured on your server, and that port 25 is open. The module has been disabled."

That may well be expected behavior. It's been a while.

oadaeh’s picture

That message is part of the installation routine of this module.

What the module is doing is, on the computer it is installed on, checking to see that fsockopen() works and that port 25 is open.

The background on this may be read here: #147883: fsockopen not open on port 25..

What the module is telling you is that either the fsockopen() function is not working or is not correctly configured, or that the computer it is installed on doesn't accept connections to port 25, the standard port for sending e-mail.

mgifford’s picture

Yes, it was installed on my localhost so that makes sense.

oadaeh’s picture

You could install either of the PHPMailer or SMTP Authentication Support modules locally, if you wanted to test this further.

mgifford’s picture

I ran this through Coder and there was just one error:

email_verify.install

Line 53: Potential problem: drupal_set_message() only accepts filtered text, be sure to use check_plain(), filter_xss() or similar to ensure your $variable is fully sanitized.
drupal_set_message($message, 'error');

Not actually critical as there is no user input, but still not a best practice.

I used this in another dev environment (with mail) and it seemed to work properly. Fake emails were correctly identified when creating a user account. Would help cut down on a bit of the spam coming into my D7 sites.

What do we need to do to get this out as a dev release?

NancyDru’s picture

That message is safe to ignore if you are sure there is no user input. Even the Coder folks admit that sometimes you have to ignore messages.

mgifford’s picture

Yup. Bunch of spacing issues that were pointed out too. Nothing that would stop the release of the module with the patch as far as I'm concerned, though a clean Coder review is always great.

NancyDru’s picture

We can leave that to dbr if he comes back.

oadaeh’s picture

@mgifford: I didn't do anything about that warning, because it doesn't really apply in this case. The message is created from a variable within the same function that is used in both a watchdog() and a drupal_set_message() call. Coder isn't really going beyond the function call itself, so it doesn't see that.

  if (!$connect) {
    $message = t('Email verify has tried contacting the mail host but did not receive a reply.'
      . ' Check with your hosting provider that the function fsockopen() is properly configured on your server,'
      . ' and that port 25 is open. The module has been disabled.');

    watchdog('email_verify', $message, WATCHDOG_ERROR);
    drupal_set_message($message, 'error');
    module_disable(array('email_verify'));
  }
mgifford’s picture

Yup. So when can we see an official release?

skizzo’s picture

Status: Active » Needs review

I applied patch #14 to 6.x-1.x-dev and "fixed" email_verify.info
When enabling and exercising the module I get the following recurrent errors (on PHP 5.3.8).

Deprecated function: Function ereg() is deprecated in email_verify_enable() 
(line 40 of /var/www/drupal/sites/all/modules/email_verify/email_verify.install)

After googling around, I simply replaced all occurrences of ereg with preg_match
The module seems to carry out the verification ok, but I don't know PHP, so I would like to have this checked by a knowledgeable Drupal user

mgifford’s picture

Can you let us know what version of PHP you're using and also include a revised patch with the preg_match?

NancyDru’s picture

I'm guessing that dbr, the maintainer is gone (I don't see any recent posts by him), so someone needs to ask for a takeover.

oadaeh’s picture

@mgifford & @skizzo: If you read my comment in #14 where I attached the patch, I addressed almost everything you two have mentioned. Your comments make me think you're not actually reading what I wrote.

mgifford’s picture

@oadaeh - You busted me! Sorry. I jumped to New & must not have scrolled up enough.

Though the patch still needs to be re-rolled with preg_match().

skizzo’s picture

@mgifford: I use PHP 5.3.8. I have no experience in PHP or even building patches. After reading #14 I just followed instructions as per http://docstore.mik.ua/orelly/webprog/pcook/ch13_02.htm . Changes go in email_verify.install and email_verify.inc.php

ereg('pattern', 'string');
becomes:
preg_match('/pattern/', 'string');

@oadaeh: if you are willing to maintain the module (even with no bug fixing) please do initiate the takeover procedure as suggested by NancyDru, so we can have a proper D7 branch. Thank you.

mgifford’s picture

Thanks @skizzo it's gotten actually easier to make & apply patches since the migration to Git. There's some documentation here http://drupal.org/node/707484 but also under the 'Version control' tab of every project.

I do really appreciate your willingness to document what you know & share it with others. Agreed too with comments about applying for maintainership.

kaizerking’s picture

Is this module working with this patch for D7?as of now?

kaizerking’s picture

I have applied the patch, I have the SMTP Authentication Support configured on my local host,test the module with in built test and is working, I still get the message and module is not installed

Notice: Undefined variable: connect in email_verify_enable() (line 47 of E:\wamp\www\sites\all\modules\email_verify\email_verify.install).
Email verify has tried contacting the mail host but did not receive a reply. Check with your hosting provider that the function fsockopen() is properly configured on your server, and that port 25 is open. The module has been disabled.

oadaeh’s picture

@kaizerking: it looks like I need to change line 47 from if (!$connect) { to if (empty($connect)) { (or something similar) to avoid that error. I would have to double check the return value of fsockopen, first.

I should probably also remove the check from the install partion of the module and move it to the settings, as that's where it makes more sense to have it.

Basically, it means the connection to your SMTP host failed.

As to why it's failing, I couldn't guess. It has something to do with your configuration and/or mail server.

kaizerking’s picture

is this working for any one here?
Please reply .
later to day i'll check on my live site

kaizerking’s picture

I have checked on my live site it this not working

kaizerking’s picture

any update plz?

attisan’s picture

FileSize
13.23 KB

as i can't understand why there is no such thing as email verification already built in into drupal7, i took the ported code, rewrote some parts and updated the core verification mechanism to a new one (works with regular replies, graylistings, A NAMEs ... if the need arises, this can be fine tuned)

    what already works:
  • verify emails entered at registration (on / off switch in admin/config)
  • verify emails entered on user edit (on / off switch in admin/config)
    what is yet to come:
  • windows support
  • editable error message
  • domain whitelist entries
  • retry counter and option to define events (perhpas a hook for rules) at specified count
  • graylisting options - if necessary

if its ok for dbr i could take over mainanence for the this module in drupal7.

greets,

attisan

mgifford’s picture

Good question on why it isn't in core. Would be a good thing to add the the issue queue for D8.

Having a patch against D6 is always useful.

kaizerking’s picture

@attisan, the last commit from dbr was !0th march 2010,it seems this module is abandoned
If you are interested to take over this module you please proceed with the procedure here:Dealing with unsupported (abandoned) projects

kaizerking’s picture

@attisan, i am getting this errors when enabling the module

Warning: include_once(/hsphere/local/home/......../......../sites/all/modules/email_verify/windows_compat.inc): failed to open stream: No such file or directory in email_verify_enable() (line 26 of /hsphere/local/home/......../......../sites/all/modules/email_verify/email_verify.install).
Warning: include_once(): Failed opening '/hsphere/local/home/......../......../sites/all/modules/email_verify/windows_compat.inc' for inclusion (include_path='.:/hsphere/shared/apache/libexec/php5ext/php/') in email_verify_enable() (line 26 of /hsphere/local/home/......../......../sites/all/modules/email_verify/email_verify.install).
Email verify has tried contacting the mail host but did not receive a reply. Check with your hosting provider that the function fsockopen() is properly configured on your server, and that port 25 is open. The module has been disabled.
Notice: Undefined index: administer email verify in user_role_grant_permissions() (line 3041 of /hsphere/local/home/......../......../modules/user/user.module).
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'module' cannot be null: INSERT INTO {role_permission} (rid, permission, module) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2); Array ( [:db_insert_placeholder_0] => 30037204 [:db_insert_placeholder_1] => administer email verify [:db_insert_placeholder_2] => ) in user_role_grant_permissions() (line 3043 of /hsphere/local/home/......../......../modules/user/user.module).

attisan’s picture

FileSize
13.23 KB

hi kaizerking,

thanks - forgot to exclude the old windows workaround but deleted the file ;-). the new upload should fix those two errors.

Email verify has tried contacting the mail host but did not receive a reply. Check with your hosting provider that the function fsockopen() is properly configured on your server, and that port 25 is open. The module has been disabled.

this is intended behavior as it seems that the function fsockopen() is not enabled on your server

I attached a corrected version (regarding the first two errors).

greets

skizzo’s picture

Thank you attisan. I see that the smtp module (SMTP Authentication Support) is listed as a dependency. Can such dependency be removed? If I recall correctly smtp was not used in Email Verification for D6.

skizzo’s picture

just noticed following notice when a user tries to modify her email in user account (after enabling latest email_verify and functioning smtp)

Notice: Undefined variable: smtp_from in email_confirm_build_mail() (line 320 of /var/www/drupal/sites/all/modules/email_confirm/email_confirm.module).

kaizerking’s picture

@attisan, I am getting emails from my site, on updates and new account registrations, i.e means the things are working correctly from server side.
I did not understand , if things are working without smtp, why it is required.
if there are issues with smtp module then email_verify will fail.

attisan’s picture

hi,

actually i want to have this module dependent to smtp module / smtp module settings because this way I can concentrate on what is important for email verification and don't have to implement functionalities which are already core competence of other modules.

as an example: sending emails (through php) isn't exactly the same as checking mx servers entries. you really should do later while having a real smtp server at hand as many recipient servers try to communicate with the sending smtp server to verify that the mail sender is valid (as spammers often don't use real valid smtp servers). if you don't present a valid smtp server, chances are that you will receive many "false negatives" as recipient servers deny your attempt to verify the users email address and respond with a false "5xx" error.

greets

ps.: regarding the error -> i guess the corresponding smtp setting isn't set. -> will get fixed

oadaeh’s picture

@attisan: It is wrong to force this module to depend on the SMTP Authientication Support when so many people do not need its functionality.

Also, there is the PHPMailer module that provides similar functionality to the SMTP Authientication Support module. Requiring one over the other is bad form, IMO.

attisan’s picture

@oadaeh: i do not mean this as an offense, but you did not get the point in depending on the smtp module - thus on a configured and available smtp server.

if you use PHPMailer (or any other way of sending mails without having a REAL smtp server in the background) recipient servers will most likely not allow probing (and this is what we are doing, as this module is not sending mails, mere tries to check if mail address could be valid).

so for this module to work - you will need a configured smtp server -> smtp module

greets

kaizerking’s picture

Attisan, i think please here is the problem
Now when i installed drupal i have just entered the site mail id
as I said earlier I am getting update mails, registration mails.
I have explored my hosting to see what is the smtp configuration, and used the mail server name in smtp
Now what I don't understand is how to further configure this smtp. If you can include a helper document on that (smtp) that will be great help, because ill only be installing smtp authentication module for email verify purpose, That will be a great help
in smtp settings it says
On config
SMTP server
The address of your outgoing SMTP server.->i have set this value as mail.xyz.com as mentioned in my mail account page of my server as smtp
SMTP backup server ->i don have this
The address of your outgoing SMTP backup server. If the primary server can't be found this one will be tried. This is optional."

"SMTP Authentication
Leave blank if your SMTP server does not require authentication."
-I don't know whether my server requires authentication or not
your help is highly appreciated
there is an issue created :here

NancyDru’s picture

Well, I've used this module in D6 for several years without SMTP Authentication.

oadaeh’s picture

Status: Needs review » Fixed

I've committed my patch in #1109444-14: Email_verify for D7. I included several of the requested fixes in the comments following my patch and several fixes from subsequent reviews with Coder and Drupal Code Sniffer. There is now a 7.x-1.x-dev branch. After it has baked a bit, and there aren't bugs to fix, I'll tag it with official version number(s).

Patches to the new official 7.x-1.x-dev branch will be reviewed in other issues.

I will not accept nor include a patch that makes this module depend on the SMTP Authentication Support module. If dbr wants to do that, that's up to him, and then I will stop contributing to this module.

@attisan: I totally get the point of the SMTP module. I spent over a year maintaining it, and I upgraded it from Drupal 5 to Drupal 6, which is why I know it's not always necessary for a module like this to work. I also know that both the SMTP Authentication Support and the PHPMailer modules use the same exact code to acheive their purposes: the SMTP class from the PHPMailer library (http://sourceforge.net/projects/phpmailer/files/phpmailer%20for%20php5_6/). The current iteration of the SMTP Authentication Support module has that code included in the module.

I now consider this issue fixed and closed.

attisan’s picture

hi oadaeh,

i totally respect your decision, though i hope it's still ok for you if i will go on and provide a smtp dependent version of this module.

it would be ok for me too to have a separated module (D7 only), lets say "email_validator" or alike, in which I go on adding features I think make email validation complete.

greets

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.