The stiff penalty is deliberate, designed to stamp out what the Scottish Law Commission refer to as a growing problem. According to an Out-Law report the sending of offensive messages in the workplace has become more commonplace.
That might well be true, but the new law is far too broad in its definition of indecent communication. It will be up to the courts to determine just who gets jailed for what, it seems.
The basis of what is a sweeping revision of sex crime laws in Scotland is sound enough: sending messages that have an intent to humiliate or distress the recipient is something that needs to be punishable by law.
Yet the Sexual Offences (Scotland) Bill also states that the offence will be committed if the court decides a message was sent to provide the sender with sexual gratification. Quite how that can be determined is another matter.
Creating a clear legal framework for sex crimes is an honourable intent. Ending up with a Bill which criminalises the sender of a joke text message, or a flirtatious email whose recipient does not share the attraction in the sober light of day, is quite different.