Dalmango
Posts: 43
Joined: Sat Aug 05, 2017 5:21 pm

Can't send an email from this tutorial!

Sat Sep 09, 2017 7:51 pm

Hi guys, has anybody managed to successfully complete this tutorial https://youtu.be/ACM7CmuLiXM which is strongly based on https://samhobbs.co.uk/2013/12/raspberr ... -1-postfix.

I completely restored my pi and am now strongly following the Sam Hobb's tutorial; many thanks Sam Hobb's and Salko for these great tutorials; really good of you guys to take all the time to share your wisdom.
I'm running into problems at the very first stage of not being able to send the first email from telnet.

I'm on a localhost connection to my wifi and sending out an email from a domain which I have registered but I've not entered anything relating to this domain so I'm wondering how the email would ever send anyway. However according to the tutorial this first email should send to an outside external email.

I've installed dovecot-common and dovecot-imapd and postfix created my Maildir/ files but am stuck. I have postfix configured to ipv4 which is what all say to do as I've read many problems with ipv6 configuration.

I pray someone is out there that's completed this tutorial.

SurferTim
Posts: 615
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Can't send an email from this tutorial!

Sat Sep 09, 2017 8:06 pm

How is the send failing? Does the telnet session report any errors? The last few lines are important. They should look something like this. It may say "queued as" or "sent successfully".

Code: Select all

data
354 End data with <CR><LF>.<CR><LF>
Subject: test
This is a test email
.
250 2.0.0 Ok: queued as A639C3EE6D
quit 
221 2.0.0 Bye
Follow the advice on the tutorial page. Check the log.

Edit: The most common reason for the destination email server rejecting your email is the inability to resolve the sender's (FROM) domain.

Dalmango
Posts: 43
Joined: Sat Aug 05, 2017 5:21 pm

Re: Can't send an email from this tutorial!

Sun Sep 10, 2017 11:16 am

Thanks SurferTim, I was quite suprised to see that I'm getting a bounce. Telnet shows the status of the outgoing email as queued.

My IP address seems to be blacklisted; which is quite suprising.

However being on a dynamic ip address I can't see this being the problem, would it not be more likely that as you say it's having trouble verifying my from domain? How would one rectify this?

Initially I thought it could be that my ISP has blocked port 25 but that doesn't seem to be the case.

SurferTim
Posts: 615
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Can't send an email from this tutorial!

Sun Sep 10, 2017 11:22 am

It could be a couple things.

You could be using a FROM address that the receiving email server can't resolve the address for that domain. That is the most common reason for a rejection.

It could be that you are using a public IP that has been issued by DHCP. Many email servers have a blacklist of non-commercial IP ranges. You may need to use your ISP's email server as a relay.

The email server log should tell you why.

Dalmango
Posts: 43
Joined: Sat Aug 05, 2017 5:21 pm

Re: Can't send an email from this tutorial!

Sun Sep 10, 2017 11:34 am

Thanks Tim, I am using a dynamic ip address, I had tried setting relayhost = to my ISPs smtp server in my etc/postfix/main.cf, and restarted postfix but that didn't change anything.

You're correct; the problem is the receiving email server can't resolve the address for that domain, I'm going to the above again quickly but am really struggling to get this to work.

SurferTim
Posts: 615
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Can't send an email from this tutorial!

Sun Sep 10, 2017 11:38 am

You need to set your dns servers for your domain, even if they are just placeholders from your domain registrar. Use nslookup to see if your domain can be resolved. That is normally all the receiving server is wanting.

Code: Select all

nslookup mydomain.com

Dalmango
Posts: 43
Joined: Sat Aug 05, 2017 5:21 pm

Re: Can't send an email from this tutorial!

Sun Sep 10, 2017 12:11 pm

Thanks for your rapid responses Tim, and your time. After installing dnsutils I ran nslookup mydomain.co.uk and it returned 'Non authoritative answer': ip address 91.198.165.243; at the very bottom. If I type this in a browser I don't get anything of any value; was expecting to be directed towards the homepage of the website currently.

