Script for selective .procmailrc copying/deleting

Hi Experts,

Does someone have a script I can run on a Linux machine to copy or delete .procmailrc files on selected email users for a given domain ? This will allow me to enable anti-spam software for selected accounts instead of doing it one by one.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Artysystem administratorCommented:
No way to have a universal script for all mailers.

Local user 'user1' may have multiple emails (it may have multiple aliases in your mail configuration).
Alias mapping is a complex process.
You may try to run some tool for mapping email to your local user name.
This tool is to be specific to mail system you are using (suppose for sendmail, you may run sendmail it in test mode).

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Hm you can distribute the .procmailrc files e.g with scp, or rsync or maybe unison.

Artysystem administratorCommented:
'on selected email users'
I think 'selected' and 'email' are the keywords. aquabaria, is it?
Bootstrap 4: Exploring New Features

Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.

agubairaAuthor Commented:
Yes Nopius, that would be the ideal solution, however if it gets to tough I would accept a procedure to copy .procmailrc files to all users or delete it from all.

Fridom, how does scp or rsync work ?
Well here's the info about rsync:

agubairaAuthor Commented:

How do I deal with user permisions if I have to copy a file to their home directories without root privilege, using rsync ?
Now then it depends on the group permissions. If you put all of the users in one special group and adjust the permissions accordingly you'll not encounter any trouble.

If that does not work you have to write a script with root privileges run the syncing as root and adjust the permissions thereafter.

The usuayl Unix way ;-)

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux OS Dev

From novice to tech pro — start learning today.