Because you can see that in the logs of de sending iredmail server. All I did was: set BackupMX in LDAP and set the parameter relayhost in main.cf. Nothing more, just a fresh installation.
This morning, I removed the relayhost option in main.cf to see what happens. Still the domain is backupMX. And then I get this:
Oct 10 03:43:28 host-backup postfix/smtpd[21836]: 68F5B46E1819: client=host.backup.domain.me[127.0.0.1]
Oct 10 03:43:37 host-backup postfix/cleanup[21863]: 68F5B46E1819: message-id=<20141010074328.68F5B46E1819@host.backup.domain.me>
Oct 10 03:43:37 host-backup postfix/qmgr[21702]: 68F5B46E1819: from=<someone@yahoo.com>, size=347, nrcpt=1 (queue active)
Oct 10 03:43:42 host-backup postfix/smtpd[21870]: connect from host.backup.domain.me[127.0.0.1]
Oct 10 03:43:42 host-backup postfix/smtpd[21870]: 6960446E181C: client=host.backup.domain.me[127.0.0.1]
Oct 10 03:43:42 host-backup postfix/cleanup[21863]: 6960446E181C: message-id=<20141010074328.68F5B46E1819@host.backup.domain.me>
Oct 10 03:43:42 host-backup postfix/qmgr[21702]: 6960446E181C: from=<someone@yahoo.com>, size=842, nrcpt=1 (queue active)
Oct 10 03:43:42 host-backup amavis[892]: (00892-01) Passed CLEAN {RelayedInternal}, MYNETS/MYUSERS LOCAL [127.0.0.1]:57640 <someone@yahoo.com> -> <name@domain.me>, Queue-ID: 68F5B46E1819, Message-ID: <20141010074328.68F5B46E1819@host.backup.domain.me>, mail_id: Y_S-v4IzMgqs, Hits: -4.792, size: 347, queued_as: 6960446E181C, 5515 ms
Oct 10 03:43:42 host-backup postfix/smtpd[21870]: disconnect from host.backup.domain.me[127.0.0.1]
Oct 10 03:43:42 host-backup postfix/smtp[21864]: 68F5B46E1819: to=<name@domain.me>, relay=127.0.0.1[127.0.0.1]:10024, delay=25, delays=20/0.01/0.02/5.6, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 6960446E181C)
Oct 10 03:43:42 host-backup postfix/qmgr[21702]: 68F5B46E1819: removed
Oct 10 03:43:42 host-backup postfix/pipe[21871]: 6960446E181C: to=<name@domain.me>, relay=dovecot, delay=0.35, delays=0.26/0.02/0/0.07, dsn=5.1.1, status=bounced (user unknown)
Oct 10 03:43:42 host-backup postfix/cleanup[21863]: BFDCC46E1819: message-id=<20141010074342.BFDCC46E1819@host.backup.domain.me>
Oct 10 03:43:42 host-backup postfix/qmgr[21702]: BFDCC46E1819: from=<>, size=2770, nrcpt=1 (queue active)
Oct 10 03:43:42 host-backup postfix/bounce[21874]: 6960446E181C: sender non-delivery notification: BFDCC46E1819
Oct 10 03:43:42 host-backup postfix/qmgr[21702]: 6960446E181C: removed
Oct 10 03:43:47 host-backup postfix/smtp[21876]: BFDCC46E1819: to=<someone@yahoo.com>, relay=mta6.am0.yahoodns.net[98.136.216.25]:25, delay=4.5, delays=0.19/0.01/1.2/3.2, dsn=2.0.0, status=sent (250 ok dirdel)
Oct 10 03:43:47 host-backup postfix/qmgr[21702]: BFDCC46E1819: removed
Oct 10 03:44:21 host-backup postfix/smtpd[21836]: lost connection after UNKNOWN from host.backup.domain.me[127.0.0.1]
Oct 10 03:44:21 host-backup postfix/smtpd[21836]: disconnect from host.backup.domain.me[127.0.0.1]
So after removing the relayhost, iredmail doesn't swap the TO and FROM anymore, but then I get a bounced. Which is strange as it should act as backup MX.
Maybe I am doing something wrong. What should be done to setup a domain act as backup?
What I want is: Primary down, mail is sent to backup. There it is placed in the queue, waiting for the primary to be online again, and so the mail is delivered after all to the right person.