Create User defaults

Usermin
Sharprez
2014-01-16
2014-01-16
  • Sharprez
    Sharprez
    2014-01-16

    When I use the Virtualmin to remote API to create-user...
    I want to put a pre-configured .procmail file in the .../homes/user directory.

    Any ideas how to get that done?

    Thanks!

     
  • Sharprez
    Sharprez
    2014-01-16

    I found my answer... thought it best to share and not waste someone elses time answering my question, and I'm hoping someone else can benefit too. :)

    Virtualmin -> System Settings -> Virtualmin Configuration -> Action upon server and user creation -> Command to run after making changes to an alias

    This runs a script after creating or modifying a domain or its users... so my script has to filter the function for creating users only (shown below).

    if test $USERADMIN_DOM = "{DOM}" &&
    test $USERADMIN_ACTION=CREATE_USER &&
    test $ALIAS_ACTION=CREATE_ALIAS
    then
    PROC="$USERADMIN_HOME/.procmail"
    cp /home/{DOM}/homes/procmailrc $PROC
    fi

    I looked a long time for a solution... it was not easy to find that this is where you can hook scripts into the user functions.

    Cheers!
    -Dan
    http://sharprez.com
    http://www.NoBadMail.com

     
    Last edit: Sharprez 2014-01-16