Above that result I received a local ip address 192 xxxxx;
Below that said Address: 192 xxxxxx #53 - presumably #53 is the port number; suprised to see it's not 25.

Before the above result it returned lots of gibberish.

You've pointed me towards a very good path Tim so many thanks if I don't hear from you again. I currently have a hosting package and the website is being hosted from this package. I'm going to have a look on the current hosting package. I was suprised to see the above returning a local

SurferTim
Posts: 615
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Can't send an email from this tutorial!

Sun Sep 10, 2017 12:14 pm

Then it appears you have the domain resolving to an IP. Have you tried to send an email with user@mydomain.co.uk as the FROM address?

Dalmango
Posts: 43
Joined: Sat Aug 05, 2017 5:21 pm

Re: Can't send an email from this tutorial!

Sun Sep 10, 2017 12:24 pm

Yes sir, the whole time; been using mail from: my email address from the postfix server.

SurferTim
Posts: 615
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Can't send an email from this tutorial!

Sun Sep 10, 2017 12:25 pm

Have you tried to send an email using your real email address that you send and receive email as the FROM?

Dalmango
Posts: 43
Joined: Sat Aug 05, 2017 5:21 pm

Re: Can't send an email from this tutorial!

Sun Sep 10, 2017 12:26 pm

No Tim, good idea, I'm going to try now.

Dalmango
Posts: 43
Joined: Sat Aug 05, 2017 5:21 pm

Re: Can't send an email from this tutorial!

Sun Sep 10, 2017 12:45 pm

Thanks Tim, took me a bit of time and trial and error but I managed to login to my email using SASL and sent an email from my usual email address - n.b. this email address is completely independant from this thread.

So it seems telnet is working well and my ports mustn't be blocked; I did notice that my isp server showed up in a sort of roundabout way; text is a bit encrypted though I think due to the SASL connection; and probably would be without it also.

Going backward I'm really suprised to see the below:

Code: Select all

nslookup mydomain.co.uk 
Returned an external ip address which is good as I currently have the site hosted with a proper server; however could this be what's causing the problem do you think? When I type the ip address returned from nslookup I would think I would be directed to the current homepage of the website. but it just returns a 'sorry' page. I really thought it would return the current website home page; which worries me that nslookup doesn't actually return the ip address of where the site is being hosted?

Back to my main problem here - could the issue be that currently all dns caches are pointing towards where my site is being hosted (this site has never had any emails with it; just a webpage saying 'this website is under construction'). Nonetheless there are still dns caches out there saying that the site is there still, then when I go to send an email it's showing from my local dynamic ip address and I'm getting blocked straight away?

Also I've noticed there are no emails in my sent or draft folders; my mail is set to Maildir by the way.

Dalmango
Posts: 43
Joined: Sat Aug 05, 2017 5:21 pm

Re: Can't send an email from this tutorial!

Sun Sep 10, 2017 6:39 pm

Ok I think I'm getting a more of an understanding and I think I may have made a bit of a bad move by testing this out on my next business as my research indicates that if you register an existing website which is hosted on a dynamic ip address then it can be blacklisted straight away before you even get cracking.

So anyway's someone please correct me if I'm wrong, but as the domain is currently being hosted I would need an mx record pointing it to my raspberry pi server, however if I register this now I run the risk of blacklisting the site straight away.

I think that's what's happening but this is quite complicated.

SurferTim
Posts: 615
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Can't send an email from this tutorial!

Sun Sep 10, 2017 6:48 pm

You can check to see if your domain or IP is on a blacklist.
https://mxtoolbox.com/blacklists.aspx

Dalmango
Posts: 43
Joined: Sat Aug 05, 2017 5:21 pm

Re: Can't send an email from this tutorial!

Sun Sep 10, 2017 6:54 pm

Thanks Tim, no my ip address is not blacklisted it seems, but"

1 - it doesn't make sense why nslookup doesn't show my domain;

