I was unclogging a blocked drain and putting everything back together and I'm unsure how this piece is supposed to work
Here it is just loosely resting where it came from. It seemed to be held onto the pipe by some cohesive force before (though now I'm doubting myself about that), but I'm not sure how. I thought I may have lost a washer or something but I double checked the floor and couldn't see anything.
Here's the rest of the plumbing without that piece
And here's how I left it for now
While the metallic piece is screwed on as before, I'm pretty certain it's not accomplishing anything (besides maybe aesthetically). Something presumably needs to exert a force towards the wall to get a tight seal there. It expectedly leaks slightly. If I apply pressure towards the wall then it doesn't.
The sink was leaking before this, but I thought that was only from the black rubber washer. It's possible that my landlord never did it properly and that it always leaked from here too, but I tend to think I'm missing something.
How can I fix it?