Find the answer to your Linux question:
Results 1 to 3 of 3
I've got a Linux mail server running with about 100 users. I'm adding some Anti-Spam software and I want to have it put the spam into a subfolder of the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2004
    Posts
    13

    How do I create a directory in every home dir?


    I've got a Linux mail server running with about 100 users. I'm adding some Anti-Spam software and I want to have it put the spam into a subfolder of the Maildir folder in each user's home directory. Now I've implemented this in my own account and it works fine. My questions now is how can I add this Spam folder to every existing user's homedir with correct ownership and write permissions? I've already added it to the /etc/skel folder but that won't help my existing users.

  2. #2
    Just Joined! adamdaughterson's Avatar
    Join Date
    Mar 2003
    Location
    Denver, Colorado, USA
    Posts
    78
    Try something like this:

    Code:
    #!/bin/bash
    
    for  home in `awk -F: '{print $6}' /etc/passwd`
    do
       [ -d "$home" ] || continue
       [ -r "$home" ] || continue
       (cd $home; tar xvf archive_to_deploy_to_users.tar)
    done
    exit 0
    I use something similar to convert a bunch of .wav files in an arbitrary directory to .flac.
    Adam Daughterson

  3. #3
    Just Joined!
    Join Date
    Jan 2004
    Posts
    13
    Thanx. That worked.

  4. $spacer_open
    $spacer_close

Posting Permissions

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