Mail Server

Right now my company is paying $6/mo to Google for each employee’s email address. I installed OnlyOffice Workspace on an AWS EC2 instance which works great for the Document Server but I cannot for the life of me get the Mail Server to work as intended, not as a mail aggregator but as a full fledged Self Hosted Mail Server that can replace Google Mail and the $6/mo being paid for those employee email addresses. Is it possible to setup the mail server with our company’s registered domain so that I can create and issue emails as I currently pay Google to do so? Or does the mail server only function as a portal to aggregate and access third party email providers like Outlook or Apple Mail would?

Hello @michaelpinna3
Yes, you can use Mail module with Mail server as it is described here: Setting up mail server - ONLYOFFICE

Please clarify what difficulties you faced and provide us with details.

I got through everything in that resource you referenced just fine. The DNS records all showed green check marks and I set up email accounts using our company’s domain. However, when it came to actually using the accounts I could not send or receive emails without receiving a ‘connection refused’ email pictured below. Some context… This is getting installed on an AWS EC2 instance. During my troubleshooting, I installed iRedMail on another EC2 instance and discovered that AWS blocks outgoing SMTP requests on port 25 by default. I have since requested that AWS open that port up and I expect iRedMail to work following that request approval. However, with iRedMail I was at least able to send emails to the other email addresses on the same server and receive emails, whereas in my Only Office setup I could not receive or send emails, even to myself or those located on the same server. So I’m not sure that the connection refused error is entirely related to AWS closing port 25 (out) in this case, whereas I’m pretty confident that will solve the problem with my separate iRedMail installation because I’m also not able to receive emails (or send emails to myself) in this case which should not be affected by aws’s port 25 restriction.

^^^ Just confirmed… same error with Port 25 restriction lifted. iRedMail is working fine on my other ec2 instance but I’m still getting the same error message here…

DNS Status:

Hello @michaelpinna3
You are right. The entire situation is related to Amazon’s rules.
Please check it out: Remove port 25 restriction from your EC2 instance

Already did that to no avail. Same error is persisting. I’m still unable to set up mailboxes with my own domain despite removing the port 25 restriction. I’m also unable to access iRedMail emails created on a separate server in an attempt to circumvent the prior issue.

Could you please reproduce the issue and provide us with whole Community server logs folder? It’s located here:/app/onlyoffice/CommunityServer/logs/
We will try to check it out

Here I am again! I have the exact same problem as @michaelpinna3 described above. Same error message, same everything.

I can receive e-mails from anywhere now, but still unable to send anything out: “connection refused”

Hello @brunoleonadvogado
So, the issue is related to outcoming letters only, am I right? Did you install Workspace with Mail server container?
I believe we should start with issue reproducing and after that please provide us with whole Community server and Mail server logs folders. They are located here:
/app/onlyoffice/CommunityServer/logs/
app/onlyoffice/MailServer/logs

Hi @Alexandre, I am also getting this error now (Smtp.ConnectAsync timeout), I believe that this one happens when I set smtp to port 25 instead of 587, just a guess.

1. Which is strange is that it works from time to time, and out of the blue it stops, but the logs should clarify that:

https://escritorio.brunoleonadvogado.com/Products/Files/HttpHandlers/filehandler.ashx?action=download&fileid=2467&doc=UjYweDlDRGpBUlpVRnRGemV5bmxyWGF3ay90dVRLWTN2ZWdsT2lwNXVoTT0_IjI0Njci0

2. I am no IT expert, but I noticed that if I telnet to port 25 (to escritorio.blarafernandes.com:25) I allways get a response form my server. But if I try on ports 587 or 143, it’s not allways the case:

3. If I telnet to the my local server IP (10.0.0.150), I get a server response on all these ports (25, 143 and 587). Is there something bloking these ports from time to time? I have disabled all firewalls (ubuntu server, router, router antivirus…). If I connect from my mobile network I can get a telnet response on all these 3 ports. So I am rulling out my ISP blocking something.

4. My other guess, is that it has something to do with this config screen, witch gives me an port 8081 error if I change anything (mysql access?).

But it seems to works the default IP 172.18.0.4, which I have no clue as where it came from.

I believe that there might be a way to test with other IMAP port 993 ou POP3 110, but still the SMTP should be working on port 25 (can we force to use it on the Mail Server container?).

Hello @brunoleonadvogado
Sorry for the late reply.

Did it work with 25 port? as far as I understand you gave changed default SMTP settings to custom ones (you’re using created mailbox on Mail server).

Please go to the host and run docker ps command. Please check that Mail server container is running. If it’s necessary, restart Mail server container (docker restart ID_of_container). After that go back to portal settings > SMTP settings\Mail server page > try to click Connect button and check the result.
Also please provide us with Mail server container logs (you can get them with docker logs onlyoffice-mail-server command)

but I noticed that if I telnet to port 25 (to escritorio.blarafernandes.com:25)

I’m a little bit confused. Your portal has different domain name (escritorio.brunoleonadvogado.com)

But it seems to works the default IP 172.18.0.4,

Please go to the host > run docker ps > check Mail server container ip address > after that run docker inspect ID_of_Mail_server_container. is it 172.18.0.4?
Also please clarify if Mail server works with 172.18.0.4 address as Mail Server IP in the portal settings.

If I telnet to the my local server IP (10.0.0.150),

Please note that you have to set up Mail server ip address in this tab. In case of docker installation (all containers on the same server) you have to set up ip address of Mail server container.

As usual, we recommend to prepare whole server backup before any server side actions just in case.

Hi @Alexandre, let me explain what happened since my last message:

  1. I was unable to send and receive emails, apparently for no reason the issue had escalated;

  2. The “docker ps” command shows all containers running fine. Apart from this issue, everything else was working fine on my portal;

  3. I then decided to restarted the mail server container, but it didn’t work. So I decided to restart the ubuntu-server and it just worsen the problem;

  4. Upon restarting, the community server container kept restarting itself and would not load my portal. I tried everything but could not recover this container;

  5. As I could nor use anything, I formated the ubuntu-server and reinstalled everything from scratch. I managed to recover my backup and now all is working fine. I am just afraid that it can happen again anytime.

We are glad that the situation is solved. We recommend to prepare whole server backup before any serverside actions. This way you will be able to rollback quickly if something goes wrong.

Anyway, if you face any issues please feel free to contact us.

Everything was working fine but now this issue striked again :frowning:

1. Out of the blue, I started to receive the “connection refused” error when sending e-mails. I then restarted all 6 containers and had to activate the mail accounts, but I was unable to do so as I was getting an “unknown” error message this time:

2. I did double-check the mail server settings and everything seemed fine:

3. I am using the docker script installation on ubuntu server 22.04, everything is up to date and was working fine up until yesterday.

4. The mailserver docker log seems fine, apart from that 7 days antivirus warning:

Starting clamd.amavisd: LibClamAV Warning: **************************************************
LibClamAV Warning: *** The virus database is older than 7 days! ***
LibClamAV Warning: *** Please update it as soon as possible. ***
LibClamAV Warning: **************************************************
[ OK ]

Starting httpd: [ OK ]

Starting OpenDKIM Milter: [ OK ]

Starting spamd: [ OK ]

Starting fail2ban: [ OK ]

Starting server

here are my server logs, as requested before: https://escritorio.brunoleonadvogado.com/Products/Files/HttpHandlers/filehandler.ashx?action=download&fileid=2589&doc=LzdzUUk4WS9WRXhwSFEyc09weFZWWGVTZXRab3ZmaE44MTJOcmIwT2NOND0_IjI1ODki0

Hello @brunoleonadvogado
Please check your PM, I will contact you there.

Update: solved via PM.