I have a website in PHP
sending multiple email to its users.
Because I need to be able to debug emails, I've created an email account (system@example.net) and, I've added this email address to the BCC field of every email my server send.
It's been very useful, but I've underestimated the number of email my server is sending and the inbox of this account is becoming very messy.
What I would like to do is, either through configuration or through scripting, automatically put emails into a specific folder based on their subject.
For example every email matching the regex below should be put inside a "Welcome" folder
/Welcome to my website ([A-Za-z0-9])\w+/g
How can I configure my server/Create a script to automatically organize an email account's inbox based on email subject ?
My website is using Apache2, php5.6, Postfix and dovecot.