Vpopmail - roaming users configuration and Enable/Disable POP3/SMTP/IMAP/Webmail access for a whole domain: Difference between pages

From QmailToaster
(Difference between pages)
Jump to navigation Jump to search
(Created page with "===Vpopmail - roaming users configuration=== If you want to use the vpopmail roaming users configuration option here area few steps to follow : 1. rpm -Uvh vpopmail-toaster*.src.rpm go to (if you didnt set your own .rpmmacros config) /usr/src/redhat/SPECS and edit the file vpopmail-toaster.spec look for the configure options .. (./configure --prefix ....) line and change --disable-roaming-users into --enable-roaming-users .. If you want to add/re...")
 
(Created page with "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 acc...")
 
Line 1: Line 1:
===[[Vpopmail - roaming users configuration]]===
Below is a set of scripts to enable/disable POP3, SMTP, IMAP/Webmail and relaying for every user in a given domain.


If you want to use the vpopmail roaming users configuration option
Create a script file, paste the code, and chmod +x it and you are done.
here area  few steps to follow :


1. rpm -Uvh vpopmail-toaster*.src.rpm
Enjoy!
  go to (if you didnt set your own .rpmmacros config) /usr/src/redhat/SPECS
  and edit the file vpopmail-toaster.spec
  look for the configure options ..
  (./configure --prefix ....) line and change --disable-roaming-users
  into --enable-roaming-users ..
  If you want to add/remove other options do it now..


2. rpmbuild -bb --with [your_distro] vpopmail-toaster.spec
[Credits to Eric Shubert for the original scripting.]
  just wait after issuing that command
  cd ../RPMS/i386
  STOP qmail : /etc/init.d/qmail stop  or qmailctl stop
  rpm -Uvh --replacefiles --replacepkgs vpopmail-toaster*.rpm
  IF you keep RPMS make sure you point to the one you just rebuilt not
  and old one ...
  START qmail : /etc/init.d/qmail start  or qmailctl start


3. The roaming system authorize a user who authentificated (pop3 before smtp)
  the right to relay, it adds your ip to the cdb file
  /etc/tcprules.d/tcp.smtp.cdb .. This file must be owned by vpopmail.vchkpw
  do this now :
  chown vpopmail.vchkpw /etc/tcprules.d/tcp.smtp.cdb


  Then edit /etc/init.d/qmail
----
  look for the section cdb) :
#!/bin/sh
    cdb)
# script to change settings for all users in a domain
    tcprules /etc/tcprules.d/tcp.smtp.cdb /etc/tcprules.d/tcp.smtp.tmp < /etc/tcprules.d/tcp.smtp
# and disable POP3/SMTP/IMAP/Webmail Access.
    chmod 644 /etc/tcprules.d/tcp.smtp*
  # SM - 24/11/10
add here -> '''chown vpopmail.vchkpw /etc/tcprules.d/tcp.smtp.cdb'''  <-
    echo "Reloaded /etc/tcprules.d/tcp.smtp" 


The purpose of this, whenever you reload your cdb files
# USAGE> ./disable_domain.sh yourdomain.net
it will give you the proper rights and ownership on the file


4. By default it is 3 hours (180mins) authorization after pop authentification
domain=$1
  for roaming users
  I d suggest to set a crontab to check the ips allowed to relay
  I chose every 30mins
  0,30 * * * * /home/vpopmail/bin/clearopensmtp


  NB: you could change the default time by adding this configure option :
vpmdir=/home/vpopmail
      --enable-relay-clear-minutes=#  to the spec file


Also note that roaming access is only available to users checking mail via POP3. If you have users who connect via POP3-SSL, IMAP, or IMAP-SSL they are ''not'' added to the list of authenticated users. See this thread for more info: http://www.mail-archive.com/vchkpw@inter7.com/msg24375.html
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

Latest revision as of 10:30, 16 March 2024

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