Email delivery problem to users signed up with Facebook SSO
-
When users sign up using Facebook SSO , Facebook creates a random-numbered email address for them such as [email protected]
I think a similar problem was already reported here: https://community.nodebb.org/topic/5985/facebook-sso-plugin-email-issue
However, all emails sent to these kinds of addresses are returning back to us. This was already happening, but it was not bothering us so far unfortunately, recently we started to have a lot of "Delivery Status Notification (Failure)" emails... so, we would like to solve this.
Address not found
Your message wasn't delivered to [email protected] because the domain facebook.com couldn't be found. Check for typos or unnecessary spaces and try again.And on the Facebook postmaster page, we can confirm the problem as "RCP-P1 The attempted recipient address does not exist."
Since the forum sees these accounts as valid and activated, it keeps trying to send an email at any action that causes email delivery. And of course, all emails are being failed to be delivered and returned back to us.
Any suggestion?
-
I have another question related to SSO registrations and finding users in the forum used SSO...
Let's say we are planning to leave Facebook SSO behind, and would like to alert users who registered using this SSO via email and ask them to re-register with their email address if they would like to do so... How can we find the list of these users in ACP?
-
There is no way to get that list in the ACP, but you can run the below script to get all users who have registered through facebook and don't have a local nodebb password (they didn't register a local account first). If they have password that means they registered a local account first and then they also logged in with facebook with the same email and the account was merged. I think you are only interested in user accounts that have the
fbId
field but notpassword
field./* eslint-disable no-await-in-loop */ /* globals require, console, process */ 'use strict'; const nconf = require('nconf'); nconf.file({ file: 'config.json', }); nconf.defaults({ base_dir: __dirname, views_dir: './build/public/templates', upload_path: 'public/uploads', }); const db = require('./src/database'); db.init(async (err) => { if (err) { console.log(`NodeBB could not connect to your database. Error: ${err.message}`); process.exit(); } await findFacebookUsers(); process.exit(); }); async function findFacebookUsers() { const batch = require('./src/batch'); const fbidToUid = await db.getObject('fbid:uid'); const uids = Object.values(fbidToUid); const emails = []; await batch.processArray(uids, async (uids) => { let userData = await db.getObjects(uids.map(uid => `user:${uid}`)); userData = userData.filter(u => u && u.email && !u.password); emails.push(...userData.map(u => u.email)); }, { batch: 500, }); console.log(emails.join('\n')); }
Run it in the nodebb folder with
node script.js > emails.txt
-
@baris many thanks Baris... what about for twitter or google SSO?
Will it suffice to change this line?
const fbidToUid = await db.getObject('fbid:uid');
Additionally, although for our purpose this is sufficient for now, it would be nicer to be able to see these info in ACP...