Piped Commands using virtual LDAP aliases

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Piped Commands using virtual LDAP aliases

Derek Yarnell
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.

I am trying to use nisMailAlias, is there anyone out there doing this an if so how?

Thanks,
derek

---
Derek T. Yarnell
University of Maryland
Institute for Advanced Computer Studies
[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Piped Commands using virtual LDAP aliases

Magnus Bäck
On Monday, June 30, 2008 at 16:39 CEST,
     Derek Yarnell <[hidden email]> 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.

Append the local host name to what?

> I am trying to use nisMailAlias, is there anyone out there doing this
> an if so how?

Use nisMailAlias for what?

Please show logs and configuration.

http://www.postfix.org/DEBUG_README.html#mail

Hint: Implement what you want without using LDAP first (i.e. by using
flat text files). When that works to your liking, translate this to
LDAP. Debug one thing at a time.

--
Magnus Bäck
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Piped Commands using virtual LDAP aliases

mouss-2
In reply to this post by Derek Yarnell
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
Reply | Threaded
Open this post in threaded view
|

Re: Piped Commands using virtual LDAP aliases

Derek Yarnell
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: [hidden email]
rfc822MailMember: "|/bin/true"

[root@claven postfix]# postmap -q [hidden email] 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=<[hidden email]>
Jul  1 10:00:48 claven postfix/qmgr[13442]: 26F5918E35: from=<[hidden email]>, size=391, nrcpt=1 (queue active)
Jul  1 10:00:48 claven postfix/local[13459]: 26F5918E35: to=<[hidden email]>, orig_to=<[hidden email]>, 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
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
[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Piped Commands using virtual LDAP aliases

mouss-2
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: [hidden email]
> rfc822MailMember: "|/bin/true"
>
> [root@claven postfix]# postmap -q [hidden email]
> 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=<[hidden email]>
> Jul  1 10:00:48 claven postfix/qmgr[13442]: 26F5918E35:
> from=<[hidden email]>, size=391, nrcpt=1 (queue active)
> Jul  1 10:00:48 claven postfix/local[13459]: 26F5918E35:
> to=<|/bin/[hidden email]>,
> orig_to=<[hidden email]>, 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
> [hidden email]
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Piped Commands using virtual LDAP aliases

Victor Duchovni
On Tue, Jul 01, 2008 at 05:36:23PM +0200, mouss wrote:

> >[root@claven postfix]# postmap -q [hidden email]
> >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

        [hidden email]: "/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:[hidden email]?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.
Reply | Threaded
Open this post in threaded view
|

Re: Piped Commands using virtual LDAP aliases

Derek Yarnell
In reply to this post by mouss-2

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
[hidden email]