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

206367Re: relay_recipients_maps / generic clash

Expand Messages
  • Sandy Drobic
    Oct 3, 2006
      John Knappers wrote:

      >>> Now the problem is completely claer, can you (or anyone else) assist
      >>> me with the awk script additions to do this, because my scripting
      >>> knowledge is not suffient for this. :(
      >> Is user1@... the same as user1@...?
      > Not always,
      > Depents on how generic table. This makes it more difficult

      Not much more difficult. You only have to add another decision.

      >>> I have a relay_recipients_maps with all valid mail addresses, but
      >>> only for the consolidated domains, and I have a generic_maps file,
      >>> with what olddomains will be rewritten to what newdomains.
      >>> Or is there an other around / better way solve this setup problem?
      >> So you just need to grab the local part of each address in the incomplete
      >> relay_recipient_maps and add the generics domains to it, write the
      >> address
      >> into a new file and then postmap it and set it up as
      >> relay_recipient_maps.
      >> # 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

      > Tonight I'm gonna try this.
      > This looks almost complete, but now every user has an mailaddress in
      > every oldmaildomain. If this the limit for scripting maybe I need to
      > accept this compromise.

      See above. You can do almost anything with scripting/programming. What you
      haven't seen is, that while the script will probably do exactly what you
      want, there are no checks to verify that the script will only produce the
      desired output.

      One example is that the script assumes that there are NO empty lines in
      in_complete_relay_recipient_maps. If an empty line is processed by that
      script then the result would be...
      @... OK
      @... OK

      Which would make all the effort go to waste. The grep command will also
      take care of that, since only lines which have example.com in it are given
      to the script to be processed.

      >> If you have a long list to process you might want to use a perl
      >> script. This shell script is not the fastest.
      > The table is not to large, So I think shell scripting will do for me,
      > But if someone is willing to write a perl script for this, it would
      > maybe a good idea to publish it somewhere in the howto and faqs page on
      > the postfix website. The their effort servers a larger comunity.

      Everyone has different needs, so it's just not practical to post a script
      for general usage. The only common basis is that you have a file with
      valid addresses.

      >>> I accept only mail for the standard aliases which RFC want to be
      >>> present (postmaster /abuse / etc)
      >>> If the mailaddress@$myhostname doesn't resolve to a valid
      >>> mailaddress, it bounce with user unknown. What is the problem with
      >>> it? Or better asked: Do I miss anything, what I shouldn't miss?
      >> Does it really REJECT mails to invalid addresses or does it accept the
      >> mails first and then BOUNCE the mails to the forged sender of the spam?
      > You mean if you don't specify a local_repipient_maps, mail for non local
      > users will be accepted and rejected afterwards, resulting that my
      > gatewaymailserver is responsible for delivering the Delvery
      > Notification, which of cause fail by faked sender addresses?
      > I will check this out.

      No, if you don't specify a local_recipient_maps, the DEFAULT value for
      local_recipient_maps is used. "postconf -d local_recipient_maps" gives
      local_recipient_maps = proxy:unix:passwd.byname $alias_maps

      If you specifically add "local_recipient_maps = ", you deactivate the
      default with the result that no local_recipient_maps is checked.

      Please check carefully if you bounce or actually reject. According to your
      setup I would say you bounce (accept and later reject the complete mail).

      List replies only please!
      Please address PMs to: news-reply2 (@) japantest (.) homelinux (.) com
    • Show all 15 messages in this topic