Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

#!/bin/bash

QUOTA=’1024′

IFS=:
echo “Email Id To Create:”
echo “—————”
while read name email password home_directory
do

PASSWORD=`openssl passwd -1 “$password”`

maildir=`echo “$home_directory” | cut -d”/” -f4`
domain=`echo “$home_directory” | cut -d”/” -f4`
local_part=`echo “$domain” | awk -F “.” ‘{$NF=””;$(NF-1″”)=””}1’ | sed ‘s/ /./g’ | sed ‘s/..$//g’`
DOMAIN=`echo “$domain” | awk -F “.” ‘{print $(NF-1) “.” $NF}’`

echo “INSERT INTO mailbox (username, password, name, storagebasedirectory,storagenode, maildir, quota, domain, active, local_part, created)”
echo “VALUES (‘$email’, ‘$PASSWORD’, ‘$name’, ‘/data’,’mail’, ‘$maildir/’, ‘$QUOTA’, ‘$DOMAIN’, ‘1’, ‘$local_part’, NOW);”
echo “INSERT INTO alias (address, goto, domain, created, active) VALUES (‘$email’, ‘$email’,’$DOMAIN’, NOW, 1);”

done < ./get_email_from