LAN-decentralized-no-internet setup: mDNS + SMTP-server (postfix) + delta.chat (+ IMAP-server (dovecot)?)

I managed to run host1 .local and host2 .local using mDNS and each participant using its own simple-lightweight SMTP mail server, some details [1]

Then, now there is a possible setup-use case where you can use email in the same LAN, because thunderbird and claws mail allow to use a localhost mailbox (specifically, in file /var/mail/myuser). Next think I thought was to have a “decentralized chat” that would be possible if delta .chat manages the localhost mailbox.

I tried to login with myuser@localhost (it forces me to put a password), but it says login is incorrect. I also tried myuser@host1 .local, same error.

I would be very happy to see if more people is interested in this feature, and how feasible would be to include it in delta .chat

I also thought to include an imap server, would be nice that when it is localhost you don’t need a password (no authentication)

[1] https://gitlab.com/pedrolab/community-network-email-service

2 Likes

If you don’t have the autodiscover/autoconfiguration (Autoconfig: How to create a configuration file - Mozilla | MDN) file, you should fill out all the Advanced settings manually, have you done that? (imap server & smtp server address and credentials)

This(including an imap server) makes not much sense for the main version of deltachat, because:

  • Most people would n’t use it and it makes the app bigger.
  • It wouldn’t allow for delivering messages that are sent while the receiving phone is offline from the local network (as example because the battery ran out) [yeah I know the normal smtp server tries to deliver the mails a few times, but thats not the point here]

I would rather suggest making a separate IMAP server app that can be setup easily and used for multiple purposes. Like you have a local network and an you just install that app on an old phone/laptop/device that you had laying around, connect it to the network and have an working email server up and running in like 2 minutes.

If you are searching for real peer2peer communication they are server less messenger projects that might be better suited for such a project.
Sidenote: this local network usecase is a bit similar to an email server in corporate VPN network.

Thanks for answering @Simon

After your reply I thought I had to continue with this thread when I had a imap server. Adding imap server was easier than I expected - and it works in thunderbird

this is the advanced setup (localhost in server parts also fail):

logs show that it tries incorrect authentication methods (tries to connect using SSL even when I switched it off explicitly)

