You can see what messages you have on the server through the Account Info window in Mail.
To access it, control-click somewhere in your mailbox list and from the contextual menu select Get Account Info.
If you have more than one email account, you can choose between accounts via a menu at the top. Select the mailbox you wish to access and click on Messages On Server. All messages for that mailbox kept on the server will show up in the list which appears. From there you can select individual messages; you can also select multiple messages by shift-clicking on them.
To delete the selected messages, click the Remove From Server button.
This is useful when you wish to go through your messages and delete the spam before downloading your email locally.
Mac users can check here our Mac hosting package.