flow666 n00b

Joined: 01 Jul 2003 Posts: 74 Location: Diepholz
|
Posted: Fri Oct 22, 2004 3:52 pm Post subject: fastforward not working? - heres a workaround |
|
|
Hi,
After a long time trying around to get fastforward for qmail working, i have the clue, that it doesn't works when you use qmail in connection with vpopmail. So i decided to build a workaround. We wrote a Script, which converts all the entries of an sendmail-style /etc/aliases file to dot-qmail files.
You need to have an directory named "dq", in which the script puts all the files, because then it is easier to delete them, when something goes wrong. Comments in the aliases file are allowed but they have to be in a single line.
But: Please try out fastforward first - its a much cleaner solution.
Code: | #!/bin/sh
# This Script converts sendmail-style alias files to dot-qmail-files.
# It is not recommended to use this if you are able to use fastforward.
# (c) 2004 by Florian Flachmeier, Hannes Tegeler, No Warrenty, Public Domain
# Read Input
input=$(cat $1)
# Read the specified Line
function rda {
echo "$input" | sed -e "s|\#.*||g" |grep .*: |grep -n .*: |grep "^${ln}:" | sed -e "s|^[0-9]*:||g"
}
function lca {
echo "$input" | sed -e "s|\#.*||g" |grep .*: |wc -l
}
# Extract Alias Name
function extaln {
rda | sed -e "s|:[[:space:]].*||g"
}
# Extract Alias Value
function extalv {
rda | sed -e "s|^.*:[[:space:]]\{1,255\}||g"
}
# Do Something
for ln in $(seq 1 $(lca)); do
echo "$(extalv)" >dq/.qmail-$(extaln)
done
exit 0 |
_________________ Ringwald's Gesetz der Haushaltsgeometrie:
"Alle horizontalen Flächen werden in kurzer Zeit mit Gerümpel bedeckt." |
|