You probably want to modify the config vars (first lines). The script will append whatever generates to existent postfix config files.
#!/bin/shvpopmail_dir="/usr/local/vpopmail/domains"pfix_cfgdir="/usr/local/etc/postfix"pfix_vdomains="${pfix_cfgdir}/virtual_domains"pfix_valiases="${pfix_cfgdir}/virtual_alias"pfix_vmboxes="${pfix_cfgdir}/virtual"pfix_dbfmt="cdb"postmap="postmap"(cd $vpopmail_dir &&/bin/ls -1 | sed "s/^\(.*\)\$/\1 OK/w ${pfix_vdomains}" |awk '{ print $1; }' |\while read domain; dofind $domain -name ".qmail-*" -maxdepth 1 -mindepth 1 | \grep -v 'default' | sed 's/^.*\/.qmail-/ /' | \while read emaddr ; do(echo -n "$emaddr@$domain "; grep -E '^&' $vpopmail_dir/$domain/.qmail-$emaddr | \sed -n 's/^\&//;1h;2,$H;${g;s/\n/,/g;p;}') >>${pfix_valiases}donedonefind * -type d -maxdepth 1 -mindepth 1 | \sed 's/\([^\/]*\)\/\(.*\)$/\2\@\1 \1\/\2\/Maildir\//' >>${pfix_vmboxes})( cd ${pfix_cfgdir} &&for cf in ${pfix_vdomains} ${pfix_valiases} ${pfix_vmboxes} ; do${postmap} -c `pwd` ${pfix_dbfmt}:$cfdone)
No comments:
Post a Comment