Mail Issue: "Couldn't send mail to following users ..."

Hi
I have an issue with mail: When I want to share a file or a folder with other users and I check the field “Notify by mail”, it works with some users. For other users I get the warning “Couldn’t send mail to following users: X.Y. (X.Y.@z.ch)”, although the address exists.
In the log file, I find the following error: "Can’t send mail to inform the user about an internal share: Address in mailbox given [] does not comply with RFC 2822, 3.6.2."
All the addresses are saved in the AD, and I am using the App “LDAP user and group backend”, which works very fine for me.
Could anyone help me please? Thank you!

Hi,
it seems like this kind of email address is not valid as per definition in RFC 2822. I’ve found a service on the internet that verifies that: http://isemail.info/X.Z.%40z.ch

Oh, sorry, I forgot to mention: The address is an alias, like John.Doe@pretendco.com
By the way, John Doe’s address would be valid as per definition in RFC 2822, although the address doesn’t exist.
When I tried to share the link to a file with John Doe, I got the following message:
“Error while sending notification
Couldn’t send mail to following users: John.Doe@predendco.com

The Log says:
"Debug core Sent mail to "Array ( [John.Doe@pretendco.com] => ) " with subject “My.Name shared »Example.odt« with you”

I don’t know, If this helps.
nextcloud has logged 370 the same error in one minute:
“Undefined index: id at /var/www/nextcloud/core/ajax/share.php#230”

There is written:

foreach($emails as $email) {
$result[] = array(
‘id’ => $contact[‘id’],
‘email’ => $email,
‘displayname’ => $contact[‘FN’],
);

We have to distinguish between malformed addresses and non-existing addresses. The first one are all addresses that are not considered valid email addresses like the one you mentioned in your original post. I think the dot right before the @-sign is what makes the address invalid.
The latter case is when an address is valid, but it does not exist. There is no easy way to check that and I personally don’t think Nextcloud should check this aspect.
So, yes, John.Doe@pretendco.com is valid, although it does not exist :wink:

My problem is not the one, that it doesn’t work with malformed addresses only (sorry for this misunderstanding) but that it does work only with some addresses: I can enter my private address. Maybe, it works, maybe not. I can enter an other existing address out of our domain. Maybe, it works, maybe not. I can enter a non-existing address or one out of our domain. Maybe, it says that it works, maybe not. It’s quite shaky …

Do you see a pattern of addresses it does work and the ones that don’t? "X.Y.@z.ch" is a malformed address, therefore the server refused to send to this address.

Sorry, I used a very bad example. I work at a school. There, we have 700 persons who have got mail addresses like "forename.surname@ourschool.ch". Some of them get the mail, others don’t. There, I only get an error message. Also if I want to share a link by mail, this is not possible, nor with gmx-addresses nor with other domains (my private one for example).

Okay. This looks like a bug. Can you please file an issue at https://github.com/nextcloud/server/issues/new? Thanks :slight_smile: