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

Re: Piped Commands using virtual LDAP aliases

Expand Messages
  • mouss
    ... remove $alias_maps from virtual_alias_maps. These are two different concepts. there is no command execution in virtual_alias_maps. Thus your
    Message 1 of 7 , Jul 1, 2008
    • 0 Attachment
      Derek Yarnell wrote:
      > On Jun 30, 2008, at 3:41 PM, mouss wrote:
      >
      >> Derek Yarnell wrote:
      >>> I am trying to get postfix to run a piped command from LDAP however
      >>> I am having some troubles as it seems to always append the local
      >>> host name to it so I am guess i am not even down the right path yet.
      >>
      >> http://www.postfix.org/postconf.5.html#myorigin
      >
      >
      >>>
      >>> I am trying to use nisMailAlias, is there anyone out there doing
      >>> this an if so how?
      >>
      >> if the above is not enough, try reading
      >> http://www.postfix.org/DEBUG_README.html#mail
      >>
      >
      > \
      > objectClass: top
      > nisMailAlias
      > umiacsExpire
      > cn: test@...
      > rfc822MailMember: "|/bin/true"
      >
      > [root@claven postfix]# postmap -q test@...
      > ldap:/etc/postfix/ldap-umiacs-mailman.conf
      > "|/bin/true"
      >
      > I have also tried with and without quotes.
      >
      > [root@claven postfix]# grep 26F5918E35 /var/log/maillog
      > Jul 1 10:00:43 claven postfix/smtpd[13454]: 26F5918E35:
      > client=dhcp214.proxy.umiacs.umd.edu[192.168.1.214]
      > Jul 1 10:00:48 claven postfix/cleanup[13458]: 26F5918E35:
      > message-id=<20080701140043.26F5918E35@...>
      > Jul 1 10:00:48 claven postfix/qmgr[13442]: 26F5918E35:
      > from=<derek@...>, size=391, nrcpt=1 (queue active)
      > Jul 1 10:00:48 claven postfix/local[13459]: 26F5918E35:
      > to=<|/bin/true@...>,
      > orig_to=<test@...>, relay=local, delay=14,
      > delays=14/0.01/0/0.01, dsn=5.1.1, status=bounced (unknown user:
      > "|/bin/true")
      > Jul 1 10:00:48 claven postfix/bounce[13460]: 26F5918E35: sender
      > non-delivery notification: BE60518E37
      > Jul 1 10:00:48 claven postfix/qmgr[13442]: 26F5918E35: removed
      >
      > main.cf
      > ----------
      > queue_directory = /var/spool/postfix
      > command_directory = /usr/sbin
      > daemon_directory = /usr/libexec/postfix
      > mail_owner = postfix
      > mydomain = mailman.umiacs.umd.edu
      > myorigin = mailman.umiacs.umd.edu
      > inet_interfaces = all
      > mydestination = $myhostname, localhost.$mydomain, localhost,
      > mailman.umiacs.umd.edu
      > virtual_alias_maps = ldap:/etc/postfix/ldap-umiacs-mailman.conf
      > $alias_maps

      remove $alias_maps from virtual_alias_maps. These are two different
      concepts. there is no command execution in virtual_alias_maps. Thus your
      "|/bin/tru@..." problem.

      > unknown_local_recipient_reject_code = 450
      > alias_maps = hash:/etc/aliases
      > alias_database = hash:/etc/aliases
      > debug_peer_level = 2
      > debugger_command =
      > PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
      > xxgdb $daemon_directory/$process_name $process_id & sleep 5
      > sendmail_path = /usr/sbin/sendmail.postfix
      > newaliases_path = /usr/bin/newaliases.postfix
      > mailq_path = /usr/bin/mailq.postfix
      > setgid_group = postdrop
      > html_directory = no
      > manpage_directory = /usr/share/man
      > sample_directory = /usr/share/doc/postfix-2.3.3/samples
      > readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
      >
      > ---
      > Derek T. Yarnell
      > University of Maryland
      > Institute for Advanced Computer Studies
      > derek@...
      >
      >
    • Victor Duchovni
      ... Also the lookup key for alias expansion in local(8) is just the user name. Exactly as with the local aliases file: user: |/bin/true not user@example.com:
      Message 2 of 7 , Jul 1, 2008
      • 0 Attachment
        On Tue, Jul 01, 2008 at 05:36:23PM +0200, mouss wrote:

        > >[root@claven postfix]# postmap -q test@...
        > >ldap:/etc/postfix/ldap-umiacs-mailman.conf
        > >"|/bin/true"
        >
        > remove $alias_maps from virtual_alias_maps. These are two different
        > concepts. there is no command execution in virtual_alias_maps. Thus your
        > "|/bin/tru@..." problem.

        Also the lookup key for alias expansion in local(8) is just the user
        name. Exactly as with the local aliases file:

        user: "|/bin/true"

        not

        user@...: "/bin/true"

        --
        Viktor.

        Disclaimer: off-list followups get on-list replies or get ignored.
        Please do not ignore the "Reply-To" header.

        To unsubscribe from the postfix-users list, visit
        http://www.postfix.org/lists.html or click the link below:
        <mailto:majordomo@...?body=unsubscribe%20postfix-users>

        If my response solves your problem, the best way to thank me is to not
        send an "it worked, thanks" follow-up. If you must respond, please put
        "It worked, thanks" in the "Subject" so I can delete these quickly.
      • Derek Yarnell
        ... Sorry for the confusion, i found what i was looking for. Aliases that I wanted to keep in ldap (even piped commands) can obviously only be in the form
        Message 3 of 7 , Jul 1, 2008
        • 0 Attachment

          On Jul 1, 2008, at 11:36 AM, mouss wrote:

          remove $alias_maps from virtual_alias_maps. These are two different concepts. there is no command execution in virtual_alias_maps. Thus your "|/bin/tru@..." problem.

          Sorry for the confusion, i found what i was looking for. 

          Aliases that I wanted to keep in ldap (even piped commands) can obviously only be in the form specifically of user (and not user@domain).  The map should be in appened to the lookup on $alias_maps and not virtual_alias_maps.

          Again, sorry and thanks for the help
          derek

          ---
          Derek T. Yarnell
          University of Maryland
          Institute for Advanced Computer Studies
          derek@...

        Your message has been successfully submitted and would be delivered to recipients shortly.