Start the Enhanced User Interface, select the Resident Protection task, click on it with your right mouse button and choose Properties - to edit the task.
Check the Advanced configuration if it's not checked.
Now, find the Internet Mail provider in the list and select the Virus page. Here you can choose what to do when a virus is found. The default value is "Choose action" - it means that the virus dialog will appear. If you delete this action (using the Remove last word button) and keep the box empty, avast! will not do anything with the virus - i.e. it will be kept in the message. If, on the other hand, you want to automatically delete the virus attachment, use Delete file as the action.
When you confirm the changes to the Resident Protection task with the OK button, it should work as you expect.