"2019-09-01T20:10:58.070Z"	"main/deltachat"	"ERROR"	[{"columnNumber":11,"lineNumber":143,"fileName":"/opt/DeltaChat/resources/app.asar/src/main/deltachat/index.js","functionName":"onError","source":"    at onError (/opt/DeltaChat/resources/app.asar/src/main/deltachat/index.js:143:11)"},{"columnNumber":7,"lineNumber":151,"fileName":"/opt/DeltaChat/resources/app.asar/src/main/deltachat/index.js","functionName":"DeltaChat.dc.on","source":"    at DeltaChat.dc.on (/opt/DeltaChat/resources/app.asar/src/main/deltachat/index.js:151:7)"},{"columnNumber":13,"lineNumber":182,"fileName":"events.js","functionName":"DeltaChat.emit","source":"    at DeltaChat.emit (events.js:182:13)"},{"columnNumber":12,"lineNumber":733,"fileName":"/opt/DeltaChat/resources/app.asar/node_modules/deltachat-node/lib/deltachat.js","functionName":"handleEvent","source":"    at handleEvent (/opt/DeltaChat/resources/app.asar/node_modules/deltachat-node/lib/deltachat.js:733:12)"},{"columnNumber":7,"lineNumber":29,"fileName":"/opt/DeltaChat/resources/app.asar/node_modules/deltachat-node/lib/deltachat.js","functionName":"DeltaChat.binding.dcn_set_event_handler","source":"    at DeltaChat.binding.dcn_set_event_handler (/opt/DeltaChat/resources/app.asar/node_modules/deltachat-node/lib/deltachat.js:29:7)"}]	"Could not connect to IMAP-server host1.local:143 using SSL. (Error #43)"
"2019-09-01T20:10:58.127Z"	"main/deltachat"	"ERROR"	[{"columnNumber":11,"lineNumber":143,"fileName":"/opt/DeltaChat/resources/app.asar/src/main/deltachat/index.js","functionName":"onError","source":"    at onError (/opt/DeltaChat/resources/app.asar/src/main/deltachat/index.js:143:11)"},{"columnNumber":7,"lineNumber":151,"fileName":"/opt/DeltaChat/resources/app.asar/src/main/deltachat/index.js","functionName":"DeltaChat.dc.on","source":"    at DeltaChat.dc.on (/opt/DeltaChat/resources/app.asar/src/main/deltachat/index.js:151:7)"},{"columnNumber":13,"lineNumber":182,"fileName":"events.js","functionName":"DeltaChat.emit","source":"    at DeltaChat.emit (events.js:182:13)"},{"columnNumber":12,"lineNumber":733,"fileName":"/opt/DeltaChat/resources/app.asar/node_modules/deltachat-node/lib/deltachat.js","functionName":"handleEvent","source":"    at handleEvent (/opt/DeltaChat/resources/app.asar/node_modules/deltachat-node/lib/deltachat.js:733:12)"},{"columnNumber":7,"lineNumber":29,"fileName":"/opt/DeltaChat/resources/app.asar/node_modules/deltachat-node/lib/deltachat.js","functionName":"DeltaChat.binding.dcn_set_event_handler","source":"    at DeltaChat.binding.dcn_set_event_handler (/opt/DeltaChat/resources/app.asar/node_modules/deltachat-node/lib/deltachat.js:29:7)"}]	"SMTP-SSL connection to host1.local:23 failed (Connection refused)"
"2019-09-01T20:10:58.143Z"	"main/deltachat"	"ERROR"	[{"columnNumber":11,"lineNumber":143,"fileName":"/opt/DeltaChat/resources/app.asar/src/main/deltachat/index.js","functionName":"onError","source":"    at onError (/opt/DeltaChat/resources/app.asar/src/main/deltachat/index.js:143:11)"},{"columnNumber":7,"lineNumber":151,"fileName":"/opt/DeltaChat/resources/app.asar/src/main/deltachat/index.js","functionName":"DeltaChat.dc.on","source":"    at DeltaChat.dc.on (/opt/DeltaChat/resources/app.asar/src/main/deltachat/index.js:151:7)"},{"columnNumber":13,"lineNumber":182,"fileName":"events.js","functionName":"DeltaChat.emit","source":"    at DeltaChat.emit (events.js:182:13)"},{"columnNumber":12,"lineNumber":733,"fileName":"/opt/DeltaChat/resources/app.asar/node_modules/deltachat-node/lib/deltachat.js","functionName":"handleEvent","source":"    at handleEvent (/opt/DeltaChat/resources/app.asar/node_modules/deltachat-node/lib/deltachat.js:733:12)"},{"columnNumber":7,"lineNumber":29,"fileName":"/opt/DeltaChat/resources/app.asar/node_modules/deltachat-node/lib/deltachat.js","functionName":"DeltaChat.binding.dcn_set_event_handler","source":"    at DeltaChat.binding.dcn_set_event_handler (/opt/DeltaChat/resources/app.asar/node_modules/deltachat-node/lib/deltachat.js:29:7)"}]	"SMTP-Socket connection to host1.local:587 failed (Connection refused)"
"2019-09-01T20:10:58.215Z"	"main/deltachat"	"ERROR"	[{"columnNumber":11,"lineNumber":143,"fileName":"/opt/DeltaChat/resources/app.asar/src/main/deltachat/index.js","functionName":"onError","source":"    at onError (/opt/DeltaChat/resources/app.asar/src/main/deltachat/index.js:143:11)"},{"columnNumber":7,"lineNumber":151,"fileName":"/opt/DeltaChat/resources/app.asar/src/main/deltachat/index.js","functionName":"DeltaChat.dc.on","source":"    at DeltaChat.dc.on (/opt/DeltaChat/resources/app.asar/src/main/deltachat/index.js:151:7)"},{"columnNumber":13,"lineNumber":182,"fileName":"events.js","functionName":"DeltaChat.emit","source":"    at DeltaChat.emit (events.js:182:13)"},{"columnNumber":12,"lineNumber":733,"fileName":"/opt/DeltaChat/resources/app.asar/node_modules/deltachat-node/lib/deltachat.js","functionName":"handleEvent","source":"    at handleEvent (/opt/DeltaChat/resources/app.asar/node_modules/deltachat-node/lib/deltachat.js:733:12)"},{"columnNumber":7,"lineNumber":29,"fileName":"/opt/DeltaChat/resources/app.asar/node_modules/deltachat-node/lib/deltachat.js","functionName":"DeltaChat.binding.dcn_set_event_handler","source":"    at DeltaChat.binding.dcn_set_event_handler (/opt/DeltaChat/resources/app.asar/node_modules/deltachat-node/lib/deltachat.js:29:7)"}]	"SMTP-login failed for user music (Authentication is not supported)"

