Postfix MX backup doesn't send to primary server

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Postfix MX backup doesn't send to primary server

danjjde
Hi friends,
I'm wondering about an Postfix MX backup server correct configuration.
I'm working on Debian Jessie and Postfix 2.11.x.

If I shut down the primary server, the MX backup receive the mail
correctly and mail goes into mailbox 'INBOX'.
The problem is that if I try to look into the postfix queue this is
empty:

Code:
postqueue -p
Mail queue is empty

and of course the message is not delivered to the main server!

I have recently approached Postfix and I would need help debugging this
problem.

These are the setups of the two different servers:

SERVER1: https://pastebin.com/wVaqxj2i

SERVER2: https://pastebin.com/2mYBGvCN


many many thanks


Davide
Reply | Threaded
Open this post in threaded view
|

Re: Postfix MX backup doesn't send to primary server

Wietse Venema
Davide Marchi:
> If I shut down the primary server, the MX backup receive the mail
> correctly and mail goes into mailbox 'INBOX'.

Well that is the mistake. This server should not deliver to mailbox.

Have a look at Postfix documentation:
"Configuring Postfix as primary or backup MX host for a remote site"
http://www.postfix.org/STANDARD_CONFIGURATION_README.html#backup

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Postfix MX backup doesn't send to primary server

danjjde
Il 2017-08-27 14:49 [hidden email] ha scritto:
> Davide Marchi:
>> If I shut down the primary server, the MX backup receive the mail
>> correctly and mail goes into mailbox 'INBOX'.
>
> Well that is the mistake. This server should not deliver to mailbox.

Good, this is interesting, but a little bit more suggestion? :-)

>
> Have a look at Postfix documentation:
> "Configuring Postfix as primary or backup MX host for a remote site"
> http://www.postfix.org/STANDARD_CONFIGURATION_README.html#backup
>
> Wietse

I followed these documentation but surely something I must have
missed..
Is there a command to check where the queue is headed and possibly its
relative parameter?

Mamy thanks again

Davide
Reply | Threaded
Open this post in threaded view
|

Re: Postfix MX backup doesn't send to primary server

Viktor Dukhovni
In reply to this post by danjjde
On Sun, Aug 27, 2017 at 01:01:58PM +0200, Davide Marchi wrote:

> If I shut down the primary server, the MX backup receive the mail correctly
> and mail goes into mailbox 'INBOX'.
> The problem is that if I try to look into the postfix queue this is empty:

Do not list the mx-backup domain in "mydestination".  Do list the
mx-backup domain in "relay_domains".  Set either:

    parent_domain_matches_subdomains = smtpd_access_maps

  or, better yet:

    parent_domain_matches_subdomains =

if you're not relying on "example.com" matching "foo.example.com"
in access(5) tables and are willing to add ".example.com" keys as
necessary.

If you're behind a NAT device, make sure to list the external
address(es) in "proxy_interfaces".

For more help:  http://www.postfix.org/DEBUG_README.html#mail

--
        Viktor.
Reply | Threaded
Open this post in threaded view
|

Re: Postfix MX backup doesn't send to primary server

Matus UHLAR - fantomas
In reply to this post by danjjde
>>Davide Marchi:
>>>If I shut down the primary server, the MX backup receive the mail
>>>correctly and mail goes into mailbox 'INBOX'.

>Il 2017-08-27 14:49 [hidden email] ha scritto:
>>Well that is the mistake. This server should not deliver to mailbox.

On 27.08.17 22:35, Davide Marchi wrote:
>Good, this is interesting, but a little bit more suggestion? :-)

as Viktor said: Do not list the mx-backup domain in "mydestination".

You need to have such domains in relay_domains instead, so postfix accepts
mail for them and it stays in queue while postfix attempts to deliver them
(to the primary MX, or according to transport_maps).

Once you deliver the mail into a mailbox, it will be removed from the queue.
postfix will not pull mail from a queue to deliver to primary MX server.

>>"Configuring Postfix as primary or backup MX host for a remote site"
>>http://www.postfix.org/STANDARD_CONFIGURATION_README.html#backup
>>
>> Wietse
>
>I followed these documentation but surely something I must have
>missed..
>Is there a command to check where the queue is headed and possibly
>its relative parameter?

since the mail is already not in the queue, this question does not make
sense.
--
Matus UHLAR - fantomas, [hidden email] ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
WinError #99999: Out of error messages.