Union leaders in Scotland have complained that too often nothing is done to tackle pupils who use social media and mobile phones to target abuse at teachers.
Margaret Smith, president of the Scottish Secondary Teachers' Association, spoke out about the "sinister development" over the past decade of youngsters using social networking websites and mobile phones to attack teachers.
This could see school staff subjected to "verbal abuse, threats and ridicule" with females "often subjected to grossly offensive comments regarding their personal lives which can be deemed nothing other than sexual harassment", she said. "Too often nothing is done to combat this behaviour and pupils believe that their conduct is without consequence."
She raised the issue as the union accused the Scottish Government of complacency about classroom indiscipline. "A sinister development over the past decade or so has been the co-ordinated targeting of some teachers. Social media networks, mobile phones and other technologies to which pupils have access make it so much easier to make a teacher's life intolerable and his or her job impossible," Ms Smith said.
The problem of "indiscipline in Scottish schools, both serious indiscipline and lower-level misbehaviour" has concerned her for some time. "Over the years I have spoken out against what I consider to be an ad hoc and somewhat complacent attitude on the part of some authorities and managers regarding indiscipline in our schools."
While the union leader accepted that classroom indiscipline is "not a uniquely Scottish problem", she said she believes that most European countries are "calling for a co-ordinated approach to indiscipline and see tackling it as part of the duty of care all employers have towards their employees".
But "this is rarely the situation in Scotland".
She said: "Standards of tolerance regarding quite shocking levels of misbehaviour, including physical and verbal abuse of teachers, differ greatly from school to school, depending on the level of support offered by management towards teaching staff. Indiscipline is not just an issue for deprived areas, something that teachers in the so-called leafy suburbs do not have to worry about. If teachers are not supported, it can and does affect any school."
Teacher stress levels are "at an all-time high" but tackling bad behaviour in the classroom would reduce this, Ms Smith said.
A Scottish Government spokesman said: "The vast majority of pupils in our schools are well behaved and a credit to Scotland. However, any incident is one too many, and we are working across the sector to improve behaviour in schools. Independent research shows that behaviour, including serious indiscipline and violence, has improved since 2006."