Mailbox lists ?

h2d

Verified User
Joined
Aug 11, 2006
Messages
103
Im assuming the way directadmin is setup there is no file containing a list of mailboxes to accept mail for ?

Has anyone written a a crazy crack script that can get this information and pipe it into a file?

Does anyone know if DA plan on keeping such information in a database ( the most sensible thing to do ) in the future ?

I havent really seen any major features come out since ive been using it, maybe its in the pipelines ?
 
DirectAdmin starts off accepting email for admin, and when you set up users and resellers it can accept email for them as well.

What else are you trying to do?

Jeff
 
Thanks, Jeremy. You're probably right.

If so, the answer is no. My personal opinion is that DA is much more reliable specifically because it doesn't rely on it's own files but instead simply manipulates server files.

I had a lot of horror stories when i used Sun Cobalt RaQ servers which kept everything in database files.

Jeff
 
I agree Jeff. If the data is stored in a database, then you have a greater risk of the database and what's actually on the server being out of sync. I think if he really needed this information, he or someone with good bash scripting skills could craft a script to get this info.
 
you are right, basically i want to create a file with all mail boxes in it, for the sake of a secure seconday mail service :)

and yes i think it could be done with some bash hackery, however i thought i would see if anyone else has come up with something to save me the headache :)
 
OK, I'm a bit late coming to this thread!

Have you got the script yet?

If not, I'm sure i can do!

ie
go to /var/spool/virtual directory
iterate thru all entries
if directory then add contents to list

how would you like the list formatted?
(and do you want the system accounts too?)
 
nope i havent got around to doing it yet
if you want to, sure thing !
system accounts would be handy also :)

list format , single email address per line :)
 
Last edited:
How does this look?

I haven't included the system accounts but that would be a simple addition.
I'm also not sure that this doesn't include forwarders or mail boxes that have been created but not yet used.

Output is currently to the screen only. I'm sure you can add suitable redirection.

Give it a try and see what you think!

Code:
cd /var/spool/virtual
for DOMAIN in *
do
  if [ -d $DOMAIN ]
  then
    cd $DOMAIN
    for MAILBOX in *
    do
      if [ $MAILBOX != '*' ]
      then
         echo $MAILBOX@$DOMAIN
      fi
    done
    cd ..
  fi
done

PS. I'm sure there are some better BASH hackers that could make a better job of it! If I was doing ot for myself I'd probably write a PASCAL program, compile with FPC and direct the output to a database.
 
Back
Top