The foul odour via the vents is generally caused by a bacteria build up on the AC evaporator which is accessible by taking the cabin filters out of their housing giving the necessary access. I've had mine professionally cleaned where they remove the cabin filters and spray a specific chemical directly onto the evaporator while the aircon is on with the engine running. You can buy a can of AC cleaner which you put in the rear passenger footwell, release the contents which are then circulated through the AC system.
Here is a link to BMW's process:
https://www.newtis.info/tisv2/a/en/f...ments/GiMdQbtM