Configurare server mail con dap

562 risposte [Ultimo contenuto]
Ritratto di Ricca
Ricca
(Junior)
Offline
Junior
Iscritto: 10/01/2007
Messaggi: 45

Ciao a tutti

ultimamente ho configurato un server samba con backend ldap;

ora vorrei aggiungere anche un server mail per gestire le mail degli utenti , avevo pensato di usare postfix ( cercando su google mi è sembrato di capire che sia più semplice da configurare e abbastanza sicuro), ma non sono riuscito a trovare una guida che descrivesse questa situazione.

Qualcuno a qualche idea, oppure sa indicarmi qualche howto che possa essermi utile?

Grazie in anticipo a tutti

Ciao

Ritratto di ferdybassi
ferdybassi
(Geek)
Offline
Geek
Iscritto: 25/10/2006
Messaggi: 195

Hey, ci si rivede anche qui Wink
Purtroppo non ho avuto tempo di mettermi a lavorare su questa cosa, come ti avevo detto su suseitalia, e quindi il tutto resta fermo alla guida che hai trovato su debianizzati.
Sono anche io alla ricerca di qualche aiuto...
Ciao ciao.

EDIT:
http://www.postfix.org/LDAP_README.html
http://gentoo-wiki.com/HOWTO_Postfix-LDAP_virtual_users_with_qmail_schema
http://www.developpez.net/forums/showthread.php?t=34866

Ritratto di Ricca
Ricca
(Junior)
Offline
Junior
Iscritto: 10/01/2007
Messaggi: 45

Ciao

grazie per i link che hai segnalato, fonti nuove di informazioni sono sempre graditissime.. Wink

Se ti può interessare ho trovato anche questo

http://hierax.net/wiki/Postfix

Speriamo di riuscire a spuntarla....

Ciao

Ritratto di paolo
paolo
(Webmaster)
Offline
Webmaster
Iscritto: 04/10/2004
Messaggi: 1277

Sarebbe graditissima, da parte di tutta la comunità, quando l'avrete spuntata, su come configurare postfix + ldap Smile

Attendo fiducioso

Paolo Mainardi
CTO Twinbit http://www.twinbit.it
Vice Presidente -- ILDN - Italian Linux DIstro Network

Ritratto di ferdybassi
ferdybassi
(Geek)
Offline
Geek
Iscritto: 25/10/2006
Messaggi: 195

Ok.
Per adesso in questo fine settimana, se ti va, posso riadattare la guida che ho pubblicato su Debianizzati.org su come impostare un Controller Samba per un dominio Windows usando Debian Sarge (o superiori).
Spero di poter fornire, a breve, anche una guida su come integrare anche Postfix.
Ciao ciao.

Ritratto di Ricca
Ricca
(Junior)
Offline
Junior
Iscritto: 10/01/2007
Messaggi: 45

Magari riuscire a spuntarla... Sad

cmq se ci riesco vi facco sapere.

Ciao a tutti

Ritratto di Ricca
Ricca
(Junior)
Offline
Junior
Iscritto: 10/01/2007
Messaggi: 45

qui ho trovato quello che più risponde a ciò che avrei in mente

http://hannibal.solstice.nl/version-2.0/on_debian/hannibal-3.0_on-debian-sarge_2004-04-02.html

Ancora ci sto impazzendo ma chissà che prima o poi...

Ritratto di Ricca
Ricca
(Junior)
Offline
Junior
Iscritto: 10/01/2007
Messaggi: 45

Dopo non poche nottate passate tra prove e ricerche su google sto ancora cercando di venire a capo del problema....
Seguendo diversi howto sono riuscito a correggere diversi errori nela configurazione ma ora, ogni volta che provo a collegarmi al server per inviare una mail ricevo sempre l'errore "Temporary lookup failure". In mail.log trovo:

Quote:

Apr 1 14:54:14 kwserver authdaemond: modules="authldap", daemons=5
Apr 1 14:54:14 kwserver authdaemond: Installing libauthldap
Apr 1 14:54:14 kwserver authdaemond: Installation complete: authldap
Apr 1 14:54:24 kwserver postfix/master[2738]: daemon started -- version 2.3.8, configuration /etc/postfix
Apr 1 14:54:25 kwserver smtpguard-daemon: info: main_daemon: load config file /etc/smtpguard/smtpguard.conf
Apr 1 14:59:54 kwserver postfix/smtpd[3119]: warning: queue_minfree(2048000) should be at least 1.5*message_size_limit(2048000)
Apr 1 14:59:54 kwserver postfix/smtpd[3119]: connect from kwserver.keyword.loc[192.168.0.240]
Apr 1 15:01:38 kwserver postfix/smtpd[3119]: warning: dict_ldap_connect: Unable to bind to server ldap://localhost:389 as cn=maildaemon,dc=keyword,dc=loc: 2 (Protocol error)
Apr 1 15:01:38 kwserver postfix/smtpd[3119]: NOQUEUE: reject: RCPT from kwserver.keyword.loc[192.168.0.240]: 451 4.3.0 <riccardo@keyword.loc>: Temporary lookup failure; from=<prova@gmail.com> to=<riccardo@keyword.loc> proto=ESMTP helo=<keyword.loc>
Apr 1 15:06:38 kwserver postfix/smtpd[3119]: timeout after RCPT from kwserver.keyword.loc[192.168.0.240]
Apr 1 15:06:38 kwserver postfix/smtpd[3119]: disconnect from kwserver.keyword.loc[192.168.0.240]

Ho provato a fare il bind sul server ldap anche come admin ma ho ricevuto lo stesso errore.. Sad

Cercando sempre su google mi è parso di capire che potrebbe essere più un preblema di ldap che non postfix, ma come ho detto anche facendo il bind come admin ricevo lo stesso errore.

Qualche suggerimento????

questo è il mio main.cf:

Quote:

# see /usr/share/postfix/main.cf.dist for a commented, fuller
# version of this file.
##########################
biff = no
smtpd_banner = $mydomain ESMTP NO UCE (I already got one.)

#directories
##########################
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/lib/postfix
program_directory = /usr/lib/postfix
queue_directory = /var/spool/postfix

#to prevent multiple deliveries to same account
##########################
default_destination_concurrency_limit=1
local_destination_concurrency_limit = 1

#limits raise them according to your memory
##########################
default_process_limit = 5
deliver_lock_attempts = 10
deliver_lock_delay = 2s
in_flow_delay = 1s
#prevent Postfix from locking up the system
queue_minfree = 2048000
inet_interfaces = 127.0.0.1, 192.168.0.240

#limits spam
##########################
header_size_limit = 1000
disable_vrfy_command = yes
strict_rfc821_envelopes = yes
#requires valid mailers
smtpd_helo_required = yes
recipient_delimiter = +
allow_percent_hack = no
swap_bangpath = no

# perform header and body checks, e.g. for virus or spam blocking
##########################
header_checks = regexp:/etc/postfix/header_checks
body_checks = regexp:/etc/postfix/body_checks

# limit message size to 200 KB
#2mb
##########################
message_size_limit = 2048000

#black hole listed sites
#freebies
##########################
map_rbl_domains =
#old
inputs.orbz.org,
dialups.mail-abuse.org,
bl.spamcop.net,
orbs.dorkslayers.com,
#mailhub
relays.ordb.org,
inputs.relays.osirusoft.com,
dialups.relays.osirusoft.com,
spamhaus.relays.osirusoft.com,
proxies.relays.osirusoft.com,
opm.blitzed.org

#owners permissions
##########################
mail_owner = postfix
setgid_group = postdrop
default_privs = nobody

empty_address_recipient = EMPTY-MAILER-DUCK
smtpd_delay_reject = no
# Alias databases & maps, for use with mailman.
virtual_maps = ldap:ldapaltmail
alias_maps = hash:/etc/aliases
alias_database = $alias_maps
local_recipient_maps = $alias_maps, $virtual_maps

#ldap virtual aliases
#altmail maps altmailaddress to mail
ldapaltmail_timeout = 10
ldapaltmail_server_host = localhost
ldapaltmail_search_base = ou=People,dc=keyword,dc=loc
ldapaltmail_server_port = 389
ldapaltmail_domain = hash:/etc/postfix/searchdomains
ldapaltmail_query_filter = (&(mailAlternateAddress=%s)(accountstatus=active))
#ldapaltmail_query_filter = (&(uid=%u)(accountstatus=active))
ldapaltmail_result_attribute = mail
ldapaltmail_special_result_attribute = uniquemember
ldapaltmail_bind = yes
ldapaltmail_bind_dn = cn=admin,dc=keyword,dc=loc
ldapaltmail_bind_pw = {SSHA}wc3eMGRMgtIzioDddeOjyhcqZdW/4iq3
#spamfilter
##content_filter=spamfilter:

#debug when making changes or getting problems
debug_peer_level = 2
notify_classes =
delay_warning_time = 4
#fixes broken dns
ignore_mx_lookup_error = yes

#works with version any version of maildrop but does not send quota warning mailbox_command = "/usr/bin/maildrop"
#version 1.4 of maildrop (not recommended)
#mailbox_command = /usr/bin/maildrop | /usr/sbin/deliverquota -w 10 $HOME/Maildir
#work great with version 1.5.3 of maildrop
mailbox_command = /usr/bin/maildrop -w 85
home_mailbox = Maildir/

myhostname = kwserver.keyword.loc
mydomain = keyword.loc
mydestination = $myhostname, $mydomain, localhost.$mydomain, localhost.localhost
mynetworks = 127.0.0.1/32, 192.168.0.0/24

#local_transport = maildrop
local_transport = local

# moved users are in here
# sends sender a message with above in it
#relocated_maps = hash:/etc/postfix/relocated_people

# this specifies what domains we relay for (secondary MX!)
relay_domains = $transport_maps

# the "hold" transport is deferred
defer_transports = hold

# transports for specific hosts
transport_maps = hash:/etc/postfix/transport

# put all restrictions into smtpd_recipient_restrictions
#############################
#restriction classes
#############################
smtpd_restriction_classes = from_freemail_host
from_freemail_host = check_client_access hash:/etc/postfix/freemail_hosts,reject

smtpd_recipient_restrictions =

####################################
#used to stop virus infected machines on our net
####################################
reject_invalid_hostname,
reject_non_fqdn_sender,
reject_non_fqdn_recipient,
reject_unknown_sender_domain,
reject_unauth_pipelining,
##check_client_access hash:/etc/postfix/badclients,
permit_mynetworks,
reject_unknown_recipient_domain,
##check_sender_access hash:/etc/postfix/broken_sender_exception,
##check_client_access hash:/etc/postfix/broken_sender_exception,
reject_unauth_destination,
reject_non_fqdn_hostname,
reject_non_fqdn_sender,
#reject_unknown_client,
#reject unknown dns --> mailfrom:
##reject_unknown_sender_domain,
#reject unknown --> rcpt to:
#bad helo
#reverse lookup of ip sending
# checks for forged mails from freemail accounts
check_sender_access hash:/etc/postfix/freemail_access,
reject_maps_rbl

sladp.conf è:

Quote:

# This is the main slapd configuration file. See slapd.conf(5) for more
# info on the configuration options.

#######################################################################
# Global Directives:

# Features to permit
#allow bind_v2

# Schema and objectClass definitions
include /etc/ldap/schema/core.schema
include /etc/ldap/schema/cosine.schema
include /etc/ldap/schema/nis.schema
include /etc/ldap/schema/inetorgperson.schema
include /etc/ldap/schema/qmail.schema
include /etc/ldap/schema/authldap.schema

# Where the pid file is put. The init.d script
# will not stop the server if you change this.
pidfile /var/run/slapd/slapd.pid

# List of arguments that were passed to the server
argsfile /var/run/slapd/slapd.args

# Read slapd.conf(5) for possible values
loglevel 0

# Where the dynamically loaded modules are stored
modulepath /usr/lib/ldap
moduleload back_bdb

# The maximum number of entries that is returned for a search operation
sizelimit 500

# The tool-threads parameter sets the actual amount of cpu's that is used
# for indexing.
tool-threads 1

#######################################################################
# Specific Backend Directives for bdb:
# Backend specific directives apply to this backend until another
# 'backend' directive occurs
backend bdb
checkpoint 512 30

