ich verzweifle gerade an dem Versuch, einen Mail-Server mit Dovecot, Postfix und LDAP einzurichten.
Ich erhalte beim Versuch, von extern eine E-Mail an meinen Mail-Server zu verschicken, folgende Fehlermeldung:
Code: Alles auswählen
Remote Server returned '< #5.1.1 X-Postfix; unknown user: "marco">'
Was ich nicht verstehe ist, warum postfix den user "marco" als nicht gefunden meldet, obwohl ich doch in meinem LDAP-Filter als Rückgabewert die Mail-Adresse ausgeben lasse.
Ich bin für jeden Tipp, der mich weiter bringt, sehr dankbar, ich komme schon seit 2 Tagen keinen Meter vorwärts...
postfix - main.cf
Code: Alles auswählen
smtpd_banner = $myhostname ESMTP $mail_name
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
delay_warning_time = 4h
# TLS parameters
smtpd_tls_cert_file = /etc/letsencrypt/live/mail.firma.de/fullchain.pem
smtpd_tls_key_file = /etc/letsencrypt/live/mail.firma.de/privkey.pem
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = mail.firma.de
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
dovecot_destination_recipient_limit = 1
#mailbox_command = /usr/lib/dovecot/deliver
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
#smtp_bind_address = your ip address (optional) ==>unmark and change the ip address for your setup.
smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
broken_sasl_auth_clients = yes
smtpd_tls_auth_only = no
smtp_use_tls = yes
smtp_tls_note_starttls_offer = yes
#smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
home_mailbox = Maildir/
smtpd_recipient_restrictions =
reject_unknown_client,
reject_unauth_pipelining,
reject_non_fqdn_sender,
reject_non_fqdn_recipient,
reject_unknown_sender_domain,
reject_unknown_recipient_domain,
reject_invalid_hostname,
permit_mynetworks,
reject_rbl_client zen.spamhaus.org,
reject_rbl_client ix.dnsbl.manitu.net,
reject_rbl_client bl.spamcop.net,
# reject_unverified_recipient,
reject_unauth_destination,
permit
smtpd_data_restrictions =
reject_unauth_pipelining,
reject_multi_recipient_bounce,
permit
smtpd_helo_required = yes
#transport_maps
maildrop_destination_concurrency_limit = 2
maildrop_destination_recipient_limit = 1
gnarwl_destination_concurrency_limit = 1
gnarwl_destination_recipient_limit = 1
#transport_maps = hash:/etc/postfix/transport_map
#transport_maps = hash:/etc/postfix/transport_map, ldap:/etc/postfix/ldap-transport.cf
mydestination = $transport_maps, localhost, localhost.localdomain, $myhostname, localhost.$mydomain, $mydomain
#virtual_alias_maps = ldap:/etc/postfix/ldap/ldap-aliases.cf
# ldap:/etc/postfix/ldap/ldap-virtualforward.cf,
# ldap:/etc/postfix/ldap/ldap-accountsmap.cf
# virtual accounts for delivery
virtual_transport = lmtp:unix:private/dovecot-lmtp
virtual_mailbox_base = /var/mail/firma.de
virtual_mailbox_maps = ldap:/etc/postfix/ldap/ldap-accounts.cf
virtual_minimum_uid = 1000
virtual_uid_maps = static:1001
virtual_gid_maps = static:1001
local_recipient_maps = ldap:/etc/postfix/ldap/ldap-aliases.cf
Code: Alles auswählen
#
# Postfix master process configuration file. For details on the format
# of the file, see the master(5) manual page (command: "man 5 master" or
# on-line: http://www.postfix.org/master.5.html).
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (no) (never) (100)
# ==========================================================================
smtp inet n - y - - smtpd -v
#628 inet n - y - - qmqpd
pickup unix n - y 60 1 pickup
cleanup unix n - y - 0 cleanup
qmgr unix n - n 300 1 qmgr
#qmgr unix n - n 300 1 oqmgr
tlsmgr unix - - y 1000? 1 tlsmgr
rewrite unix - - y - - trivial-rewrite
bounce unix - - y - 0 bounce
defer unix - - y - 0 bounce
trace unix - - y - 0 bounce
verify unix - - y - 1 verify
flush unix n - y 1000? 0 flush
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
smtp unix - - y - - smtp
relay unix - - y - - smtp
-o syslog_name=postfix/$service_name
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - y - - showq
error unix - - y - - error
retry unix - - y - - error
discard unix - - y - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - y - - lmtp
anvil unix - - y - 1 anvil
scache unix - - y - 1 scache
postlog unix-dgram n - n - 1 postlogd
...
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
uucp unix - n n - - pipe
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp unix - n n - - pipe
flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix - n n - 2 pipe
flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman unix - n n - - pipe
flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
${nexthop} ${user}
dovecot unix - n n - - pipe
flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${recipient}
Code: Alles auswählen
server_host = ldaps://172.16.10.10:636
server_port = 636
version = 3
bind = yes
start_tls = no
bind_dn = cn=user,ou=Benutzer,ou=Firma,dc=firmaintern,dc=net
bind_pw = 456
search_base = ou=Firma,dc=firmaintern,dc=net
scope = sub
query_filter = (&(mail=%s)(objectClass=person)(memberOf=cn=Mail,ou=Gruppen,ou=Firma,dc=firmaintern,dc=net))
result_attribute = mail
Code: Alles auswählen
auth_verbose = yes
mail_debug = yes
auth_debug = yes
base_dir = /var/run/dovecot/
#protocols = imap imaps pop3 pop3s lmtp
protocols = imap pop3 lmtp
protocol imap {
mail_plugins = quota imap_quota
# imap_client_workarounds=outlook-idle is no longer necessary
# imap_client_workarounds = outlook-idle
}
protocol pop3 {
mail_plugins = quota
pop3_no_flag_updates = yes
pop3_reuse_xuidl = no
pop3_lock_session = no
pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
}
protocol lda {
mail_plugins = quota
postmaster_address = admin@firma.de
auth_socket_path = /var/run/dovecot/auth-master
}
service lmtp {
unix_listener /var/spool/postfix/private/dovecot-lmtp {
mode = 0600
user = postfix
group = postfix
}
}
plugin {
quota = maildir
quota_rule = Trash:storage=10%%
quota_rule2 = Spam:storage=10%%
quota_warning = storage=95%%/home/vmail/bin/quota-warning.sh 95
quota_warning2 = storage=80%% /home/vmail/bin/quota-warning.sh 80
}
listen = *
shutdown_clients = yes
log_timestamp = "%b %d %H:%M:%S "
syslog_facility = mail
disable_plaintext_auth = no
ssl = no
ssl_cert = /etc/letsencrypt/live/mail.firma.de/fullchain.pem
ssl_key = /etc/letsencrypt/live/mail.firma.de/privkey.pem
login_chroot = yes
#login_chroot has been replaced by service { chroot }
#login_user = postfix
login_process_per_connection = yes
login_processes_count = 2
login_max_processes_count = 128
login_max_connections = 256
login_greeting = Welcome to Dovecot eMail Server.
login_log_format_elements = user=<%u> method=%m rip=%r lip=%l %c
login_log_format = %$: %s
#default_mail_env = maildir:/home/vmail/%d/%u
mail_location = maildir:/var/mail/firma.de/%u
first_valid_uid = 117 # REMEBER THIS MUST BE CHANGED TO YOUR UID FOR "postfix" FROM /etc/passwd
mail_uid = 1001
mail_gid = 1001
pop3_uidl_format = %08Xu%08Xv
auth default {
mechanisms = PLAIN LOGIN
passdb ldap {
args = /etc/dovecot/dovecot-ldap.conf
}
userdb ldap {
args = /etc/dovecot/dovecot-ldap.conf
}
socket listen {
master {
path = /var/run/dovecot/auth-master
mode = 0600
user = vmail
group = vmail
}
client {
path = /var/spool/postfix/private/auth
mode = 0660
user = postfix
group = postfix
}
}
user = vmail
}
41722