Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Postfix SMTP only server - Unable to send mail to own domain

31 views
Skip to first unread message

chris...@gmail.com

unread,
Aug 4, 2016, 7:54:24 AM8/4/16
to
Hi,

Hopefully I can get a little help with the issue I am facing. I'm running the latest Dovecot version on Ubuntu Server and having issues with the /etc/postfix/main.cf configuration for the purpose of have a simple SMTP only server(not to receive mail).

I am using telnet to server locally and have tested externally to the server and let's me in all ok. But when I try to send mail back to the domain it is hosted on, it fails with connection refused.

Emailing out to all other external domains work.. for example I am doing this when testing to send email to my own domain:

HELO mydomain.co.uk
MAIL FROM: m...@mydomain.co.uk
RCPT TO: sup...@mydomain.co.uk
DATA
Subject: some text
some text
.

Output of /var/log/mail.log is:

Aug 4 12:45:20 ubuntu postfix/master[2710]: daemon started -- version 2.11.0, configuration /etc/postfix
Aug 4 12:45:30 ubuntu postfix/smtpd[2718]: connect from localhost[::1]
Aug 4 12:45:51 ubuntu postfix/smtpd[2718]: A36451A0B36: client=localhost[::1]
Aug 4 12:46:01 ubuntu postfix/cleanup[2721]: A36451A0B36: message-id=<2016080411455...@smtp.mydomain.co.uk.$
Aug 4 12:46:01 ubuntu postfix/qmgr[2714]: A36451A0B36: from=<m...@mydomain.co.uk>, size=352, nrcpt=1 (que$
Aug 4 12:46:01 ubuntu postfix/smtp[2722]: connect to idnonline.co.uk[192.168.2.253]:25: Connection refused
Aug 4 12:46:01 ubuntu postfix/smtp[2722]: connect to idnonline.co.uk[192.168.2.251]:25: Connection refused
Aug 4 12:46:01 ubuntu postfix/smtp[2722]: A36451A0B36: to=<sup...@mydomain.co.uk>, relay=none, delay=18, delay$
Aug 4 12:46:16 ubuntu postfix/smtpd[2718]: disconnect from localhost[::1]


Here is the output of /etc/postfix/main.cf :

# 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/mailname

smtpd_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 = 4h

readme_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.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = smtp.idnonline.co.uk
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination =
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
inet_protocols = all
local_recipient_maps =

Ports are open on the router.

The reason I need to send mail back is because we have external client that need a basic SMTP server to send notification emails to our mon...@mydomain.co.uk mailbox.

Any help appreciated.

Burkhard Ott

unread,
Aug 4, 2016, 10:55:27 AM8/4/16
to
On Thu, 04 Aug 2016 04:54:22 -0700, chris.lech wrote:

> mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128

mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 needs to have
192.168.2.253/32 and 251/32 set.
and on inet_interfaces = loopback-only you need to lost your interface.
Right now you can only connect to localhost, I wonder how your external
test worked as you wrote.

cheers

Chris Lech

unread,
Aug 4, 2016, 11:03:51 AM8/4/16
to
Thanks for that, I'll give it a try and report back. Your right doesn't look possible that I done it externally, although I have had many configurations testing and at some point it did work connecting externally!

Chris Lech

unread,
Aug 4, 2016, 2:17:21 PM8/4/16
to
On Thursday, 4 August 2016 15:55:27 UTC+1, Burkhard Ott wrote:
OK, now I'm a bit further I guess. I can externally telnet into the SMTP server but now get a "Relay Access Denied" message. I'll try and figure that one out!

Thanks

Burkhard Ott

unread,
Aug 4, 2016, 10:44:25 PM8/4/16
to
On Thu, 04 Aug 2016 11:17:19 -0700, Chris Lech wrote:

> OK, now I'm a bit further I guess. I can externally telnet into the SMTP
> server but now get a "Relay Access Denied" message. I'll try and figure
> that one out!
>

According to your config snippet you should be able to connect from an
external network and send email to postm...@smtp.idnonline.co.uk at
least.
I think what you are trying to do is to send to an external domain
(mydomain.co.uk), is mydomain.co.uk hosted on the same server or is is
supposed to relay to mydomain.co.uk?
If it's on the same server add it to mydestination, if not you need to
have some kind of authentication mechanism in place, otherwise you will
end up as open relay, which will make spammers very happy until your ISP
blocks traffic on your connection.

cheers
0 new messages