From: Rabbi Moshe Sofer
To: Rabbi Mordechai Broda
A rabbi who gave a binding handshake (tekias kaf) committing to a rabbinical position sought annulment after regretting the decision and learning of the community's troubled character. The Chasam Sofer rules the commitment can be annulled by three laymen with the community's knowledge but without requiring their consent, since the community never conferred an actual benefit on the son. He advises practical caution to avoid chillul Hashem by seeking the community's voluntary consent through contemporary rabbinic authorities.
Source: Shu"t Chasam Sofer YD §226