In Mukhtasar al-Akhdari and other Maaliki books there is an indication that it is haraam to shake hands with a non-mahram woman according to the madhhab of Maalik (may Allah have mercy on him).
Aleesh said in Minah al-Jaleel Sharh Mukhtasar Khaleel (1/22): It is not permissible for a man to touch the face or hand of a non-mahram woman, and it is not permissible for them to put their hands together without a barrier. Aa'ishah (may Allah be pleased with her) said: The Prophet (blessings and peace of Allah be upon him) never accepted the oath of allegiance (bayah) of a woman by holding her hand; he would accept women's oath of allegiance verbally. According to another report: His hand never touched the hand of a woman; rather he would accept their oath of allegiance verbally. End quote.
The details that you mentioned have to do with losing wudoo' by touching; wudoo' is broken in the event of seeking pleasure, or finding pleasure (even if he was not seeking it), or seeking it and finding it. Wudoo' is not broken when one does not seek pleasure or find it.
The prohibition is connected to doing it deliberately, whether there is pleasure or not.
For more information please see the answer to question no. 21183 and 2459
And Allah knows best.
Reproduced from Islam QA