You are here

Mail Server to Mail Server via AREDN MESH - Possible? How?

18 posts / 0 new
Last post
km6zpo
km6zpo's picture
Mail Server to Mail Server via AREDN MESH - Possible? How?

I setup a mail server which has a convenient web interface on a computer connected to my ARDEN node.  That node is tunneled in to the Southern California region.  The name of my server is km6zpo-winlink.local.mesh.  (It's called that because I'm also running an RMS Relay on it)

t's simple enough using the web interface to send emails back and forth on the server since essentially those message are staying on the same server. 

For example:
user1@km6zpo-winlink.local.mesh can send to user2@km6zpo-winlink.local.mesh - that's easy.

Assuming that two separate mail servers could "see" each other by way of the AREDN network, is it possible for a user on one system to send an email to a user on another system?

For example:

mark@kmzpo-winlink.local.mesh send to someuser@somedomain.local.mesh

Has anyone tried this?  Does anyone have a mail server running for me to test?  (Check to see if you can "see" my mail server first: http://km6zpo-winlink.local.mesh )

Mark Warrick
KM6ZPO

km6zpo
km6zpo's picture
Yes, it works
To answer my own question, I tested a known good email address on a known good ARDEN node.  I have confirmed that YES, sending from one email server which has access to another email server over the AREDN mesh works.  The caveat, of course, is that the two servers can talk to each other.  

So this leads me to my next question, which I am testing now.  Let's say we have three mail servers A, B and C.  A and B can talk to each other and B and C can talk to each other.   So, can I use server B in this scenario as a Smart Host to relay a message from A to C ?  That's my current test.  I'll report back whether or not it succeeded.
 
K6CCC
K6CCC's picture
Maybe
If your mail server has the ability to use a mail proxy, it likely would work.  However normally the way modern mail systems work, each mail server directly passed traffic to the destination.  BTW, in all likelyhood if you do set your mail server to use a proxy, it may well attempt to send all traffic to the proxy, so if it can't reach the proxy, it will not be able to send any mail to anyone that is on a different mail server.  Single point of failure.  If your server is smart enough, it may be able to send mail to the proxy only if it can't find a direct route.  I've never used a proxy on my server, so I don't have any details on that type of use.
 
km6zpo
km6zpo's picture
I'm using a free email system
I'm using a free email system called Mail Enable (https://mailenable.com/).  It has a setting for "Smart Host" which esentially routes all SMTP traffic through an external server.  To clarify, when I say external, I don't mean outside the AREDN network.  For now I've set the Smart Host to another mail server which is a known good connection from what I can see.  

NOW, here's where this gets interesting...  If I can route email to another server ON the mesh, what's to stop me from routing messages OFF the mesh?  Why would I want to do that?  Well let's assume the Internet backbone for Southern California went down and all cell and phone service went down.  I have really a couple options: I could send a Winlink message through RMS relays via the mesh.  We all know how to do that.  But that requires special software (and a ham license) and it requires training.  Everybody knows how to use email.  So presumably I can send emails across the RF connected mesh (locally - all across the region) to any email server in the area.  

P.S. MailEnable has a pretty nice web interface.  You don't even need a separate webmail client.  So that means it's platform independent on the client side.  I'll setup an account for you to check it out, Jim and email you the login info.   Go to: http://km6zpo-winlink.local.mesh/
 
kc4jir
MailEnable on MESH
Got it to work on localhost with 2 email clients- what is the settings so email could be sent and received across the MESH. Tried every setting I could think of? Thanks, Dave Bury kc4jir
km6zpo
km6zpo's picture
Server to server emails
Hello Dave,

To send from one mesh connected server to another mesh connected server, you need to first make sure that the two servers are able to talk to each other.  I know, for example, that you would not be able to send a message from your server to mine because I can't see any of your nodes (kc4jir).  Look through your mesh status page - find somebody in your area of the mesh who has a mail server running and contact them directly.

Once you know which server and account to send to, it's a simple as normal email.  For example, if you were able to "see" my mail server, you could send a message to km6zpo@km6zpo-server.local.mesh

The part before the @ symbol is the account name.  The part after the @ symbol is the server name. 

Hope that helps, sorry I can't help you test.

---mark, KM6ZPO

 
kc4jir
Mailenable
Mark,
 
Thanks for the quick response! I thought the mailenable server would operate in a client-server configuration by making the server IP the same as the node lan ip, then anyone on my mesh network could just point the client to that IP.  No such luck. All the rest of my mesh applications that used a client - server relationship worked in this fashion such as filezilla, winlink telnet post office, etc.
 
I am currently running 2 hap ac lite aredn nodes that are tunneled to another ham across town with 2 as well.  We are running voip phones, meshchat, winlink telnet post office, Team Viewer, and Filezilla for file transfer.  They all seem to work -- email has stumped me.
 
Both MailEnable and Hmailserver worked well when the server  host name is local host using  2 separate email clients( Thunderbird, emclient and even outlook sent and received emails on the same computer that hosted the email server. Didn't know if the tunneling had something to do with it not working.
 
So it sounds like what you are saying that you need another server somewhere on the mesh to move email across the mesh. Question is what setting allows the two servers to talk to each other?
 
Email was the last of the services I was testing  for an ARES AREDN project for our county EOC and 2 hospitals.
 
I will configure another email server on the network and see if I can get it to work
 
Thanks again for help.
 
Dave Bury
kc4jir
km6zpo
km6zpo's picture
MESH is just a transport - mail works like any other email serve
Hi Dave,

Email on the mesh is basically the same as email on the Internet.  I think what you're missing here is a basic understanding of how email works.  This website and many others like it will be helpful: https://www.makeuseof.com/tag/technology-explained-how-does-an-email-ser...

If you are trying to send email from a MESH-connected server to an external email server (for example, somebody's hospital email account), MESH email is not the best idea.  While you CAN send email out, they will not be able to simply hit reply to get a message back to you.   This is because the MESH is its own "internet" of sorts.  The domain name local.mesh does not exist on the Internet.   So when their email servers try to locate {yourname}@{yourmeshserver}.local.mesh, it won't be found.   Similarly, if two email servers are on disparate parts of the MESH, the same problem will happen.  

But let's say you all decide that external users (i.e. hospital staff) and licensed ham operators are willing to use the same web-based email server.  MailEnable makes that possible and that's how I have things setup.  On the WAN (internet side), users can login to the email server at http://mail.km6zpo.com/Mondo/lang/sys/login.aspx .  On the MESH side of that same email server. licenses operators would use this link to login: http://km6zpo-server.local.mesh/MEWebmail/Mondo/lang/sys/login.aspx

Each person needs to have an account on MY email server, whether they are accessing it from outside or inside the MESH.  External users cannot simply setup an email client to point to my server - why?  Same as noted above.  Because they are outside the mesh, any messages TO a server on the MESH would go nowhere.  BUT, so long as they login to the web interface, communications can happen.   And that's a good thing because no involvement from the hospital's IT staff is required.  And I guarantee you, the average user has NO CLUE about how to setup an email client.  Even if you give them step by step instructions, most are going to opt to use the web interface anyway.  

So, before we dig deeper, perhaps you can discuss your use case exactly.  Keep in mind, external users (hospitals, etc.) are NOT going to be able to send messages to the MESH.  

---mark, KM6ZPO
kc4jir
MESH Email

Mark,

Thanks for the reply and the links.  All the services I am developing and testing  are mesh only -- no external customers -- and don't rely on the internet.  I look at the mesh as a intranet so what I am trying to get going is an email service for node computers strictly on the MESH.-- so I guess you could call in intranet email.

The mesh and the services are designed to be used by hams and will be setup by hams.The EOC and Hospitals have ARES members assigned.

So in essence I was looking at a stand alone email server with email accounts populated ( same domain) and hosted on one of the mesh nodes. Then the node computers would have email clients setup to process email on the mesh.
 
I will admit email is out of of lane a bit since I have never tackled it.  So all the help you can give is appreciated.  I have started looking at the webmail capability of mailenable  Didn't have any luck with IMAP/POP and SMTP setup connecting to a server on one of my modes.

Thanks for your interest in helping out.

Dave Bury
KC4JIR


 

km6zpo
km6zpo's picture
Put a HAP at each location, problem solved

Hi Dave,

Here's your solution: put a HAP AC Lite at each location that needs access to your email server.  Tunnel each one (via the Internet initially, but plan to build out an AREDN RF infrastructure) to that location.  Then each location will be able to access that mail server, whether that be through the web interface or by setting up email clients.  You don't need multiple mail servers.

NOTE: If you don't setup the RF links between facilities, and the Internet goes down, you'll lose your tunnels and the remote locations won't have access to email.  That's why you need to start building out the RF infrastructure - so that no location is dependent upon the Internet working.

PS. Winlink will accomplish all of the above and already has an infrastructure in place to support everything you're trying to do.  Since every one of your operators is going to be a licensed operator, there really is no need for a mail server.

---mark, KM6ZPO

kc4jir
Mesh Email
Mark, right before you sent your last reply, I decided to try one last ditch effort -- took my laptop and connected it to one of mesh node ( AC Lites) with a lan cable instead of trying  to connect through the 5 GHZ Hotspot (feature of the HAPS), set the inbound and outbound ( IMAP and SMTP) binding IPs to the mesh IP given to the mailenable email server-- pointed the EMail Client to the server IP ---- worked just like you said in your last reply. My nodes are tunneled to a ham across town who is running 2 haps -- set up his email client --- emails worked great.  So in your words -- solved.

We will eventually build out the RF mesh when we outfit the EOC and Hospitals.  They have requested a design and estimated cost but we wanted to tunnel for now to learn and play.

So thanks very much for sticking with me! I'm hosting   RMS Relay for a Telnet Post Office and we run Telnet P2P sometimes. 

Thanks,
Dave
KC4JIR


 
kc4jir
Email Access with HAP Hotspot
I must of had a setting wrong - I can now access the email server access the email server using the HAP hotspot Thanks makes sense.
kc4jir
Sorry for Dup Words
Shouldn't do these on a cell phone
nc8q
nc8q's picture
making the server IP the same as the node lan ip

"I thought the mailenable server would operate in a client-server configuration by making the server IP the same as the node lan ip."

Since 'mailenable' is a Microsoft Windows OS application,
the computer running 'mailenable' should not have the same IP address as the node (an OpenWRT/AREDN OS)
(from which it is getting its IP address (via DHCP)).

What am I missing?

Chuck

kc4jir
Missing?
Chuck, Sorry for the confusion - meant to say the lap IP given to the node computer where the server is hosted. The word computer got left out. Dave
nc8q
nc8q's picture
"what is the settings so

"what is the settings so email could be sent and received across the MESH."

Hi, Dave:

I am not sure what you mean when you refer to 'the MESH'.
I assume that your 'the MESH' is 2 or more AREDN devices linked by RF or DtD or 'tunnel'.
Email from a client application would be sent to an email server application advertised on a node on your 'the MESH'.

Chuck

kc4jir
Mesh Meaning
Chuck, I am running 2 HAP AC Lites in my shack as a test. So yes mesh is the network of the two HAPS. They mesh RF and are tunneled to two other HAP operated by another ham across town. We are developing and testing services we plan to host for an EOC/ Hospital ARES project Dave Bury KC4JIR
kk6gde
For example:

For example:

mark@kmzpo-winlink.local.mesh send to someuser@somedomain.local.mesh

Normally mail servers rely on DNS MX records to figure out which server to connect to when delivering email.  The problem here is that aredn doesn't really use traditional DNS for the .mesh TLD.  Olsrd finds nodes and populates a text file .. much like the contents of an etc/hosts file .. and then dnsmasq looks in that file to see if there are any matches when lookups are executed. If that fails, dnsmasq will try to reach out to traditional dns servers. However since the .mesh TLD doesn't actually exist, dnsmasq will fail any type of additional lookup (such as for an MX record).

That means if you want to deliver emails to different .mesh nodes, you'd need to take that olsrd node data and write rules for your email server so that it knows where to connect for delivery.  I think that could be automated with a script, assuming each node knows about all the other nodes.  However, if there are nodes that want email but aren't hosting their own email server, things get tricky because somehow your email server would need to know where to deliver to instead (This is why MX records are so useful).  One possible workaround would be for each node to either host their own email server, or have some additional iptables rules on each node that would forward incoming port 25 traffic to the mail server that will accept their mail.

As for delivering to the outside world, that is possible, however it would require three things -- one, a node with an email service that is able to traverse the wan port (a setting we can enable through the aredn gui). Two, you would need to own a domain name that you would use in place of your local.mesh address because most mail servers will reject source emails with domains that don't exist.  Some mail servers can re-write the to and from addresses as they process the emails, so jimmy@callsign.local.mesh would become jimmy@real.domain.name.com.  Three, you may need to use a mail relay depending on what kind of internet connection you have --thanks to spammers, most isps actively block port 25 outgoing traffic, and most receiving mail servers are outright hostile to traffic that is designated as belonging to non-corporate environments. 

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer