1

Topic: Fetching mails from master Iredmail server to my slave iredmail serve.

I have a setup of 2 Iredmail Servers with MYsql authentication.

One as Master and other as Slave.

Master will be recieving all the emails and Slave should fetch emails from the Master.

End users will download the emails from Slave server.

I want to know what is the best way for doing this ?

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Fetching mails from master Iredmail server to my slave iredmail serve.

Some questions:

* Why you need master-slave servers like this? What do they exactly used for?
* Why not download mails from master server directly?
* Do you need to keep a copy of emails on master server?

3

Re: Fetching mails from master Iredmail server to my slave iredmail serve.

==== Provide basic information to help troubleshoot ====
- iRedMail version:
- Linux/BSD distribution name and version:
- Any related log? Log is helpful for troubleshooting.
====

Slave server will be in our local premises whereas Master Server will be in Datacenter.

If users are told to use Master server directly instead of slave server, then they might utilize bandwidth while sending heavy mails to the local domain as well. Users will be using Thunderbird client.

Hence we just want to fetch all the mails from Master Server to Slave server.

4

Re: Fetching mails from master Iredmail server to my slave iredmail serve.

Two possible solutions:

1) Relay all mails from Master server to Slave server with global transport or per-domain transport, then all incoming mails will be saved/stored on Slave server.

iRedMail supports per-domain transport and per-user transport by default, of course you can config Postfix to use a global transport setting.

For example:

# File: /etc/postfix/transport

your_domain.com smtp:[IP_ADDRESS_OF_SLAVE_SERVER]:25
# OR:
your_domain.com smtp:[FQDN_DOMAIN_NAME_OF_SLAVE_SERVER]:25

Reference:
- http://www.postfix.org/postconf.5.html#transport_maps
- http://www.postfix.org/transport.5.html

With iRedAdmin-Pro, you can easily configure per-domain or per-user transport. Screenshot attached below.

If you don't have iRedAdmin-Pro, you can also manage per-domain/per-user transport with phpLDAPadmin or phpMyAdmin.
- For OpenLDAP backend, it's stored in attribute "mtaTransport" in domain object or user object.
- For MySQL backend, it's stored in column "domain.transport" (per-domain transport) or "mailbox.transport" (per-user transport) in database "vmail".

2) Try "fetchmail" on slave server:

* On slave server: Fetch mails from master server, deliver fetched mails into virtual mail users hosted on slave server.
* Clients fetch mails from slave server with Thunderbird.

Fetchmail: http://www.fetchmail.info/

Obviously, solution #1 is simpler and easier.

Per-domain transport setting in iRedAdmin-Pro:
http://screenshots.iredmail.googlecode.com/hg/iredadmin/domain_profile_relay.png

Per-user transport setting in iRedAdmin-Pro:
http://screenshots.iredmail.googlecode.com/hg/iredadmin/user_profile_relay.png

5

Re: Fetching mails from master Iredmail server to my slave iredmail serve.

Dear ZhangHuangbin,

I am using postfixadmin to manage users,domains and aliases.

I am receiving following messages in fetchmail logs after running fetchmail :

fetchmail: sleeping at Fri 07 Oct 2011 01:22:42 PM IST for 5 seconds
fetchmail: awakened at Fri 07 Oct 2011 01:22:47 PM IST
fetchmail: Server CommonName mismatch: localhost.localdomain != remote_IP
fetchmail: Server certificate verification error: self signed certificate
fetchmail: 2 messages for username at USERNAME (3315 octets).
fetchmail: reading message username@remote_IP:1 of 2 (1645 octets) (log message incomplete)fetchmail: SMTP error: 450 4.1.2 <username@localhost>: Recipient address rejected: Domain not found
fetchmail:  not flushed

i don't understand why i m getting SMTP error.

However the script is able to know that there are 2 mails on the remote mailbox.

6

Re: Fetching mails from master Iredmail server to my slave iredmail serve.

Shashank wrote:

fetchmail: Server CommonName mismatch: localhost.localdomain != remote_IP

It's clear in above error message.

P.S. Fetchmail is not officially supported by iRedMail team, so you have to solve it yourself.
And personally, i prefer solution #1, it's easier and much simpler.