QmailtoasterMain Page | About | Help | FAQ | Special pages | Log in

Printable version | Disclaimers | Privacy policy

Enable/Disable POP3/SMTP/IMAP/Webmail access for a whole domain

From Qmailtoaster

Below is a set of scripts to enable/disable POP3, SMTP, IMAP/Webmail and relaying for every user in a given domain.

Create a script file, paste the code, and chmod +x it and you are done.

Enjoy!

[Credits to Eric Shubert for the original scripting.]



#!/bin/sh
# script to change settings for all users in a domain
# and disable POP3/SMTP/IMAP/Webmail Access.
# SM - 24/11/10
# USAGE> ./disable_domain.sh yourdomain.net
domain=$1
vpmdir=/home/vpopmail
acctlist=$(find $vpmdir/domains/$domain -mindepth 1 -maxdepth 1 -type d)
for acctpath in $acctlist; 
do
   account=${acctpath##*/}
   address=$account@$domain
   echo "changing $address"
   $vpmdir/bin/vmoduser -p -s -w -i -r $address
done



#!/bin/sh
# script to revert change settings for all users in a domain
# and enable POP3/SMTP/IMAP/Webmail Access.
# SM - 24/11/10
# USAGE> ./UNDO_disable_domain.sh yourdomain.net
domain=$1
vpmdir=/home/vpopmail
acctlist=$(find $vpmdir/domains/$domain -mindepth 1 -maxdepth 1 -type d)
for acctpath in $acctlist; 
do
  account=${acctpath##*/}
  address=$account@$domain
  echo "changing $address"
   $vpmdir/bin/vmoduser -x $address
done

Retrieved from "http://wiki.qmailtoaster.com/index.php/Enable/Disable_POP3/SMTP/IMAP/Webmail_access_for_a_whole_domain"

This page has been accessed 7,156 times. This page was last modified on 7 August 2012, at 00:38. Content is available under GNU Free Documentation License 1.2.


Find

Browse
Main page
Community portal
Current events
Recent changes
Random page
Help
Edit
View source
Editing help
This page
Discuss this page
New section
Printable version
Context
Page history
What links here
Related changes
My pages
Log in / create account
Special pages
New pages
File list
Statistics
More...