Thank you for your time

This might be out of scope of your request but have you seen

1 Like

@Simon would be awesome to have an easy way to self host email in 2 minutes :slight_smile: about what you say of not been able to send message to someone when it is offline, that is not that bad, can you send messages to someone that is offline in a serverless messenger anyway?
I would prefer this than burner accounts :stuck_out_tongue: since I can’t host such a server, but having an small “pocket email server” would be awesome, or really easy ways to selfhost email is a must if you want to presume to other people “email is decentralized, you can have your own server” that is not that true as with XMPP

I found this: (but it is a POP3 server :frowning:)
https://play.google.com/store/apps/details?id=com.icecoldapps.emailserver&hl=en_US

don’t seems to be free software :sob:

I don’t know much about mailservers.
Generally I would say, find an FOSS mailserver and try to compile it for android-linux or find something written in java or python with no external dependencies.

A quick search brought me to http://hwmail.sourceforge.net/ (written in java) and https://github.com/Nordgedanken/IMAPServer-rs (WIP imap server written in rust), maybe there is a way to compile https://www.dovecot.org/ to run on an android device.

Good master Simon,

…coming from here “real” end-to-end by DC coming with an device-server, guided by Master link2tx: Is it the case that is makes it remarkable and worthy to consider bigger?

Having looked a little there are such a smtp-server (maybe Simple SMTP) apps which seems to be pretty small in size. (not able to try app in addition if such works) But generally, if such comes with a “let your device serve” option at setup, and if possible to preconfigurate, it’s possible - told…

-…the opposite, and again the hint that globally people have neither email or wouldn’t know/remember there access pw.

not for most casual users that are not technical and just want to chat.
Also on android adding an X megabyte native dependency (mailserver in this case) makes the app ~x*4 mb bigger (- duplicated stuff that can be compressed, because an apk is a zip file), because it needs to be compiled for different architectures.
So not for the “mainstream” version of deltachat at the moment, maybe somewhere in the far future.
Maybe a deltachat fork could provide a prove of concept that paves the way for an Implementation into the official DC version :wink:

SMTP is only for sending, you also need a IMAP* server to receive the email. Having the receiving server on the recipients device means that messages can only be sent to the recipient when they are online - that breaks the whole off-on-line communication that DC is currently capable of which makes it suitable for use in unstable/flaky/semi-stable networks.

* there are some ideas to implement support for pop3 in the future.

I see the wish for easy configuration, though.
What about a separate app that turns an old, always-connected-to-power, android device into a mailserver that shows a qr code to create (burner) accounts on that mailserver?

Also if one can keep their simcard from getting lost they can also write their passwords into an note taking app or even better use a password manager. If one does anything serious online they need to keep track of passwords anyway. https://play.google.com/store/apps/details?id=keepass2android.keepass2android could be used for example. (or one of F-Droid Search: keepass) or use a pen to write it inside of the phone case or something.

The problem with running email server on mobile is that it will be unavailable whenever the user does not have a connection, making it impossible to deliver message in their inbox.

One more or less practical solution I see is to add support for .onion domains and a simple dockerized setup that allows to run such server without the problems of registering a domain, populating DNS records, getting a TLS certificate and so on. Such servers will normally be able to speak only to other .onion servers, but with multi-account support you can run such experimental DC server in addition to your main account.

See related topic: Delta chat through tor?

1 Like

All undetstandable and Sadhu for steadyso much patient.

“Chat” maybe, give to much idea ot communicat in the present., live.