Hi - well done for finding the leak. There’s a really detailed diy by the 50skid on you tube (its quite old now) but he replaces the entire oil breather/pcv system on his e46 which has the 330i petrol (M54) engine. He also shows a quicker way in another video without the need to remove the inlet manifold - I had to change all of the hoses on our e46 325 (same engine in so far as the breather system etc) as they were all cracked, so I went the whole hog, and removed the intake manifold. Selection of videos on this below:
https://youtu.be/ZDP8Dma0nUs?si=FkELrugrSuZMMZJr
https://youtu.be/9X5cfqvx2Oo?si=_RkCl0UKzyBJfg9w
Quicker option:
https://youtu.be/btggLSedkxc?si=g7T4OxhOkkv-d4Hr
https://youtu.be/3OhyZBxM1vA?si=S5zel7jLVON3Sv3z