Results 1 to 2 of 2

Thread: script to block hotmail for all users

  1. #1
    Join Date
    Dec 2010
    Rep Power

    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 +amavisBlacklistSender ""

    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


    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
    San Diego
    Rep Power


    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.

    for i in $(cat account-list.txt); do
    zmprov ma $i +amavisBlacklistSender ""
    sleep 5

Similar Threads

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

Posting Permissions

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