Results 1 to 2 of 2

Thread: script to block hotmail for all users

  1. #1
    Join Date
    Dec 2010
    Posts
    23
    Rep Power
    4

    Default script to block hotmail for all users

    Dear all

    I have single installation server of ZCO 6.8
    I want to block gmail,yahoo,hotmail for 100 users ,and open the gmail,yahoo,hotmail for 10 users.

    I know I should use this command
    zmprov ma user1@avit.com.eg +amavisBlacklistSender "gmail.com"

    I need to execute this command over 100 users ,it will be headache if I typed it 100 times so I know that I can get all the account from this command zmaccts

    zmaccts

    admin@avitdc.local active 12/22/10 09:40 02/20/11 15:45
    ham.pludpzud@avitdc.local active 12/22/10 09:41 never
    nagwan_sowelam@avitdc.local active 01/05/11 09:19 01/17/11 23:33
    rina@avitdc.local active 12/22/10 13:24 02/20/11 15:47
    spam.xtt_amrw1i@avitdc.local active 12/22/10 09:41 never
    wiki@avitdc.local active 12/22/10 09:41 never

    I want to make the argument of CMD zmprov ma to be variable and read from the output of zmaccts

    Can anyone help me?

  2. #2
    Join Date
    Oct 2008
    Location
    San Diego
    Posts
    48
    Rep Power
    7

    Default

    Use the "zmprov -l gaa" command to list all accounts and pipe it into a text file(account-list.txt). Remove the accounts you want from the text file. Then use a bash script with a simple for loop to make the changes.

    #!/bin/sh
    for i in $(cat account-list.txt); do
    zmprov ma $i +amavisBlacklistSender "gmail.com"
    sleep 5
    done

Similar Threads

  1. Changing Calendar Organizer script
    By snsparrish in forum Administrators
    Replies: 4
    Last Post: 05-02-2011, 05:41 AM
  2. Replies: 2
    Last Post: 10-26-2010, 12:59 AM
  3. block extensions in attachments for some users
    By alexismedina in forum Administrators
    Replies: 1
    Last Post: 04-12-2008, 02:17 PM
  4. Replies: 3
    Last Post: 10-01-2007, 11:54 PM
  5. HOWTO? Whitelist IP Block + SMTP Auth Users
    By stbain in forum Administrators
    Replies: 4
    Last Post: 09-19-2006, 12:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •