Loading ...
Sorry, an error occurred while loading the content.

206531Re: relay_recipients_maps / generic clash

Expand Messages
  • John Knappers
    Oct 4, 2006
    • 0 Attachment
      >John Knappers wrote:
      >
      >
      >>>
      >>># Just add these lines to your script
      >>>#
      >>>domains=("@..." "@..." "@...")
      >>>#
      >>>cat in_complete_relay_recipient_maps | while read line;
      >
      >grep "example.com" cat in_complete_relay_recipient_maps | while read line;
      >
      >>>do
      >>>{
      >>> user_name=`echo $line|cut -f1 -d"@"`
      >>> for i in `echo ${domains[*]}`; do
      >>> echo -e "$user_name$i" >> /etc/postfix/relay_recipients
      >>> done
      >>>}
      >>>done
      >
      >Do another grep run for the other domain and adapt the domains list. There
      >are many ways to do this, but this is probably the easiest for you to
      >understand.
      >
      >>>
      >>Tonight I'm gonna try this.
      I'm trying to create a nice script out of you suggetions, ans it start to
      work ! :)
      I changed: grep "example.com" cat in_complete_relay_recipient_maps | while
      read line;
      in cat relay_recipients_imcomplete_smal |grep "domain1.com" | while read
      line;
      and
      # echo -e "$user_name$i" >>
      /home/john/testing/relay_recipients_smal in
      printf "$user_name$i\tOK\n" >>
      /home/john/testing/relay_recipients_smal
      (was missing the tab and OK)

      But there is one thing left I can't get fixed.
      domains=("@..." "@..." "@...")
      It would be nice it read this list out of the generic file(s). But I failed
      to do so.
      At the comand line I was able to at get the following output:
      "@..." "@..." "@..."
      with the syntax:
      awk '!length < 1 && !/#/ && /@/h {printf ("\"%s\" ",$1)}' generic_smal
      But is still misses the ( ) surrounding the domain list and adding the line:
      domains=awk '!length < 1 && !/#/ && /@/h {printf ("\"%s\" ",$1)}'
      generic_smal
      causes the script to fail
      Sandy, do you know how to do this right?
      Thanx for you efford.

      John

      _________________________________________________________________
      Ontmoet nieuwe vrienden via je eigen vrienden! http://spaces.live.com
    • Show all 15 messages in this topic