refine alias lookup and handling of attachments