Can I forward all received email to a file ?
To do this, you will need to create an email forwarder in cPanel. If you wish for the messages to only be sent to the file and not stored in a mailbox, do not create an email address, just create a forwarder with the name of the address.
When creating the forwarder, choose the pipe to a program option. Then put in the path of the file/program you wish to send the mail to.