Postfix -> Problem mit php: mail()

Postfix, QMail, Sendmail, Dovecot, Cyrus, Courier, Anti-Spam
markusk
Posts: 140
Joined: 2003-05-04 20:14

Postfix -> Problem mit php: mail()

Post by markusk » 2005-08-07 19:55

Hallo zusammen!

Ich habe Kolab (LDAP-Server) installiert, der bringt von Haus aus schon Postfix und Apache/PHP mit. Jetzt ist das Problem, dass ich mit PHP keine Mails per mail() versenden kann, es kommt keine Fehlermeldung, aber sie gehen einfach nicht raus. Der Pfad zu sendmail in der php.ini stimmt.

Wo kann das Problem liegen?

Viele Grüße, Markus

markusk
Posts: 140
Joined: 2003-05-04 20:14

Re: Postfix -> Problem mit php: mail()

Post by markusk » 2005-08-07 20:32

ich hab jetzt mal folgendes ausgeführt:

Code: Select all

# mail -vs 'test' test@gmx.de
test
.
Cc:
test@gmx.de... Connecting to [127.0.0.1] port 587 via relay...
test@gmx.de... Deferred: Connection refused by [127.0.0.1]
Postfix scheint aber zu laufen:

Code: Select all

# ps xa| grep postfix
 2841 ?        Ss     0:00 /kolab/libexec/postfix/master
Welche config-settings sind hierfür nun nötig?

squize
Userprojekt
Userprojekt
Posts: 741
Joined: 2003-05-19 16:46
Location: Karlsruhe

Re: Postfix -> Problem mit php: mail()

Post by squize » 2005-08-08 13:20

Wahrscheinlich fehlt bei dir bei der Einstellung my_networks die Adresse 127.0.0.1. Du musst postfix mitteilen, dass er mails von 127.0.0.1 ohne auth relayen soll.

Poste doch mal deine main.cf.

Gruss

Marc

markusk
Posts: 140
Joined: 2003-05-04 20:14

Re: Postfix -> Problem mit php: mail()

Post by markusk » 2005-08-08 13:53

der steht schon auf 127.0.0.1

Hier die main.cf (domainname musste ich auf mydomain.net ändern)

Code: Select all

# postfix default is 10 240 000 Byte = 10.24 Megabyte, 
# we use 20 Mebibyte = 20*2^20 Byte 
message_size_limit = 20971520

#   paths
command_directory = /kolab/sbin
daemon_directory = /kolab/libexec/postfix
queue_directory = /kolab/var/postfix

#   users
mail_owner= kolab
setgid_group= kolab-r
default_privs= kolab-n

#   local host
myhostname = www.mydomain.net
mydomain = mydomain.net
myorigin = $mydomain
relayhost = 

# 
masquerade_domains = $mydomain
masquerade_exceptions = root

#   smtp daemon
#smtpd_banner = $myhostname ESMTP $mail_name
#inet_interfaces = 127.0.0.1

#   relaying
mynetworks = 127.0.0.0/8
mydestination = $mydomain
relay_domains = 
#smtpd_recipient_restrictions = permit_mynetworks, 
#                               check_client_access hash:/kolab/etc/postfix/access,
#                               check_relay_domains

#   maps
canonical_maps = hash:/kolab/etc/postfix/canonical
virtual_maps =  hash:/kolab/etc/postfix/virtual, ldap:ldapdistlist, ldap:ldapvirtual
relocated_maps = hash:/kolab/etc/postfix/relocated
transport_maps = hash:/kolab/etc/postfix/transport, ldap:ldaptransport
alias_maps = hash:/kolab/etc/postfix/aliases
alias_database = hash:/kolab/etc/postfix/aliases
#virtual_mailbox_maps = $virtual_maps
local_recipient_maps = $virtual_maps

#   local delivery
recipient_delimiter = +
#mailbox_transport = lmtp:unix:/kolab/var/kolab/lmtp
mailbox_transport = kolabmailboxfilter

#TLS settings
smtpd_use_tls = yes
smtpd_tls_auth_only = yes
smtpd_starttls_timeout = 300s
smtpd_timeout = 300s
#smtpd_tls_CAfile = /kolab/etc/kolab/server.pem
#smtpd_tls_CApath =
#smtpd_tls_ask_ccert = no
#smtpd_tls_ccert_verifydepth = 5
smtpd_tls_cert_file = /kolab/etc/kolab/cert.pem
#smtpd_tls_cipherlist =
#smtpd_tls_dcert_file =
#smtpd_tls_dh1024_param_file =
#smtpd_tls_dh512_param_file =
#smtpd_tls_dkey_file = $smtpd_tls_dcert_file
#smtpd_tls_key_file = $smtpd_tls_cert_file
smtpd_tls_key_file = /kolab/etc/kolab/key.pem
#smtpd_tls_loglevel = 3
smtpd_tls_received_header = no
#smtpd_tls_req_ccert = no
#smtpd_tls_session_cache_database =
smtpd_tls_session_cache_timeout = 3600s
#smtpd_tls_wrappermode = no

