When having E-Mail addresses that are setup only as forwarding (with SRS) to an external E-Mail address it could happen that the spam filter (rspamd) of my mail server does not classify the incoming E-Mail as Spam and does a forwarding to the external mail server, but that external mail server classifies it as Spam and rejected it due to that.
Now I want to react to that rejection by learning this forwarded E-Mail as Spam too, but I have no clue how I could target that problem.
Ideally, I would quarantine those E-Mails into a dedicated Mailbox where it is initially moved into the Spam folder, this Spam folder could be supervised and Mails that should not be considered as Spam could be moved out of that folder to be learned as Ham again.
While that part of learning is clear and already setup, the problem I currently have is, how could I achieve that a copy of the forwarded mail is moved to that dedicated Mailbox only if the external server responds with a rejection Message (ideally checking what rejection message it was - e.g. ignoring quota errors).
I guess checking what rejection message it was won't be a problem when I know where to do that copying part.