Postal cluster. Replication mail server

NethServer Version: 8
Module: mail

Hello. How to configure the replication of mail servers in the new version? I do not understand. Do you need to do this through Relay?

I have configured Relay but on the slave server I get the following text:

2024-10-29T17:50:15+03:00 [1:mail15:dovecot] imap-login: Login: user=, method=PLAIN, rip=10.5.4.1, lip=10.5.4.1, mpid=6042, secured, session=
2024-10-29T17:50:15+03:00 [1:mail15:dovecot] imap(test1)<6042>: Disconnected: Logged out in=90 out=994 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
2024-10-29T17:50:19+03:00 [1:mail15:dovecot] imap-login: Login: user=, method=PLAIN, rip=10.5.4.1, lip=10.5.4.1, mpid=6048, secured, session=
2024-10-29T17:50:19+03:00 [1:mail15:dovecot] imap(test1)<6048>: Disconnected: Logged out in=90 out=994 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
2024-10-29T17:51:15+03:00 [1:mail15:dovecot] imap-login: Login: user=, method=PLAIN, rip=10.5.4.1, lip=10.5.4.1, mpid=6054, secured, session=
2024-10-29T17:51:15+03:00 [1:mail15:dovecot] imap(test1)<6054>: Disconnected: Logged out in=90 out=994 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
2024-10-29T17:51:20+03:00 [1:mail15:dovecot] imap-login: Login: user=, method=PLAIN, rip=10.5.4.1, lip=10.5.4.1, mpid=6060, secured, session=
2024-10-29T17:51:20+03:00 [1:mail15:dovecot] imap(test1)<6060>: Disconnected: Logged out in=90 out=994 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
2024-10-29T17:51:31+03:00 [1:mail15:clamav] SelfCheck: Database status OK.

Whatā€™s wrong?
The mail2 server is the main server,
server mail1 is the slave.
Relay is configured on both

I donā€™t know if I understood correctly but if itā€™s about using failover servers for sending then you just need the right MX records in DNS for your servers, see also Mail ā€” NS8 documentation and MX record - Wikipedia

1 Like

Iā€™d like to make two mail servers that will replicated between them. That is, if the first mail server goes down, the second one will have a complete or nearly complete copy of the messages.

I realized that dovecot needs to be configured.

I ran the command:
podman exec -ti dovecot doveconf -n
It didnā€™t work. I need to run the command:
runagent -m mail1

But it doesnā€™t work either!
What could be the reason?
Iā€™m getting an error:
No such file or directory: '/home/user/.config/state/agent.env'

Hereā€™s how to customize dovecot:

Enter the app environment:

runagent -m mail1

Show the dovecot config:

podman exec -ti dovecot doveconf -n

Edit the configuration:

podman exec -ti postfix vi /etc/postfix/main.cf.d/myoverride.cf

Restart the service:

systemctl --user reload postfix

It should be something like /home/<app_instance_name>/.config/state/...

I have an error:
bash: runagent: command not found

I just donā€™t understand how to get this up and running! I looked it up in the manuals. Thereā€™s no such thing. What kind of magic is this?

I couldnā€™t find instructions on the nethserver command line logic. I realized that nethserver works in podman I found the containers and logged into them, but nothing works there either. Maybe this is beyond the scope of nethserver but really not clear.

More or lessā€¦ runagent is a wrapper command located at /usr/local/bin/runagent, IIRC it requires to be root (executed on CLI without needing to access podman container beforehand). Used to access, inspect and modify rootless containers.

2 Likes

Thank you very much for your reply. It is not in any manual. If it wasnā€™t for you, I wouldnā€™t have figured out how to do it! Now I have found the entry point from which there are manuals!

P.s. In the end, the entry point looks like this:
/usr/local/bin/runagent -m mail1
Where the number may not be 1. The digit must be viewed in the web console. I have uninstalled and reinstalled the mail application many times, so I have it as mail15.

one way to edit files inside container: