That's an interesting one. There's no functionality for that at the moment. If you are running Network Edition then an indexer runs on the content of attachments for searching, but there's no hooks into that process and no user level interface.
Technically it's possible to have the indexer be aware of criteria and pass operations off to another section if they are met. You'll need to either make the changes yourself or file a feature request in the bugzilla to request that Zimbra engineers write it in in a fucture version.
Bugzilla Main Page - Zimbra