If you have a lump near the anus that intermittently becomes painful swollen followed by a discharge you likely have an anal fistula
Fistulas form when an abscess forms within the anal glands of the anal canal. These abscesses may drain via the anal canal and through the adjacent skin. A chronic tract forms with chronically discharges pus. This pus is irritating to the surrounding skin and may cause itch and general skin irritation.
If the tracts get obstructed the fistula can form another abscess, causing further drainage tracts and making the patient very unwell.
The tract (fistula) may extend just under the skin, through the anal sphincters, between the sphincters and into the abdomen.
Surgery is the only option to fix this chronic problem. The key to this surgery is to not damage the anal sphincters leading to incontinence. When the fistula tract is too extensive, it may take several operations to fix definitively.