!Friendica Support I have "Email administrators on new user registration" turned on... but I don't get any of these emails, other emails are being sent fine... anyone have any ideas?
@Shiri Bailem I have the same behaviour since the feature was introduced. I am using a self hostet mail server (Postfix, Dovecot). There is no connection attempt from friendica to the mail server.
@Raroun I'm currently having no mail server for pickup (delivery works, Postfix). I tried using #Dovecot but it seems it does not support mail folders like /var/mail/virtual/domain.tld[sub-domain]/user/{curr|new|temp}/ Can you help me with either converting it to a proper format (I don't want to loose these arrived mails) or making it compatible?
@Raroun Okay, thank you. You have maybe helped me more than you can imagine. 😁 Because currently I have no POP3/IMAP running on my server, only for SMTP.
@Raroun Yeah! Fixed! I had to include the domain name in the user field:
password_query = SELECT \
CONCAT(u.mail_acc, '@', d.domain_name) AS user, \
u.mail_pass AS password, \
CONCAT('/var/mail/virtual/', d.domain_name, '/', u.mail_acc) AS userdb_home, \
'vmail' AS userdb_uid, \
'mail' AS userdb_gid \
FROM mail_users AS u \
INNER JOIN domain AS d \
ON d.domain_id=d.domain_id \
WHERE u.mail_acc = '%n' \
AND d.domain_name = '%d' \
LIMIT 1
Is my final query (prefetch for userdb). Maybe I can avoid the CONCAT() call here, by splitting it up?
@Hypolite Petovan I figured it was more likely a configuration issue on my end, which is why I posted here instead of github.
Are you using PHP mailer or the regular php sendmail/postfix system? I'm curious what might be the differences in configuration and what could be causing this to not go through?
I checked every log file that exists - for what reason ever, only the "Email administrators on new user registration" mail doesn´t come through. Ill try to check that tommorrow on my dev-instance.
BTW: i got even step debbugin working wird Friendica and xdebug. Im totally lost in the code but sooner or later i´ll get into it.
@Raroun@Shiri BailemUser::getAdminListForEmailing selects database records based on the email addresses included in the config.admin_email configuration value.
@Hypolite Petovan@Shiri Bailem Got it. I checked my dev instance and my prod instance. on both instances the parent ID of the admin is NULL but not 0. a simple update user set `parent-uid` = '0' where uid ='2'; did the trick. Notification Emails are now arriving without changes to the code.
User::getAdminListForEmailing should be update to check
parent-uid = 0 OR parent-uid = NULL
Obviously there are instances running where the Parent-ID is NULL.
My developer instance was a total fresh install - fresh os, fresh friendica and the preant-uid was NULL.
This seems weird to me though, because on my instance the only accounts with parent-uid set to anything but NULL are delegates... So maybe there's something to figure out as to why they're not getting set to 0? Or maybe just have the code also look for null?
@Hypolite Petovan@Shiri Bailem I would check for parent-uid = 0 OR parent-uid = NULL I don‘t know what caused this inconsistency between instances - but it seems for most admins this email notification feature works out of the box.¯\_(ツ)_/¯
@Raroun@Hypolite Petovan in absence of a response from Hypolite, I'd suggest yes. At the very least it's a way to document it and open formal discussion about how to address it.
@Shiri Bailem I like that Idea - will create an issue tomorrow "open for Discussion" 😀
I´m fine with both options - leave it as it is and tell people the solution when they need it, or applying a fix - like a code based one or a standard value of "0" for that database collumn 😀
@Raroun@Shiri Bailem Pull requests are always welcome, it’s an excellent start of discussion even if it doesn’t get merged or not under its original form.
The user with uid = 0 is the system user so I’d rather not default the parent-uid to 0. Ideally we should only check that the value is null, but I’d be curious about the parent-uid = 0 condition intent.
Raroun
in reply to Shiri Bailem • • •I have the same behaviour since the feature was introduced.
I am using a self hostet mail server (Postfix, Dovecot).
There is no connection attempt from friendica to the mail server.
Roland Häder🇩🇪
in reply to Raroun • • •/var/mail/virtual/domain.tld[sub-domain]/user/{curr|new|temp}/Can you help me with either converting it to a proper format (I don't want to loose these arrived mails) or making it compatible?Raroun
in reply to Roland Häder🇩🇪 • • •@Roland Häder
I'm not really that deep into Dovecot.
But in the the file
/etc/dovecot/conf.d/10-mail.confthere is the entrymail_location = mbox:~/mail:INBOX=/var/mail/%uThis specifies how Dovecot should access Postfix's existing directory structure.
In my case the line is
mail_location = maildir:/var/mail/vhosts/%d/%nwhich seems to fit your use too.
%d is the domain and %n is the user.
When I install Postfix and Dovecot, I always follow this tutorial:
How to install postfix an dovecot and roundcube
Roland Häder🇩🇪
in reply to Raroun • • •Roland Häder🇩🇪
in reply to Roland Häder🇩🇪 • • •Of course I don't want to give that permission here, because the path lacks the domain part. I don't know what I have configured wrong here?
Roland Häder🇩🇪
in reply to Roland Häder🇩🇪 • • •userfield:Is my final query (prefetch for userdb). Maybe I can avoid the
CONCAT()call here, by splitting it up?Raroun
in reply to Roland Häder🇩🇪 • • •I would leave it as it is, actually see no chance to avoid the concat - but I have to admit im lousy at SQL 😁
Roland Häder🇩🇪
in reply to Raroun • • •Hypolite Petovan
in reply to Shiri Bailem • • •Shiri Bailem
in reply to Hypolite Petovan • • •@Hypolite Petovan I figured it was more likely a configuration issue on my end, which is why I posted here instead of github.
Are you using PHP mailer or the regular php sendmail/postfix system? I'm curious what might be the differences in configuration and what could be causing this to not go through?
Hypolite Petovan
in reply to Shiri Bailem • • •Raroun
in reply to Shiri Bailem • • •I checked every log file that exists - for what reason ever, only the "Email administrators on new user registration" mail doesn´t come through.
Ill try to check that tommorrow on my dev-instance.
BTW: i got even step debbugin working wird Friendica and xdebug. Im totally lost in the code but sooner or later i´ll get into it.
Raroun
in reply to Shiri Bailem • • •What a journey, but i got it working 😀
Hypolite Petovan
in reply to Raroun • • •Raroun
in reply to Shiri Bailem • • •@Hypolite Petovan@Shiri Bailem
I am still completely lost in the code, but was able to identify the problem.
/src/module/register.phpLine 403:
DI::notify()->createFromArray.will never reached because:
Line 404:
foreach (User::getAdminListForEmailing(['uid', 'language', 'email']) as $admin)returns an empty array. Of course, if the array is empty, no mail will be sent.
Unfortunately, I don't know why the array is empty, but with the following changes to the
sendNotificationfunction, the email arrived immediately:Original code:
Modified code (getAdminEmailList instead of getAdminListForEmailing and uid was set manually):
Hypolite Petovan
in reply to Raroun • • •@Raroun@Shiri Bailem
User::getAdminListForEmailingselects database records based on the email addresses included in theconfig.admin_emailconfiguration value.In addition, these records must have:
parent-uid = 0(no delegate accounts)blocked = 0verified = trueaccount_removed = falseaccount_expired = falseDid you setup your admin account as a delegate?
Raroun
in reply to Hypolite Petovan • • •@Hypolite Petovan@Shiri Bailem
Nope, no delegate. 🙁
What’s the difference to
getAdminEmailListexpect it can return unique emails more than one time?Raroun
in reply to Shiri Bailem • • •@Hypolite Petovan@Shiri Bailem
Got it.
I checked my dev instance and my prod instance. on both instances the parent ID of the admin is NULL but not 0.
a simple
update user set `parent-uid` = '0' where uid ='2';did the trick. Notification Emails are now arriving without changes to the code.User::getAdminListForEmailingshould be update to checkparent-uid = 0 OR parent-uid = NULLObviously there are instances running where the Parent-ID is NULL.
My developer instance was a total fresh install - fresh os, fresh friendica and the preant-uid was NULL.
Anyway, we have a solution 😀
Luca Nucifora likes this.
Hypolite Petovan
in reply to Raroun • • •Shiri Bailem
in reply to Hypolite Petovan • • •@Hypolite Petovan@Raroun THANKS RAROUN!
This seems weird to me though, because on my instance the only accounts with parent-uid set to anything but NULL are delegates... So maybe there's something to figure out as to why they're not getting set to 0? Or maybe just have the code also look for null?
Luca Nucifora likes this.
Raroun
in reply to Shiri Bailem • • •I would check for
parent-uid = 0 OR parent-uid = NULLI don‘t know what caused this inconsistency between instances - but it seems for most admins this email notification feature works out of the box.¯\_(ツ)_/¯
rwa likes this.
Shiri Bailem
in reply to Raroun • • •rwa
in reply to Raroun • • •I can confirm that it's not working an my instance as well.
Will have a look later if it's the same reason as yours.
Thanks for your investigation
Raroun likes this.
Friendica Support reshared this.
Luca Nucifora
in reply to Raroun • •@Raroun@Hypolite Petovan@Shiri Bailem
thank you very much @Raroun
Raroun likes this.
Friendica Support reshared this.
Raroun
in reply to Shiri Bailem • • •Should i create a pull request with a fix for User::getAdminList, or should we leave it as it is?
Shiri Bailem
in reply to Raroun • • •Friendica Support reshared this.
Raroun
in reply to Shiri Bailem • • •@Shiri Bailem
I like that Idea - will create an issue tomorrow "open for Discussion" 😀
I´m fine with both options - leave it as it is and tell people the solution when they need it, or applying a fix - like a code based one or a standard value of "0" for that database collumn 😀
Shiri Bailem likes this.
Friendica Support reshared this.
Hypolite Petovan
in reply to Raroun • • •@Raroun@Shiri Bailem Pull requests are always welcome, it’s an excellent start of discussion even if it doesn’t get merged or not under its original form.
The user with
uid = 0is the system user so I’d rather not default theparent-uidto 0. Ideally we should only check that the value is null, but I’d be curious about theparent-uid = 0condition intent.Raroun likes this.
Friendica Support reshared this.
Raroun
in reply to Hypolite Petovan • • •I have seen that it´s not that easy like adding an "or".
But it´s possible - give me some time 😀
Hypolite Petovan likes this.
Friendica Support reshared this.
Hypolite Petovan
in reply to Shiri Bailem • • •like this
Luca Nucifora, Wilhelm, Shiri Bailem e Raroun like this.
Friendica Support reshared this.
Raroun
in reply to Shiri Bailem • • •@Hypolite Petovan
Friendica Support reshared this.
Hypolite Petovan
in reply to Raroun • • •developbranch and it should fix thoseparent-uid = 0rows.like this
Raroun e Shiri Bailem like this.
Friendica Support reshared this.