1
jsdev2006
Disabling Activation Email for testing
  • 2006/2/18 16:00

  • jsdev2006

  • Just popping in

  • Posts: 8

  • Since: 2006/2/18


Hi,
I'm trying to see if XOOPS suits my purposes. I am testing it on a Windows XP Pro machine, XOOPS version 2.2.3Final. Running it on XAMPP. XAMPP has Mercury Mail server, but mine is not working somehow (thats a different story).

My question is, since there is no sendmail counterpart in windows, can the email part needed for activation be disabled temporarily? Since an email ID once requested for registration cannot be requested again, (and I do not know the complications of updating the xoops_user table in the database directly) with three tries I have exhausted all my email ids! Now I need to enter fake ids but they obviously cannot be used for activation (they are fake). So, basically I am stuck. I know that XOOPS is tested heavily before release, but everyone generally likes to have a feel for themselves before going live on a real site.

The solutions I see are:

(a) put a flag(checkbox/ on the Mail Setup or Authentication Settings page to skip the email activation step totally, just for testing purposes (best option to help testing)

(b) release a testing-only release (least feasible option - life will be a pain to handle multiple releases)

(c) someone create a sendmail copy for windows and distribute it around with XOOPS or put a link to any such software (but then XOOPS needs to have code to support it)
With (c) you still have the major problem of exhausting all your true email ids quickly - e.g. you want to put 2-3 users in a group with some settings, 2-3 in another with other settings, 2-3 with admin rights etc., - normal testing, basically - you will need about 10 real email ids - thats not practical by any stretch of imagination.

(d) is there a quick hack available - disabling some field somewhere or some simple update query?

Any help is greatly appreciated.

TIA,
JS

2
stefan88
Re: Disabling Activation Email for testing
  • 2006/2/18 17:49

  • stefan88

  • Community Support Member

  • Posts: 1086

  • Since: 2004/9/20


Hi
Sorry I'm not familiar with 2.2, so this may be changed, but in 2.0 in Administration -> System Admin -> Preferences -> User Info Settings, there is option called "Select activation type of newly registered users" where you could select "Activate automatically".
..

3
jsdev2006
SendMail for Windows
  • 2006/2/18 20:46

  • jsdev2006

  • Just popping in

  • Posts: 8

  • Since: 2006/2/18


Hi,
here is a find:
a sendmail for windows available for free at

http://www.dotnetjunkies.com/WebLog/johnwood/archive/2005/01/17/45329.aspx
or
google for "sendmail for windows john wood"

The utility is quite nifty and seems just like sendmail on unix.
One thing is that it seems it requires .Net runtime installed (i am not sure, maybe someone without .Net runtime can just try out the utility and confirm)

The other thing is it takes the name of a file as command line argument, which contains the body text.

Now someone just has to put the code into
class/mail/phpmailer/class.phpmailer.php
in the function sendmail_send() maybe (around line 590)

The code should be something like:
function win_sendmail_send($header, $body) {
//echo "inside win_sendmail_send()";

//to be passed correctly
$this->Sender = "admin@myxoopssite.com";
$mailservername = "mail.myserver.com";
//generating a random file name so that no
//concurrent file access issues arise
$messagefile = "C:/temp/".uniqid().".txt";
$filehandle = "";
//and filling the body text into that file
if(!@$filehandle = fopen($messagefile, "w"))
{
$this->error_handler(sprintf("Could not open %s", $messagefile));
return false;
}
if (fwrite($filehandle, $body) === FALSE) {
$this->error_handler(sprintf("Cannot write to file %s", $messagefile));
return false;
}
fclose($filehandle);

/*
-----quotes do not seem to work -----
$sendmail = sprintf("\"%s\" /s %s /f %s /t \"%s\" /j \"%s\" /m \"%s\"",
*/
$sendmail = sprintf("%s /s %s /f %s /t %s /j %s /m %s",
$this->Sendmail,
$mailservername,
$this->Sender,
$this->to[0][0],
"User activation key for username",
$messagefile);

//echo "\n the whole command :\n$sendmail \n";
exec($sendmail);
//exit();

return true;
}

------------------------------
maybe exec is not a good idea ..... this is far from complete as a patch, obviously. Just to give an idea. I managed to get this code to send myself a activation mails properly.

(Surprisingly, the command string ($sendmail) works properly without quotes for multiword arguments. Needs to be tested.)


************************************
The good thing about this approach of using a sendmail clone is that people testing out XOOPS on Windows (or maybe using XOOPS on WAMP) do not need to setup a mail server on their setup for sending a mail. Setting up Mercury Mail which comes with XAMPP can be quite a task.
************************************

Coming back finally to the discussion on disabling email activation,
stefan88,
I could not find in 2.2.3 what you pointed out, I will have to look harder
Thanks.

HTH,
JS

4
stefan88
Re: SendMail for Windows
  • 2006/2/18 21:43

  • stefan88

  • Community Support Member

  • Posts: 1086

  • Since: 2004/9/20


Sorry - 2.2.X has it too, but it is in "Extended profiles -> General settings"
If "Extended Profiles" is not installed, you will have to install it ...
..

Login

Who's Online

168 user(s) are online (127 user(s) are browsing Support Forums)


Members: 0


Guests: 168


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Mar 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits