Antw: SMTP Auth + SASL + PAM + LDAP

"Andre Schild" <[email protected]> Mon, 27 Sep 2004 12:27:44 +0200
Newsgroups gmane.mail.jamm.user
Message-ID <[email protected]>
Sorry,

of course in main.cf it's:

smtpd_use_tls = yes

André


>>> [email protected] 27.09.2004 12:06:01 >>>
Hi

I need to get SMTP Auth working with SASL, PAM & LDAP. I using Debian
Woody R2 and as the Open LDAP packages are compiled with SASL pre
version 2. Using SASL2 is out of the question. Postfix fails after
compiling with LDAP & TLS patch as it gets conflicting versions. Very
nasty and some really weird error messages in the logs. So I've been
forced to down grade to the Debian Postfix 1.1 packages and jamm is
happily working after a pulling my original main.cf file for 1.1 from my
archives, but I still need to get SMTP auth working.

I have spent most of the day searching and have found a few articles to
help out but I'm still getting authentication errors from the logs. My
config as follows:

Main.cf

append_dot_mydomain = no
myhostname = vectra.rdac.com.au
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = vectra.rdac.com.au, localhost, $transport_maps
relayhost = 
mynetworks = 127.0.0.0/8
mailbox_command = /usr/bin/procmail
mailbox_size_limit = 0
recipient_delimiter = +
# SMTP Auth
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
smtpd_recipient_restrictions = permit_sasl_authenticated,
check_relay_domains
#For STARTTLS SMTP
smtpd_tls_cert_file = /etc/postfix/cert.pem
smtpd_tls_key_file = /etc/postfix/key.pem
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
#
virtual_maps = ldap:aliases, ldap:accountsmap
local_recipient_maps = $alias_maps unix:passwd.byname
$virtual_mailbox_maps
transport_maps = ldap:transport
transport_server_host = localhost
transport_search_base = o=hosting,dc=rdac,dc=com,dc=au
transport_query_filter =
(&(jvd=%s)(objectClass=JammVirtualDomain)(accountActive=TRUE)(delete=FAL
SE))
transport_result_attribute = postfixTransport
transport_cache = yes
transport_bind = no
transport_scope = one
aliases_server_host = localhost
aliases_search_base = o=hosting,dc=rdac,dc=com,dc=au
aliases_query_filter =
(&(objectClass=JammMailAlias)(mail=%s)(accountActive=TRUE))
aliases_result_attribute = maildrop
aliases_bind = no
aliases_cache = yes
accounts_server_host = localhost
accounts_search_base = o=hosting,dc=rdac,dc=com,dc=au
accounts_query_filter =
(&(objectClass=JammMailAccount)(mail=%s)(accountActive=TRUE)(delete=FALS
E))
accounts_result_attribute = mailbox
accounts_cache = yes
accounts_bind = no
#catch all
accountsmap_server_host = localhost
accountsmap_search_base = o=hosting,dc=rdac,dc=com,dc=au
accountsmap_query_filter =
(&(objectClass=JammMailAccount)(mail=%s)(accountActive=TRUE)(delete=FALS
E))
accountsmap_result_attribute = mail
accountsmap_cache = yes
accountsmap_bind = no
#Virtual accounts
virtual_mailbox_base = /home/vmail/domains
virtual_mailbox_maps = ldap:accounts
virtual_minimum_uid = 104
virtual_uid_maps = static:104
virtual_gid_maps = static:103

I have created /etc/pam.d/smtp and it contains:

#%PAM-1.0
auth required /lib/security/pam_ldap.so
account required /lib/security/pam_ldap.so
password required /lib/security/pam_ldap.so use_authtok
session required /lib/security/pam_ldap.so

I have created /etc/postfix/sasl/smtpd.conf and it contains:

pwcheck_method: pam

Pam_ldap.conf

host 127.0.0.1
base o=hosting,dc=rdac,dc=com,dc=au
ldap_version 3
rootbinddn cn=manager,dc=rdac,dc=com,dc=au

Binddn password is in /etc/ldap.secret

I have stopped stmpd from running in a chroot jail as well. I'm getting
the following error in mail.log

Sep 27 17:37:05 vectra postfix/smtpd[25867]: connect from
portege.rdac.com.au[192.168.0.34]
Sep 27 17:37:05 vectra postfix/smtpd[25867]: warning:
portege.rdac.com.au[192.168.0.34]: SASL LOGIN authentication failed
Sep 27 17:37:10 vectra postfix/smtpd[25867]: disconnect from
portege.rdac.com.au[192.168.0.34]

I think I need to adjust the pam_ldap.conf file to look for the right
type of Jamm object or the smtpd_sasl_local_domain = $myhostname in
main.cf is worng. I'm really stuck in a bind here, any body got some
suggestions on how to get this resolved?

Thanks
___________________________________________
John Dunsire
Senior Systems Engineer - RDA Computing Services


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php 
_______________________________________________
Jamm-users mailing list
[email protected] 
https://lists.sourceforge.net/lists/listinfo/jamm-users


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php