That's ok. There are several ways to remove a lot of files at once.
If the emails in that folder are all not important, you can just delete the entire folder "rm /home/user/Maildir/new -Rf" and then recreate the folder again "mkdir /home/user/Maildir/new". Also set the correct permissions (check the ownership permissions and the the correct access permissions read, write, exexute). Check the permissions before deleting the folder, of course.
If you have a small amount of emails that are very important, I suggest just copying them to another mailbox manually. Via Thunderbird or command line.
Then do the above to delete the junk.
But if you have a lot of important emails and moving them manually would take too long, I would suggest this strategy:
Find a common pattern inside the emails that you need to delete, for example:
"Could not open input file: /home/user/domains/domain.com/public_html/demo/artisan" could be the pattern.
First test if the search by pattern works as you expect:
grep -Hir "Could not open input file: /home/user/domains/domain.com/public_html/demo/artisan" /home/user/Maildir/new/
It should return something like this:
/home/user/Maildir/new/very_long_file_name_123435,S:Could not open input file: /home/user/domains/domain.com/public_html/demo/artisan
You only need the full filename so add "cut -d: -f1", where -d with the ":" will cut the line at the delimiter ":" and "-f1" will return the first portion of the line, in other words the filename.
grep -Hir "Could not open input file: /home/user/domains/domain.com/public_html/demo/artisan" /home/user/Maildir/new/ | cut -d: -f1
You should see something like this (the filename may have symbols such as ","):
/home/user/Maildir/new/very_long_file_name_123435,S
Ultimately, to delete all those files add "-exec rm -f {} \;"
grep -Hir "Could not open input file: /home/user/domains/domain.com/public_html/demo/artisan" /home/user/Maildir/new/ | cut -d: -f1 -exec rm -f {} \;
Just please test all of the above commands in a test environment first (like in a VirtualBox VM). Just to be 100% safe.
Keep in mind that you might run into various errors, if the command can't handle so many files at once, or permissions errors. You might need to repeat the command or modify it to work with a smaller list of files.