Postfix Tutorial - Relaying Denied Error
-
Hi there,
I'm having difficulties in getting mail to send, I've followed the tutorials but when testing mail via a telnet session I keep getting:
'554 5.7.1 <someone@anydomain.com>: Relay access denied'
I've tried following Guv's video where he directs to use PHP -a but I don't even get a php > prompt it just says 'Interactive mode enabled' and the only way to exit is via Ctrl+C
I'm running Ubuntu 10.04, my aliases file contains the following:
# See man 5 aliases for format
root: <my username>And my postfix config contains:
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailnamesmtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
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 = 4hreadme_directory = no
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.myhostname = mail.goldenbanana.co.uk
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = $mydomain
mydestination = $goldenbanana, localhost.$goldenbanana, localhost
relayhost =
mynetworks = 127.0.0.0/8
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = allMy /etc/hosts contains:
27.0.0.1 localhost.localdomain localhost
127.0.1.1 mail.goldenbanana.co.uk mail
178.79.129.57 mail.goldenbanana.co.uk goldenbanana.co.uk# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhostsAnd finally my /etc/hostname contains:
mail
I had to change the last 2 files as per another forum post on this site in order to get hostname -f to work.
Any assistance required would be greatly appreciated - Many thanks :)
Posted 1 year ago # -
Hi James .. that's cos your box is so damn secure it won't let the mail out! you need to open up a port:-
#assume root
sudo -i
#do this:-
iptables-save > /etc/iptables_temp
sudo nano /etc/iptables_temp
# add some rule like:-
-A INPUT -p tcp -m tcp --dport 123 -j ACCEPT
#where 123 is the port you wanna open.
iptables-restore < /etc/iptables_temp
iptables-save > /etc/iptables.rules
#check the new rule is active:-
iptables -L
#look for a line like:-
ACCEPT tcp -- anywhere anywhere tcp dpt:123
#leave sudo
exitGood iptables reference here, care of guvnr:-
HACK-PROOF 9.10 Anti-Virus & Firewall [KARMIC KOALA BIBLE #19] - GUVNR
Re. PHP not ending mail from the CLI .. that's right there was an issue I recall when I was testing - I take it you're on 5.0.3 FPM? .. can't remember what but it's some 5.0.3 bug, or was then .. but hopefully you won't need that now?
(Loads of dev with 5.03 going on .. keep a close eye around here for details.)
Posted 1 year ago # -
Hi Olly,
Thanks for your detailed reply. I followed the instructions and added in a new rule for port 25 (guessing that's the one Postfix needs for sending).
Checked the rule was there and then rebooted my Linode. However I'm still getting the same error via Telnet and also tried to test from Wordpress (password reset) and I get the following error:
"The e-mail could not be sent.
Possible reason: your host may have disabled the mail() function..."So I'm not quite sure what's causing Postfix to do this :(
Posted 1 year ago # -
Here's what my /var/log/mail.log is showing when I try and send a test mail - I think the warning at the beginning is the key to this - I'll have a play around with putting my Linode's IP into the config but any help would be greatly appreciated - Ta!
Jun 6 14:30:57 mail postfix/smtpd[2278]: warning: 178.79.129.57: address not listed for hostname mail.goldenbanana.co.uk
Jun 6 14:30:57 mail postfix/smtpd[2278]: connect from unknown[178.79.129.57]
Jun 6 14:31:23 mail postfix/smtpd[2278]: NOQUEUE: reject: RCPT from unknown[178.79.129.57]: 554 5.7.1 <rcpt@somedomain.com>: Relay access denied; from=<sender@somedomian.com> to=<rcpt@somedomain.com> prot$
Jun 6 14:31:25 mail postfix/smtpd[2278]: disconnect from unknown[178.79.129.57]Posted 1 year ago # -
Right a small update, instead of connecting to my server via telnet 178.79.129.57 25, I instead used telnet localhost 25 and I managed to send a test mail!
I'm still having issues with Wordpress saying:
"The e-mail could not be sent.
Possible reason: your host may have disabled the mail() function..."So I'm going to run through the PHP tutorial section again to make sure I've installed it properly (pretty sure I have though). Any other suggestions are welcome though :-)
Posted 1 year ago # -
I've managed to solve this, I simply had to add the following into php.ini
[mail function]
SMTP = mail.goldenbanana.co.uk ;
sendmail_path = /usr/sbin/sendmail -t -i ;Posted 1 year ago # -
praise the Lord!!
Posted 1 year ago #
Reply
You must log in to post.
Want HTML?
a blockquote code em strong ul ol liPlace code between backticks `codeHere`
You've got it.