2 - The problem is definitely like you said the domain is already out there being hosted, is it just an mx record that needs to point to the raspberry pi server; as mentioned I don't think I should do this on a dynamic ip address which is a shame as I was doing this as a learning experience.

SurferTim
Posts: 615
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Can't send an email from this tutorial!

Sun Sep 10, 2017 7:49 pm

If nslookup is not providing resolution of your domain to an IP address, that is a good indication of why your email is being rejected.

Dalmango
Posts: 43
Joined: Sat Aug 05, 2017 5:21 pm

Re: Can't send an email from this tutorial!

Mon Sep 11, 2017 7:51 pm

Thanks Tim, I've been reading up and watching dns record tutorials.

Don't understand why I'm getting a nslookup on my external website.

Name: rcestimating.co.uk
Address: 91.198.165.243

Now when entering http://91.198.165.243/ in a browser address i get a sorry webpage; surely this ip address should direct me to the homepage.
This domain is an addon domain; though I can't see this making any difference as it would have it's own A wildcard record I would think.

I think the problem is shared hosting http://ask-leo.com/why_doesnt_accessing ... _work.html

SurferTim
Posts: 615
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Can't send an email from this tutorial!

Mon Sep 11, 2017 8:43 pm

Your web host may be (and probably is) using virtual hosting. That IP may be shared among many websites. In the header, there is a "HOST: website.com" parameter sent.

Dalmango
Posts: 43
Joined: Sat Aug 05, 2017 5:21 pm

Re: Can't send an email from this tutorial!

Wed Sep 13, 2017 6:54 pm

Thanks Tim, yes I understand what's going on now. I'd imagine almost every single professional web host will be using multiple hosting these days.

The problem has to be:
  • When sending an email my ip address for rcestimating.co.uk is currently showing as the external professional web hosting service http://91.198.165.243/ So when sending an email the recipient does a reverse domain lookup to check if the email being received is from the ip address listed; this must be where I'm failing right? So ultimately my option is to purchase a business ip address or put a canonical pointer pointing from the current external professional web host to my current local residential host; but I run the risk of being blacklisted with too many ip address changes?

SurferTim
Posts: 615
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Can't send an email from this tutorial!

Wed Sep 13, 2017 7:03 pm

Normally the email log will show the reason for the rejection. Can't read your log from here.

Dalmango
Posts: 43
Joined: Sat Aug 05, 2017 5:21 pm

Re: Can't send an email from this tutorial!

Wed Sep 13, 2017 7:30 pm

Thanks Tim, I was reluctant to post this on the internet but so stuck on this. It's showing as the ip address is blacklisted but this is nonsense. My other email from this ip is fine, if it was blacklisted I wouldn't be able to send from there.

Code: Select all

