El Capitan Mail: How to cancel processes in Activity window?
To cancel the activity without the (X) button that is gone since El Capitan, on Mail versions with the V4 format, it seems to be enough to stop the app, go to cd ~/Library/Mail/ and remove the three ExternalUpdates.* files. 

These seem to be the files that keep the queue of remote operations.