For the U.S. model E39 M52, M52TU and M54 that is the Secondary Air System (SAS) Electric Valve seen in figure #5 below.
For your Diesel E39, which we did not get in the states, that same valve is used on your engine for your Intake Manifold EGR Flap Control as seen in this diagram below figure #11 I believe, click on the link and expand the diagram.
It gets vacuum from the pipe with the 3 nipples on it, should be 4 nipples? (Unmarked in this diagram with a number) and the other vacuum line attaches to the Vacuum Box as seen in figure #9.
The valve attaches some where on your manifold with that clip to a bracket I would imagine, that one you are gonna have to figure out where that is, careful, it is east to snap the clip.
A forum community dedicated to BMW owners and enthusiasts. Come join the discussion about Bimmerfest events, production numbers, programming, performance, modifications, classifieds, troubleshooting, maintenance, and more! Bringing the BMW community together.