require "fileinto"; if header :contains "to" "name@mydomain.tld" { fileinto "INBOX.bt-message";stop; }