On each new mail my process is getting invoked. It downloads the attachment and save it. But when mail with no attachment is received it send back an error message to the sender. Also the all processed mail are getting deleted from the mail server (mail is configured on my personal domain).
So I need that process should invoked only when the attachment is found and after processing it, delete that mail. If no attachment is found then leave it as it is.
Email Receive Activity has an option to filter emails based on Attachment MIME type.
You can create a continuous running process which looks for emails with attachments. If email successfully retrieved, invoke the primary process, otherwise
loop back and wait for next email.