Compress attachments before the HTTP proxy does.

fix #480