I'm getting 550 sender rejected by administrator" errors when sending mail through PHPs mail() with postfix on SUSE Linux.
All mails appear in /var/mail/root but do not get delivered to the email address.
Content-Description: Delivery report
Content-Type: message/delivery-status
Reporting-MTA: dns; linux.local
X-Postfix-Queue-ID: E5B86BA
X-Postfix-Sender: rfc822; wwwrun@linux.local
Arrival-Date: Wed, 12 Oct 2011 11:40:32 +0200 (CEST)
Final-Recipient: rfc822; myemail@domain.de
Action: failed
Status: 5.0.0
Remote-MTA: dns; mx01.kundenserver.de
Diagnostic-Code: smtp; 550 sender rejected by administrator
--E5B86BA.1318412433/linux.local
Content-Description: Undelivered Message
Content-Type: message/rfc822
Return-Path: <wwwrun@linux.local>
Received: by linux.local (Postfix, from userid 30)
id E5B86BA; Wed, 12 Oct 2011 11:40:32 +0200 (CEST)
To: myemail@domain.de
Subject: Subject: test
X-PHP-Originating-Script: 0:mailtest.php
From: myemail@domain.de
Message-Id: <20111012094032.E5B86BA@linux.local>
Date: Wed, 12 Oct 2011 11:40:32 +0200 (CEST)
test
I changed a week ago inet_interfaces in /etc/postfix/main.cf from localhost to all and could send mails through php. However it stopped working now.
~ # postconf -n
alias_maps = hash:/etc/aliases
biff = no
canonical_maps = hash:/etc/postfix/canonical
command_directory = /usr/sbin
config_directory = /etc/postfix
content_filter =
daemon_directory = /usr/lib/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
defer_transports =
delay_warning_time = 1h
disable_dns_lookups = no
disable_mime_output_conversion = no
html_directory = /usr/share/doc/packages/postfix-doc/html
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mail_spool_directory = /var/mail
mailbox_command =
mailbox_size_limit = 0
mailbox_transport =
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
masquerade_classes = envelope_sender, header_sender, header_recipient
masquerade_domains =
masquerade_exceptions = root
message_size_limit = 0
message_strip_characters = \0
mydestination = $myhostname, localhost.$mydomain
myhostname = linux.local
mynetworks_style = subnet
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/packages/postfix-doc/README_FILES
relay_domains = $mydestination, hash:/etc/postfix/relay
relayhost =
relocated_maps = hash:/etc/postfix/relocated
sample_directory = /usr/share/doc/packages/postfix-doc/samples
sender_canonical_maps = hash:/etc/postfix/sender_canonical
sendmail_path = /usr/sbin/sendmail
setgid_group = maildrop
smtp_enforce_tls = no
smtp_sasl_auth_enable = no
smtp_tls_session_cache_database = btree:/var/lib/postfix/smtpd_tls_session_cache
smtp_tls_session_cache_timeout = 3600s
smtp_use_tls = no
smtpd_client_restrictions =
smtpd_helo_required = no
smtpd_helo_restrictions =
smtpd_recipient_restrictions = permit_mynetworks,reject_unauth_destination
smtpd_sasl_auth_enable = no
smtpd_sender_restrictions = hash:/etc/postfix/access
smtpd_use_tls = no
strict_8bitmime = no
strict_rfc821_envelopes = no
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 550
virtual_alias_domains = hash:/etc/postfix/virtual
virtual_alias_maps = hash:/etc/postfix/virtual
For completeness I use this PHP script for testing sendmail:
<html>
<body>
<?php
if (isset($_REQUEST['email']))
//if "email" is filled out, send email
{
//send email
$email = $_REQUEST['email'] ;
$subject = $_REQUEST['subject'] ;
$message = $_REQUEST['message'] ;
mail("myemail@domain.de", "Subject: $subject",
$message, "From: $email" );
echo "Thank you for using our mail form";
}
else
//if "email" is not filled out, display the form
{
echo "<form method='post' action='mailtest.php'>
Email: <input name='email' type='text' /><br />
Subject: <input name='subject' type='text' /><br />
Message:<br />
<textarea name='message' rows='15' cols='40'>
</textarea><br />
<input type='submit' />
</form>";
}
?>
Best Answer
Change
myhostname = linux.local
to something useful. Your real existing(!) domain name would be acceptable.