Sep 13 17:43:53 raspberrypi postfix/qmgr[11914]: 706C03F4C6: from=<dal@rcestimating.co.uk>, size=359, nrcpt=1 (queue active)
Sep 13 17:43:53 raspberrypi postfix/qmgr[11914]: 7691B3F46F: from=<dal@rcestimating.co.uk>, size=350, nrcpt=1 (queue active)
Sep 13 17:43:53 raspberrypi postfix/qmgr[11914]: 6FCBC3F4CC: from=<dal@rcestimating.co.uk>, size=339, nrcpt=1 (queue active)
Sep 13 17:43:53 raspberrypi postfix/smtp[16686]: 706C03F4C6: host mx01.gmx.net[212.227.17.4] refused to talk to me: 554-gmx.net (mxgmx116) Nemesis ESMTP Service not available 554-No SMTP service 554-IP address is black listed. 554 For e$
Sep 13 17:43:53 raspberrypi postfix/smtp[16688]: 6FCBC3F4CC: host mx00.gmx.net[212.227.15.10] refused to talk to me: 554-gmx.net (mxgmx016) Nemesis ESMTP Service not available 554-No SMTP service 554-IP address is black listed. 554 For $
Sep 13 17:43:53 raspberrypi postfix/smtp[16687]: 7691B3F46F: host mx00.gmx.net[212.227.15.10] refused to talk to me: 554-gmx.net (mxgmx016) Nemesis ESMTP Service not available 554-No SMTP service 554-IP address is black listed. 554 For $
Sep 13 17:43:53 raspberrypi postfix/smtp[16687]: 7691B3F46F: to=<dal_curtis@gmx.com>, relay=mx01.gmx.net[212.227.17.4]:25, delay=335481, delays=335481/0.05/0.24/0, dsn=4.0.0, status=deferred (host mx01.gmx.net[212.227.17.4] refused to t$
Sep 13 17:43:53 raspberrypi postfix/smtp[16686]: 706C03F4C6: to=<dal_curtis@gmx.com>, relay=mx00.gmx.net[212.227.15.10]:25, delay=282896, delays=282896/0.05/0.27/0, dsn=4.0.0, status=deferred (host mx00.gmx.net[212.227.15.10] refused to$
Sep 13 17:43:53 raspberrypi postfix/smtp[16688]: 6FCBC3F4CC: to=<dal_curtis@gmx.com>, relay=mx01.gmx.net[212.227.17.4]:25, delay=269568, delays=269568/0.07/0.22/0, dsn=4.0.0, status=deferred (host mx01.gmx.net[212.227.17.4] refused to t$
Sep 13 17:53:53 raspberrypi postfix/qmgr[11914]: AE55C3F4EF: from=<dal@rcestimating.co.uk>, size=359, nrcpt=1 (queue active)
Sep 13 17:53:53 raspberrypi postfix/smtp[16697]: AE55C3F4EF: host mx01.gmx.net[212.227.17.4] refused to talk to me: 554-gmx.net (mxgmx116) Nemesis ESMTP Service not available 554-No SMTP service 554-IP address is black listed. 554 For e$
Sep 13 17:53:53 raspberrypi postfix/smtp[16697]: AE55C3F4EF: to=<dal_curtis@gmx.com>, relay=mx00.gmx.net[212.227.15.10]:25, delay=265172, delays=265172/0.05/0.28/0, dsn=4.0.0, status=deferred (host mx00.gmx.net[212.227.15.10] refused to$
Sep 13 18:48:53 raspberrypi postfix/qmgr[11914]: 952F83F4F4: from=<dal@rcestimating.co.uk>, size=344, nrcpt=1 (queue active)
Sep 13 18:48:53 raspberrypi postfix/smtp[16741]: 952F83F4F4: host mx01.gmx.net[212.227.17.4] refused to talk to me: 554-gmx.net (mxgmx115) Nemesis ESMTP Service not available 554-No SMTP service 554-IP address is black listed. 554 For e$
Sep 13 18:48:53 raspberrypi postfix/smtp[16741]: 952F83F4F4: to=<dal_curtis@gmx.com>, relay=mx00.gmx.net[212.227.15.10]:25, delay=265157, delays=265156/0.05/0.23/0, dsn=4.0.0, status=deferred (host mx00.gmx.net[212.227.15.10] refused to$
Sep 13 18:53:53 raspberrypi postfix/qmgr[11914]: 706C03F4C6: from=<dal@rcestimating.co.uk>, size=359, nrcpt=1 (queue active)
Sep 13 18:53:53 raspberrypi postfix/qmgr[11914]: 7691B3F46F: from=<dal@rcestimating.co.uk>, size=350, nrcpt=1 (queue active)
Sep 13 18:53:53 raspberrypi postfix/qmgr[11914]: 6FCBC3F4CC: from=<dal@rcestimating.co.uk>, size=339, nrcpt=1 (queue active)
Sep 13 18:53:53 raspberrypi postfix/smtp[16746]: 706C03F4C6: host mx00.gmx.net[212.227.15.10] refused to talk to me: 554-gmx.net (mxgmx014) Nemesis ESMTP Service not available 554-No SMTP service 554-IP address is black listed. 554 For $
Sep 13 18:53:53 raspberrypi postfix/smtp[16748]: 6FCBC3F4CC: host mx01.gmx.net[212.227.17.4] refused to talk to me: 554-gmx.net (mxgmx110) Nemesis ESMTP Service not available 554-No SMTP service 554-IP address is black listed. 554 For e$
Sep 13 18:53:53 raspberrypi postfix/smtp[16747]: 7691B3F46F: host mx00.gmx.net[212.227.15.10] refused to talk to me: 554-gmx.net (mxgmx015) Nemesis ESMTP Service not available 554-No SMTP service 554-IP address is black listed. 554 For $
Sep 13 18:53:53 raspberrypi postfix/smtp[16746]: 706C03F4C6: to=<dal_curtis@gmx.com>, relay=mx01.gmx.net[212.227.17.4]:25, delay=287096, delays=287096/0.05/0.19/0, dsn=4.0.0, status=deferred (host mx01.gmx.net[212.227.17.4] refused to t$
Sep 13 18:53:53 raspberrypi postfix/smtp[16747]: 7691B3F46F: to=<dal_curtis@gmx.com>, relay=mx01.gmx.net[212.227.17.4]:25, delay=339681, delays=339681/0.05/0.19/0, dsn=4.0.0, status=deferred (host mx01.gmx.net[212.227.17.4] refused to t$
Sep 13 18:53:53 raspberrypi postfix/smtp[16748]: 6FCBC3F4CC: to=<dal_curtis@gmx.com>, relay=mx00.gmx.net[212.227.15.10]:25, delay=273769, delays=273768/0.07/0.18/0, dsn=4.0.0, status=deferred (host mx00.gmx.net[212.227.15.10] refused to$
Sep 13 19:03:53 raspberrypi postfix/qmgr[11914]: AE55C3F4EF: from=<dal@rcestimating.co.uk>, size=359, nrcpt=1 (queue active)
Sep 13 19:03:53 raspberrypi postfix/smtp[16757]: AE55C3F4EF: host mx01.gmx.net[212.227.17.4] refused to talk to me: 554-gmx.net (mxgmx116) Nemesis ESMTP Service not available 554-No SMTP service 554-IP address is black listed. 554 For e$
Sep 13 19:03:53 raspberrypi postfix/smtp[16757]: AE55C3F4EF: to=<dal_curtis@gmx.com>, relay=mx00.gmx.net[212.227.15.10]:25, delay=269372, delays=269372/0.05/0.21/0, dsn=4.0.0, status=deferred (host mx00.gmx.net[212.227.15.10] refused to$


SurferTim
Posts: 615
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Can't send an email from this tutorial!

Wed Sep 13, 2017 7:56 pm

From your log:
554-IP address is black listed.

Dalmango
Posts: 43
Joined: Sat Aug 05, 2017 5:21 pm

Re: Can't send an email from this tutorial!

Wed Sep 13, 2017 8:21 pm

Thanks Tim, yes I just don't see how that can be. I'm sending emails from an email from that IP on another address; as it's shared hosting they must all be coming from that ip address as I have another website with them.

Thanks for your input Tim, I've still got more work to do it seems.

SurferTim
Posts: 615
Joined: Sat Sep 14, 2013 9:27 am
Location: Miramar Beach, Florida

Re: Can't send an email from this tutorial!

Wed Sep 13, 2017 8:58 pm

Your email server is on your personal internet connection, correct? That is the public IP the receiving email server is rejecting. Your best bet is to relay through your ISP's email server.

Dalmango
Posts: 43
Joined: Sat Aug 05, 2017 5:21 pm

Re: Can't send an email from this tutorial!

Fri Sep 15, 2017 9:52 pm

Thanks Tim, I've been doing a lot of research on why this is happening. I've followed the tutorials exactly and am really suprised to see that nobody else has experienced these errors.

I've tried relaying previously but had no luck. I think this is more complicated than it's made out and I'm really concerned with blacklisting my domains as this is going to be a future business. Thinking I might be best to just give up, been three solid weekends on this and am causing serious problems with my ip address.

Return to “Networking and servers”

Who is online

Users browsing this forum: No registered users and 24 guests