#tls_random_bytes = 32
tls_random_source = dev:/dev/urandom
#tls_daemon_random_bytes = 32
#tls_daemon_random_source =
#tls_random_exchange_name = ${config_directory}/prng_exch
#tls_random_prng_update_period = 60s
#tls_random_reseed_period = 3600s

#smtp_starttls_timeout = 300s
#smtp_tls_CAfile =
#smtp_tls_CApath =
#smtp_tls_cert_file =
#smtp_tls_cipherlist =
#smtp_tls_dcert_file =
#smtp_tls_dkey_file = $smtp_tls_dcert_file
#smtp_tls_enforce_peername = yes
#smtp_tls_key_file = $smtp_tls_cert_file
#smtp_tls_loglevel = 0
#smtp_tls_note_starttls_offer = no
#smtp_tls_per_site =
#smtp_tls_scert_verifydepth = 5
#smtp_tls_session_cache_database =
#smtp_tls_session_cache_timeout = 3600s

#   authentication via sasl

## Kolab Policy Server
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,
	reject_unauth_destination, reject_unlisted_recipient, check_policy_service unix:private/kolabpolicy
smtpd_sender_restrictions = permit_mynetworks, check_policy_service unix:private/kolabpolicy
kolabpolicy_time_limit = 3600
kolabpolicy_max_idle = 20

#smtpd_restriction_classes =
smtpd_sasl_auth_enable = yes

# We want to allow for uids without any realm
#smtpd_sasl_local_domain = $myhostname
smtpd_sasl_local_domain =

smtpd_sasl_security_options = noanonymous

# Support broken clients like Microsoft Outlook Express 4.x which expect AUTH=LOGIN instead of AUTH LOGIN
broken_sasl_auth_clients = yes

#
# LDAP Alias support
#

ldapvirtual_server_host = ldap://127.0.0.1:389
ldapvirtual_search_base = dc=mydomain,dc=net
ldapvirtual_query_filter = (|(alias=%s)(mail=%s))
ldapvirtual_result_attribute = mail
ldapvirtual_result_filter = %s
ldapvirtual_search_timeout = 15
ldapvirtual_scope = sub
ldapvirtual_bind = yes
ldapvirtual_bind_dn = cn=nobody,cn=internal,dc=mydomain,dc=net
ldapvirtual_bind_pw = CGHz8PNaViFy5o/aSefG0YTb1DwcHREaHKV/1jTZ
ldapvirtual_version = 3

#
# LDAP Recipient map
#


#
# LDAP Distributionlist support
#

ldapdistlist_server_host = ldap://127.0.0.1:389
ldapdistlist_search_base = dc=mydomain,dc=net
ldapdistlist_domain = $mydestination
ldapdistlist_query_filter = (&(objectClass=kolabGroupOfNames)(mail=%s))
ldapdistlist_special_result_attribute = member
ldapdistlist_exclude_internal = yes
ldapdistlist_result_attribute = mail
ldapdistlist_result_filter = %s
ldapdistlist_search_timeout = 15
ldapdistlist_scope = sub
ldapdistlist_bind = yes
ldapdistlist_bind_dn = cn=nobody,cn=internal,dc=mydomain,dc=net
ldapdistlist_bind_pw = CGHz8PNaViFy5o/aSefG0YTb1DwcHREaHKV/1jTZ
ldapdistlist_version = 3

#
# LDAP Transport for multilocation support
#

ldaptransport_server_host = ldap://127.0.0.1:389
ldaptransport_search_base = dc=mydomain,dc=net
ldaptransport_query_filter = (&(mail=%s)(objectClass=kolabInetOrgPerson)(!(kolabHomeServer=$myhostname)))
ldaptransport_result_attribute = kolabHomeServer
ldaptransport_result_filter = smtp:[%s]
ldaptransport_search_timeout = 15
ldaptransport_scope = sub
ldaptransport_bind = yes
ldaptransport_bind_dn = cn=nobody,cn=internal,dc=mydomain,dc=net
ldaptransport_bind_pw = CGHz8PNaViFy5o/aSefG0YTb1DwcHREaHKV/1jTZ
ldaptransport_version = 3

content_filter=kolabfilter
[/code]

squize
Userprojekt
Userprojekt
Posts: 741
Joined: 2003-05-19 16:46
Location: Karlsruhe

Re: Postfix -> Problem mit php: mail()

Post by squize » 2005-08-08 15:58

Wahrscheinlich fehlt dir bei:

Code: Select all

mynetworks = 127.0.0.0/8 
noch der Eintrag mit deiner IP-Adresse, also z.B.

Code: Select all

mynetworks = 10.100.189.12/32, 127.0.0.0/8 

Danach sollte dein MTA die Mails relayen.

gruss

Marc