I tried the following but it doesn’t work, the mails are not even marked as seen:
require ["envelope", "fileinto", "imap4flags"];
if envelope "from" "anemail@address.com"
{
setflag "\\seen"; /* Mark mail as read */
fileInto "INBOX/Archive"; /* Move mail on subfolder after */
}