Rat-tailed maggots are the larvae of quite a large group of closely related hoverflies.
They have an elongated breathing tube at the end of their bodies which acts as a snorkel in water. The tube is usually as long as the larva’s body, around 20mm, but can extend much longer.
Eristalis tenax is the most common in this group and is found in stagnant, oxygen-deprived water and sewage.