I've just tried to replicate this issue and I'm unable to replicate it.
For standard teachers, who do not have the access all groups capability, they will only receive messages for a group that they are in.
Can you detail the steps that you have taken to replicate this? I have attempted to replicate by:
- Create a new course with:
- Group mode: Separate groups;
- Force group mode: Yes
- One student;
- One editing teacher; and
- One non-editing teacher
- Create a new group within the course
- Assign the student to the group
- Create a new forum with:
- Subscription mode: Automatic
- Create a new forum post in the group (skip editing time);
- Run cron
- Confirm that only the following users receive the notification:
- Editing teacher
- Confirm that the following users do _not_ receive the notification:
- Non-editing teacher
For me the above works correctly.