Have one's tail between one's legs
To be down-hearted or to be in bad spirits, the opposite of to have one's tail up, derives from the observation of dogs who convey their emotions via the position of their tails. It dates from at least the Middle Ages, if not before.