A scorned ex has been jailed after he refused to leave his former wife alone and making her feel like she was being followed.