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.

Thanks
agubairaAsked:
Who is Participating?
 
NopiusCommented:
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).
0
 
fridomCEO/ProgrammerCommented:
Hm you can distribute the .procmailrc files e.g with scp, or rsync or maybe unison.

Regards
Friedrich
0
 
NopiusCommented:
fridom:
'on selected email users'
I think 'selected' and 'email' are the keywords. aquabaria, is it?
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

 
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 ?
0
 
fridomCEO/ProgrammerCommented:
Well here's the info about rsync:
http://samba.anu.edu.au/rsync/

Regards
Friedrich
0
 
agubairaAuthor Commented:
fridom,

How do I deal with user permisions if I have to copy a file to their home directories without root privilege, using rsync ?
0
 
fridomCEO/ProgrammerCommented:
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 ;-)

Regards
Friedrich
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.