mail forwarding loop detection

For christmas I would like a mail forwarding loop detection, as many of the end-users always happen to install loops via aliases and forwards etc.

So I think the algorithm should look like:
if the domain to which a mail is forwarded is on the local host: check the recipient in the new domain (aliases should be expanded to their real account name) for any forwarders recursively, until a loop is found, the mail leaves the local system, or is delivered locally