Not sure where this should go. Feel free to move it.
The problem this solves: Mail from a certain domain always contains assignments for field technicians. The client wants those assignments sent as emails, and copied as SMS / MMS as an added alert to the technicians. However, the wireless provider blocks the messages from the original domain, so the “From” need to be rewritten as from the client’s domain.
I was only able to do this in cPanel by piping to a script. It’s actually much easier in Procmail in Virtualmin. Just create this as .procmailrc
in the user’s directory:
:0c
* !^FROM_MAILER
* ^From: .*originaldomain\.tld.*
{
:0fw
| formail -i "From: robot@clientdomain.tld"
:0c
! 1234567890@wirelessprovider.tld
}
That sends the email from the original domain, and the SMS from the client’s domain.
This is another step toward being able to migrate this client to Virtualmin, by the way.
Richard