#######################################################################
# Specific Backend Directives for 'other':
# Backend specific directives apply to this backend until another
# 'backend' directive occurs
#backend <other>

#######################################################################
# Specific Directives for database #1, of type bdb:
# Database specific directives apply to this databasse until another
# 'database' directive occurs
database bdb

# The base of your directory in database #1
suffix "dc=keyword,dc=loc"

# rootdn directive for specifying a superuser on the database. This is needed
# for syncrepl.
# rootdn "cn=admin,dc=keyword,dc=loc"

# Where the database file are physically stored for database #1
directory "/var/lib/ldap"

# For the Debian package we use 2MB as default but be sure to update this
# value if you have plenty of RAM
dbconfig set_cachesize 0 2097152 0

# Sven Hartge reported that he had to set this value incredibly high
# to get slapd running at all. See http://bugs.debian.org/303057
# for more information.

# Number of objects that can be locked at the same time.
dbconfig set_lk_max_objects 1500
# Number of locks (both requested and granted)
dbconfig set_lk_max_locks 1500
# Number of lockers
dbconfig set_lk_max_lockers 1500

# Indexing options for database #1
index objectClass eq

# Save the time that the entry gets modified, for database #1
lastmod on

# Where to store the replica logs for database #1
# replogfile /var/lib/ldap/replog

# The userPassword by default can be changed
# by the entry owning it if they are authenticated.
# Others should not be able to see it, except the
# admin entry below
# These access lines apply to database #1 only
access to attrs=userPassword,shadowLastChange,clearpassword
by dn="cn=admin,dc=keyword,dc=loc" write
by anonymous auth
by self write
by * none

access to attrs=accountstatus
by dn="cn=admin,dc=keyword,dc=loc" write
by dn="cn=maildaemon,dc=keyword,dc=loc" read

access to attrs=employeeNumber
by dn="cn=admin,dc=keyword,dc=loc" write
by dn="cn=maildaemon,dc=keyword,dc=loc" read
by * none

# Ensure read access to the base for things like
# supportedSASLMechanisms. Without this you may
# have problems with SASL not knowing what
# mechanisms are available and the like.
# Note that this is covered by the 'access to *'
# ACL below too but if you change that as people
# are wont to do you'll still need this if you
# want SASL (and possible other things) to work
# happily.
access to dn.base="" by * read

# The admin dn has full write access, everyone else
# can read everything.
access to *
by dn="cn=admin,dc=keyword,dc=loc" write
by dn="cn=maildaemon,dc=keyword,dc=loc" read
by users read
by self write
by * read

# For Netscape Roaming support, each user gets a roaming
# profile for which they have write access to
#access to dn=".*,ou=Roaming,o=morsnet"
# by dn="cn=admin,dc=keyword,dc=loc" write
# by dnattr=owner write

#######################################################################
# Specific Directives for database #2, of type 'other' (can be bdb too):
# Database specific directives apply to this databasse until another
# 'database' directive occurs
#database <other>

# The base of your directory for database #2
#suffix "dc=debian,dc=org"

Ciao a tutti

Ritratto di Ricca
Ricca
(Junior)
Offline
Junior
Iscritto: 10/01/2007
Messaggi: 45

Quote:

paolo ha scritto:
Sarebbe graditissima, da parte di tutta la comunità, quando l'avrete spuntata, su come configurare postfix + ldap Smile

Attendo fiducioso

Alla fine credo di esserci riuscito Laughing
Non essendo un esperto in materia ho buttato giù un po' di appunti soprattutto per fissare i passaggi che ho fatto, anche se tante cose ancora sono un po' oscure Thinking

Allego il file con gli appunti che ho scritto

Non prendetelo per una guida, soprattutto perchè non so quanto sia corretto tutto quello che ho scritto...

Se notate qualche errore ( come certamente sarà... ) vi prego di segnalarlo.

Ciao a tutti

Ritratto di Ricca
Ricca
(Junior)
Offline
Junior
Iscritto: 10/01/2007
Messaggi: 45

Scusate ho interpretato male l'opzione "Allega"...

cmq se qualcuno è interessato posso inviare il file per mail...