QmailtoasterMain Page | About | Help | FAQ | Special pages | Log in

Printable version | Disclaimers | Privacy policy

Convert Vpopmail alias into qmail alias

From Qmailtoaster

From P.V.Anthony <pvanthony@singnet.com.sg>

 ---------------------- valias2dotqmail --------------------------------
 !/bin/bash
 #################################################################
 # script to convert alias stored in database back to .qmail-alias
 #
 # Example.
 # copy the script into the /home/vpopmail/domains/domain.com
 # then run: sh valias2dotqmail
 #
 ################################################################
 # file name for the email alias data.
 aliasFile="email_alias.data"
 # owners of the files
 owner="vpopmail"
 # group of the files
 group="vchkpw"
 # get the domain name from the current directory name
 domainName=$(basename $(pwd))
 # get all the aliases.
 ~vpopmail/bin/valias -s $domainName > $aliasFile
 #do the convert now
 while read addr
 do
       fileName=$(echo $addr | cut -d @ -f 1)
       echo $addr | cut -d " " -f 3 >> .qmail-$fileName
      
       # change the owner and group for the dotqmail file
       chown $owner:$group .qmail-$fileName
      
       # change permission of the dotqmail file
       chmod 600 .qmail-$fileName
      
 done < $aliasFile
 # remove the data as we do not need it anymore
 rm $aliasFile
 --------------------------- end ---------------------------------------

Retrieved from "http://wiki.qmailtoaster.com/index.php/Convert_Vpopmail_alias_into_qmail_alias"

This page has been accessed 4,615 times. This page was last modified on 21 April 2008, at 10:15. Content is available under GNU Free Documentation License 1.2.


Find

Browse
Main page
Community portal
Current events
Recent changes
Random page
Help
Edit
View source
Editing help
This page
Discuss this page
New section
Printable version
Context
Page history
What links here
Related changes
My pages
Log in / create account
Special pages
New pages
File list
Statistics
More...