I realize that this issue has come up before. My host has fscokopen() open on port 80. (I contacted my host regarding message that appeared after adding the Email Verification Module.)

Is it possible to change the port reference in the coding? Or create a patch that allows the fscokopen() to
(a) work on either open port 25 or 80, or
(b) work on any open port?


#6 _email_verify_431376-6.patch2.72 KBDrewMathers


ronliskey’s picture

I'm having this problem too using HostGator. Looking forward to a solution.

dbr’s picture

Assigned: Unassigned » dbr
Status: Active » Postponed (maintainer needs more info)

For information: does it work in your setup if you manually change the code to use port 80 instead of 25?

SDM-MINK’s picture

Where in setup can I make this change? Can you give me the file name & line number so that I can test? Thanks!

dbr’s picture

There are two occurences of the port number "25" to change:

email_verify.inc.php line 39: $connect = @fsockopen($smtp, 25, $errno, $errstr, 15);
email_verify.install line 41: $connect = @fsockopen($smtp, 25, $errno, $errstr, 15);

DrewMathers’s picture

Unfortunately, changing the fsockopen() port number will not allow this module to work correctly, even though the change may allow you to enable the module. The problem is that this module must use a technique called Recipient Address Verification, which requires it to connect to the recipient mail server, not your mail server. The recipient mail server will always be listening in port 25. Many shared hosts block port 25 as a security measure against spambots. Hosting your own site locally may not help either, as many ISPs also block port 25 for the same reason.

DrewMathers’s picture

Title: fscokopen() not open on port 25 » Running with shared hosting security
2.72 KB

This patch will adapt Email Verify in secure shared hosting environments. If the fsockopen() function is disabled or port 25 is blocked, Email Verify will still enable, but it will check only the address syntax and the validity of the domain name. The mailbox name will not be checked.

If port 25 is blocked, the first-time enable will take a long time because you have to wait for the connection to time out. If this happens, the fact will be stored in a variable so this time-consuming check can be skipped on subsequent enable/disable cycles. If your host should later open port 25, you can clear this variable by disabling the module and running /admin/build/modules/uninstall

The patch is built on the current -dev snapshot. However the -dev snapshot first requires this patch in order to run #508004-20: Email Verify requires the server of a version of PHP 5.3 on Windows?

The patch was created in the new -p1 format

DrewMathers’s picture

Status: Postponed (maintainer needs more info) » Needs review
oadaeh’s picture

Assigned: dbr » Unassigned
Issue summary: View changes
Status: Needs review » Closed (won't fix)

Due to Drupal 6's EOL, I am closing this with "won't fix." If you feel this is still valid for any of the 7.x branches, feel free to re-open and update this issue.