In the vertical position it is legal under both the UPC and the IPC but it will raise eyebrows and take an inspector that actually knows his code to...
You indeed have some nasty water there and honestly, almost nothing you do is going to be satisfactory for very long and will require a whole lot of...