Possibly Useful Procmail Filter

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:

* ^From: .*originaldomain\.tld.*
  | formail -i "From: robot@clientdomain.tld"

  ! 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.



This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.