SynGreis
Posts: 85
Joined: Tue Nov 07, 2017 6:26 am

Re: Nginx + mail server

Sun Sep 01, 2019 11:03 pm

connected with ethernet.

was i suppose to configure my email such as my ISP mail settings?

User avatar
DougieLawson
Posts: 36144
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Nginx + mail server

Sun Sep 01, 2019 11:21 pm

I chose the postfix "smart host" and it just works. My public ipv4 address does have a valid domain.

Your wireshark traces looks like something is firewalling your system. You don't get connected to your ISP's mail server.

You may need to check what mail relay is available. For PlusNet it's relay.plus.net but that's only available to PlusNet customers.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

SynGreis
Posts: 85
Joined: Tue Nov 07, 2017 6:26 am

Re: Nginx + mail server

Mon Sep 02, 2019 1:31 am

i purged then installed and selected the internet with smarthost

i pointed it both to my domain which has a MX record pointing to my server.

i also forwarded ports to my server for mail. i forwarded ports 25, 143, 587 and 110.

Can you also elaborate on the mail relays?

User avatar
DougieLawson
Posts: 36144
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Nginx + mail server

Mon Sep 02, 2019 7:11 am

Since most of us don't want to run a full scale mail server we don't run our own server that's connected to the public internet (it's hard work as you have to fight spam). Postfix can run that way, best of luck if you try that.

So we use a mail relay at our ISP (and they fight the spam).

It's just a server on port 25 that accepts insecure SMTP and delivers (relays) it to the mail server defined by the recipient's DNS MX record.

There's more modern, better ways like Gmail that require a secure login and use TLS to carry your email over a secure channel (before they relay it to port 25 on the recipient's server in clear text).

SMTP has so many things wrong with it because it was one of the first public internet protocols (and those early guys like Vint Cerf hadn't imagined the internet as the wild west insecure mess we have today).
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
rpdom
Posts: 15208
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Nginx + mail server

Mon Sep 02, 2019 7:58 am

DougieLawson wrote:
Mon Sep 02, 2019 7:11 am
Since most of us don't want to run a full scale mail server we don't run our own server that's connected to the public internet (it's hard work as you have to fight spam). Postfix can run that way, best of luck if you try that.

So we use a mail relay at our ISP (and they fight the spam).
I don't trust my ISPs spam traps not to block something that might be important. That is why I do run my own full scale mail server. In the (roughly) three years I've been running that particular server I have received approximately 0 spam (give or take 1% :-P).

It's not too hard to set one up as long as you have an accessible public IP address. Mine uses MariaDB for the authentication, so I can set up new emails addresses just by updating a database.

The majority of spam emails come down to a couple of main methods:

a) Dictionary attack on a known major email provider.

b) Email addresses used online and harvested.

My server has only a few email addresses on a couple of domains and isn't well known.
I take care where I publish my email addresses.
Because of the database aspect, I can create a temporary email address and delete it once no longer needed.

Ok, I do all this on an x86_64 virtual server, but it could be done on a Pi easily with the right internet connection.

Well, not all. The database runs on a Pi 2B in My SQL and is replicated to the x86_64 server which uses MariaDB.

SynGreis
Posts: 85
Joined: Tue Nov 07, 2017 6:26 am

Re: Nginx + mail server

Mon Sep 02, 2019 10:30 am

I was looking for a solution to host my own mail server rpdom so what you posted sounds like the right solution for me.

what commands did you run?

User avatar
rpdom
Posts: 15208
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Nginx + mail server

Mon Sep 02, 2019 1:43 pm

SynGreis wrote:
Mon Sep 02, 2019 10:30 am
I was looking for a solution to host my own mail server rpdom so what you posted sounds like the right solution for me.

what commands did you run?
It would be difficult to give a simple list of commands, as it took me a while to get the server set up and put live before I was happy with it.

Well, my main mail server doesn't run on a Pi. It runs on a virtual x86_64 server ($5/month) in a Docker container. The OS I use inside the container is Alpine and I use the usual Postfix and Dovecot for the mail server. There are loads of tutorials out there on how to set up a Linux mail server (which would be appropriate for Raspbian too). Also various sites to check the security of the server, which is very important. Apart from SSL there is also DKIM and SPF and stuff like that to consider.

With the VPS provider I am using you also have to contact them to get the various ports for email to be unblocked and convince them that it can't be used as a general mail relay. (They were actually very good about that and unblocked the ports within an hour of me emailing their support people on a Sunday morning! :) Officially they only give support during normal working hours 9-5 Mon-Fri. )

SynGreis
Posts: 85
Joined: Tue Nov 07, 2017 6:26 am

Re: Nginx + mail server

Mon Sep 02, 2019 5:10 pm

just found out my ISP blocked port 25 but is using 587 instead...i added relayhost

Code: Select all

relayhost = domain.com:587
and port forwarded 587.

still no luck...this is nuts, i should not have this much trouble.

User avatar
DougieLawson
Posts: 36144
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Nginx + mail server

Mon Sep 02, 2019 6:04 pm

Port 587 needs a userid/password.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

SynGreis
Posts: 85
Joined: Tue Nov 07, 2017 6:26 am

Re: Nginx + mail server

Tue Sep 03, 2019 12:52 am

where would i get this login info? the one im looking at requires me to use the isp email and i want one that mat hes my domain.

This mail server feels like its a lot harder than it should.

User avatar
DougieLawson
Posts: 36144
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Nginx + mail server

Tue Sep 03, 2019 6:08 pm

From your ISP.
It's likely the userid they've already issued to you.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Return to “Beginners”