This is just a total guess, but you have a secondary amine in there.
Maybe the amine attacks the sulfonyl group intramolecularly, then the Cl- gets kicked off as a leaving group and the N ends up with a positive charge.
The pyridine then strips off the H from the postively charged N, thus generating your pyridinium chloride salt.
Then the thiol attacks the the sufonyl group, the N turns into the leaving group and leaves with a negative charge.
The 1,4-Dioxane then comes in and pulls the H off of from the thiol.
Then the amino group which is at this point is negatively charged acts as a base and pulls the H off of the 1,4-dioxane.
Wish I had the software to draw it out for you, but I am on Linux and they don't have anything good like ChemDraw for Linux.
Anyway, like I said it was just a total guess, but the main point is that maybe there is some sort of intramolecular attack going on?