XF 2.3 Registration emails not sending, test works

TheLaw

Well-known member
Weird one. I tried the test email and it works fine. But registration emails do not appear to be sent. I conclude this because I sent emails directly to accounts on my server which were fine for the test, so I don't believe this is a spam issue. Might there be something which I've unchecked accidentally that might cause this? Might there be some setting (or addon) that might suppress sending emails out to users for registration? I thought these were always sent.
 
That wouldn't be an issue if the test email was sent properly, which it does.

I forgot to mention that the site is set up to allow guest registration and email after they post, awaiting approval from the admin. Perhaps I forgot to enable the approval by the user being sent a link? I could have sworn that any time you allow guest registration, approval can be either admin or allow the user to click a confirmation link. Perhaps I may have slipped up somewhere?
 
Well, the most obvious answer is to see if it's configured correctly.

ACP > Setup > Options > User Registration > [Enable email confirmation] > Enabled/Disabled?
 
Oddly enough, that seems to have been unchecked. This may have been changed when I enabled a guest post add-on that was handling this process. I did think that users would still receive a registration post, even if it would not allow for self self-confirmation. now we shall see whether this was the case, but I am quite certain it was the culprit. Occam's razor, LOL.
 
Well.... um.... no. Still not working. Enable manual registration is unchecked. Confirmation is checked. I just tested it with "send registration email" checked, I typed out a registration email text too. Something is awry here. Below is the message I'm seeing after a user registers and no email registration is being generated.



Your account is currently awaiting approval by an administrator. You will receive an email when a decision has been taken. Once your registration has been completed, your content will be posted automatically.

Register​


Thanks for registering. Your registration must now be approved by an administrator. You will receive an email when a decision has been taken.

Once your registration has been completed, your content will be posted automatically.
 
PHP built in mail system is checked. It works for the test and has been sending me periodic emails about my own posts. It's just registration that it is not sending a user a confirmation link and that message about manual approval by an administrator is showing, no welcome email sent.
 
I just did another test of having a test user reply to one of my forum posts. I get a notification that a post was made in email. This is specifically an registration quirk that is sticking me to (1) manual administrator approval; and (2) not sending users confirmation emails, with the message posted above. I wonder whether this is the remnants of an old addon. This was working hmmm....
 
So registration with email confirmation still doesn't work properly - but this is part 1 of the problem:


Any time a user uses an IP address that has been banned, the user will require manual confirmation. This creates a challenge with so many using common commercial vpns these days for legitimate purposes like security.

The second issue applies -
1) From a legit IP address I'm not getting the stanard message about an email being sent with a link, it's manual confirmation message appearing above.
2) The email that goes it is the registration message - so the user is registered after posting and gets that welcome message. The message with the confirmation link isn't generated. This has me completely confused.

This is the default message that should be showing when a user registers, and for reasons I cannot explain, it does not and the manual approval email still persists.

Register​


Thanks for registering. In order to complete your registration, you must follow the link in the email that has been sent to you.
 
Last edited:
Moving along I'm seeing something that may involve corruption or some other tomfoolery.

If I disable the age check entirely (no age and no date of birth) I STILL get a requirement to put in an age. If I change the age, I STILL get the old age that it was set at (13) and not the new age entered and appearing in the admincp. If I have only DOB and no age, I STILL get the old age in the form.

I'm using 2.3.4 and this is not the issue. I guess I'll try to use mysql to manually set these and will see if that is possible.
 
Is there any reason not to upgrade to the latest version?
I may need to do so. My desire was not to fix what wasn't broken with the dozen or so add-ons I use.

Unfortunately, it appears this may be the only solution and hoping for the best. Right now the issue seems to come down to the changes not being written to the database for both "Enable email confirmation" and the "minimum age" fields. Changing them do not register changes in the database and usage during registration.
 
Fascinating - after a few hours with @AndyB we deduced that all the IP addresses being registered are exactly the same.


I'm now looking into this issue.
 
Wow.... this was insane. This is the issue. For me, here is the solution - and IP addresses will be registered properly AND the confirm registration link will work. Prior to November, IP addresses were being registered properly. Since November I've had huge problems and couldn't figure out what was going on. Now I see. All users are being registered with the same IP address of the server. Since some are banned, it automatically triggers XF's spam management and will not show the visitor the confirmation link page because it thinks it's a shared IP address of a banned spammer.

Solution: edit: src/config.php

Add this at the bottom:


if (isset($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
 
Back
Top Bottom