To expand upon my first post, here is my situation.
A client uses a third-party job assignment system that emails tasks to field personnel.
To distinguish between task assignments and the more mundane mail, the client wants the email also sent as MMS to the employees’ mobile phones when it comes from the assignment system’s email domain AND when the subject is a high-priority one.
There actually are two domains that send the emails depending on what stage of the process the job is in (estimate, proposal, approved, scheduled, etc.), hence the need for OR. Either of the addresses should trigger the action. The AND is needed to select for high-priority subjects, although that’s less-critical because almost all the messages are high-priority.
So it’s something along the lines of
IF sender domain == (domain0 OR domain1)
message subject == (subject0 OR subject1)
THEN DO (action0 AND action1)
The actions in this case are to send the MMS, and then send the original email.
We’d been using cPanel’s email filters for years to accomplish this, doing a simple forward to MMS followed by delivery via email (two actions when the trigger conditions are satisfied).
Then all of the sudden, it stopped working. The reason was that some idiot tagged an MMS message from the sending domain as spam somewhere along the line, and the client’s mobile carrier assigned the domain to some sort of SMS/MMS blocklist that they maintain: and no one there knows how to undo it.
After a week of getting nowhere with the carrier, I got an email inviting me to a Zoom meeting to address the problem. But they were dopey enough to put in the agenda that their “solution” involved subscribing to an absurdly expensive external mail service, from which the carrier no doubt gets a kickback.
“Screw that,” said I, followed by an anatomically-impossible suggestion to the carrier regarding a suitable destination for their Zoom meeting and the expensive third-party mail service.
Instead, I wrote a PHP script to explode the message, strip out the garbage, reformat it nicely for MMS, and send it as MMS. It then sends the original version as email. That’s why I suggest that Virtualmin’s mail filters be endowed with the ability to execute scripts.
I also suggest that the filters have the ability to pass variables. That would enable one script to be used for all users. The script could just look up the user’s mobile number from a database or flat file based on their email address, assign the email and the MMS address as variables for the mailer, format one version of the message for MMS, and send both the MMS and the original message on their way.
I’ll probably wind up cobbling together some code to do this in Virtualmin for my own use (in PHP, because my Perl sucks), but I think these would be useful enhancements to the existing filters.