I'm trying to send mail with php, and get an error <? $to = "[email protected]"; $subject = "Test mail"; $message = "Hello! This is a simple email message."; $from = "[email protected]"; $headers = "From: $from"; if(mail($to,$subject,$message,$headers)){ echo "Mail Sent. $to"; }else{ echo "Mail error."; } ?> I have fedora 7 + perfect setup + ISPConfig 2.2.16 Maillog: Code: Sep 19 13:14:04 linux7 sendmail[28823]: l8JAE459028823: from=apache, size=102, class=0, nrcpts=1, msgid=<[email protected]>, relay=apache@localhost Sep 19 13:14:04 linux7 postfix/smtpd[28824]: connect from localhost.localdomain[127.0.0.1] Sep 19 13:14:04 linux7 postfix/smtpd[28824]: setting up TLS connection from localhost.localdomain[127.0.0.1] Sep 19 13:14:04 linux7 postfix/smtpd[28824]: TLS connection established from localhost.localdomain[127.0.0.1]: TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits) Sep 19 13:14:04 linux7 sendmail[28823]: STARTTLS=client, relay=[127.0.0.1], version=TLSv1/SSLv3, verify=FAIL, cipher=DHE-RSA-AES256-SHA, bits=256/256 Sep 19 13:14:04 linux7 postfix/smtpd[28824]: NOQUEUE: reject: RCPT from localhost.localdomain[127.0.0.1]: 550 5.1.1 <[email protected]>: Recipient address rejected: User unknown in local recipient table; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<linux7.xx.lv> Sep 19 13:14:04 linux7 sendmail[28823]: l8JAE459028823: [email protected], ctladdr=apache (48/48), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30102, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.1, stat=User unknown Sep 19 13:14:04 linux7 sendmail[28823]: l8JAE459028823: l8JAE45A028823: DSN: User unknown Sep 19 13:14:04 linux7 postfix/smtpd[28824]: 8E86519F45C: client=localhost.localdomain[127.0.0.1] Sep 19 13:14:04 linux7 postfix/cleanup[28828]: 8E86519F45C: message-id=<[email protected]> Sep 19 13:14:04 linux7 postfix/qmgr[28820]: 8E86519F45C: from=<>, size=2553, nrcpt=1 (queue active) Sep 19 13:14:04 linux7 sendmail[28823]: l8JAE45A028823: to=apache, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31126, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as 8E86519F45C) Sep 19 13:14:04 linux7 postfix/cleanup[28828]: 9A7AF19F45E: message-id=<[email protected]> Sep 19 13:14:04 linux7 postfix/qmgr[28820]: 9A7AF19F45E: from=<>, size=2696, nrcpt=1 (queue active) Sep 19 13:14:04 linux7 postfix/local[28829]: 8E86519F45C: to=<[email protected]>, relay=local, delay=0.06, delays=0.05/0.01/0/0.01, dsn=2.0.0, status=sent (forwarded as 9A7AF19F45E) Sep 19 13:14:04 linux7 postfix/qmgr[28820]: 8E86519F45C: removed Sep 19 13:14:04 linux7 postfix/local[28829]: 9A7AF19F45E: to=<[email protected]>, orig_to=<[email protected]>, relay=local, delay=0.01, delays=0.01/0/0/0, dsn=2.0.0, status=sent (delivered to maildir) Sep 19 13:14:04 linux7 postfix/qmgr[28820]: 9A7AF19F45E: removed Sep 19 13:14:04 linux7 postfix/smtpd[28824]: disconnect from localhost.localdomain[127.0.0.1] My main.cy Code: #soft_bounce = no queue_directory = /var/spool/postfix command_directory = /usr/sbin daemon_directory = /usr/libexec/postfix mail_owner = postfix #default_privs = nobody #myhostname = host.domain.tld #myhostname = virtual.domain.tld #mydomain = domain.tld #myorigin = $myhostname #myorigin = $mydomain #inet_interfaces = all #inet_interfaces = $myhostname #inet_interfaces = $myhostname, localhost inet_interfaces = all #proxy_interfaces = #proxy_interfaces = 1.2.3.4 #mydestination = $myhostname, localhost.$mydomain, localhost ##mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain ##mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, # mail.$mydomain, www.$mydomain, ftp.$mydomain #local_recipient_maps = unix:passwd.byname $alias_maps #local_recipient_maps = proxy:unix:passwd.byname $alias_maps #local_recipient_maps = unknown_local_recipient_reject_code = 550 #mynetworks_style = class #mynetworks_style = subnet #mynetworks_style = host #mynetworks = 168.100.189.0/28, 127.0.0.0/8 #mynetworks = $config_directory/mynetworks #mynetworks = hash:/etc/postfix/network_table #relay_domains = $#mydestination #relayhost = $mydomain #relayhost = [gateway.my.domain] #relayhost = [mailserver.isp.tld] #relayhost = uucphost #relayhost = [an.ip.add.ress] #relay_recipient_maps = hash:/etc/postfix/relay_recipients #in_flow_delay = 1s #alias_maps = dbm:/etc/aliases alias_maps = hash:/etc/aliases #alias_maps = hash:/etc/aliases, nis:mail.aliases #alias_maps = netinfo:/aliases #alias_database = dbm:/etc/aliases #alias_database = dbm:/etc/mail/aliases alias_database = hash:/etc/aliases #alias_database = hash:/etc/aliases, hash:/opt/majordomo/aliases #recipient_delimiter = + #home_mailbox = Mailbox #home_mailbox = Maildir/ #mail_spool_directory = /var/mail #mail_spool_directory = /var/spool/mail #mailbox_command = /some/where/procmail #mailbox_command = /some/where/procmail -a "$EXTENSION" #mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp #mailbox_transport = cyrus #fallback_transport = lmtp:unix:/var/lib/imap/socket/lmtp #fallback_transport = #luser_relay = [email protected] #luser_relay = [email protected] #luser_relay = admin+$local #header_checks = regexp:/etc/postfix/header_checks #fast_flush_domains = $relay_domains #smtpd_banner = $myhostname ESMTP $mail_name #smtpd_banner = $myhostname ESMTP $mail_name ($mail_version) #local_destination_concurrency_limit = 2 #default_destination_concurrency_limit = 20 debug_peer_level = 2 #debug_peer_list = 127.0.0.1 #debug_peer_list = some.domain debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin xxgdb $daemon_directory/$process_name $process_id & sleep 5 sendmail_path = /usr/sbin/sendmail.postfix newaliases_path = /usr/bin/newaliases.postfix mailq_path = /usr/bin/mailq.postfix setgid_group = postdrop html_directory = no manpage_directory = /usr/share/man sample_directory = /usr/share/doc/postfix-2.4.3/samples readme_directory = /usr/share/doc/postfix-2.4.3/README_FILES #disable_vrfy_command = yes smtpd_sasl_local_domain = smtpd_sasl_auth_enable = yes smtpd_sasl_security_options = noanonymous broken_sasl_auth_clients = yes smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination mynetworks = 127.0.0.0/8 smtpd_tls_auth_only = no smtp_use_tls = yes smtpd_use_tls = yes smtp_tls_note_starttls_offer = yes smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt 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 smtpd_sasl_authenticated_header = yes myhostname = linux7.xx.lv home_mailbox = Maildir/ mailbox_command = virtual_maps = hash:/etc/postfix/virtusertable mydestination = /etc/postfix/local-host-names I can provide any info, just need it to be working Thank you in advance
Exactly as it says in the mail log - [email protected] is an unknown user. If xx.lv is a domain on the web server machine, then there is no user called cash. The mail is being rejected on connect, so it seems your mail server does not know that mail for xx.lv must be forwarded to another mail server, or that there is a user named cash. Whatever the cause,it is treating it as local, and rejecting it.
is I comment #mydestination = /etc/postfix/local-host-names all mail delivers fine to local domains, but for example if I send to gmail I receive this log Code: Sep 19 17:47:27 linux7 sendmail[3853]: l8JElQsl003853: from=apache, size=101, class=0, nrcpts=1, msgid=<[email protected]>, relay=apache@localhost Sep 19 17:47:27 linux7 sendmail[3853]: l8JElQsl003853: [email protected], delay=00:00:00, mailer=esmtp, pri=30101, dsn=4.4.3, stat=queued
Remove your comment of mydestination as commenting out disables virtual domains. Then make sure that the website www.xx.lv has a co-domain xx.lv with empty hostname field.
Right now I don't use this Server as mail server, and I fixed last problem by changing in php.ini sendmail path to sendmail.postfix , can it lead to some problems ? Thanks.