Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
04-17-2008, 10:25 PM
|
#1
|
Member
Registered: May 2003
Location: Canada
Distribution: Debian
Posts: 105
Rep:
|
Postfix: Rewriting sender email address from ldap lookups
Hi,
I'm trying to setup postfix to rewrite a sender address from
userid@hostname.domain.com to firstname.lastname@domain.com
Basically just rewriting entire address to the userid's email address from ldap.
Can anyone give me some tips on how I might do this?
Thanks!
Last edited by endfx; 04-17-2008 at 10:29 PM.
|
|
|
04-18-2008, 10:26 AM
|
#2
|
Member
Registered: May 2003
Location: Canada
Distribution: Debian
Posts: 105
Original Poster
Rep:
|
This is what I've got so far:
In main.cf:
canonical_maps = ldap:/etc/postfix/ldap-canonical.cf
In ldap-canonical.cf:
server_host = ldap.domain.com
search_base = ...
bind = yes
bind_dn = ...
bind_pw = ...
query_filter = sAMAccountName=%u
result_attribute = mail
I take the above two lines to mean:
find the ldap entry that has sAMAccountName = to the local part of the sender address (eg: userid from userid@pcname).
Use the "mail" entry as the result address. Am I wrong here?
I think it's authenticating just fine but I'm getting the following error in my log file:
warning: dict_ldap_lookup: Search error 9: Partial results and referral received
Apr 18 09:22:15 pcname postfix/cleanup[32577]: warning: 10C2A7BC464: canonical_maps map lookup problem for userid@pcname
This should be a pretty simple task ... any postfix admins have any thoughts?
|
|
|
04-18-2008, 12:48 PM
|
#3
|
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep: 
|
Can you show us a relevant ldap entry?
|
|
|
04-18-2008, 03:53 PM
|
#4
|
Member
Registered: May 2003
Location: Canada
Distribution: Debian
Posts: 105
Original Poster
Rep:
|
I got it working with a little googling ...
My LDAP server is Active Directory running on MS Server 2003.
I added:
version = 3
to my ldap-canonical.cf file and everything started working.
I guess postfix defaults to version 2 and AD on MS Server 2003 uses version 3.
Hopefully this helps someone else out there.
|
|
|
All times are GMT -5. The time now is 07:29 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|