Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
fastforward not working? - heres a workaround
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
flow666
n00b
n00b


Joined: 01 Jul 2003
Posts: 74
Location: Diepholz

PostPosted: Fri Oct 22, 2004 3:52 pm    Post subject: fastforward not working? - heres a workaround Reply with quote

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."
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum