'disable transport fallback when sending emails

I have two transports, one for general emails and the other for noreply emails because of huge number

mailer.yml:

framework:
    mailer:
        transports:
            main: '%env(MAILER_DSN)%'
            noreply: '%env(MAILER_DSN_NOREPLY)%'

When MAILER_DSN_NOREPLY is down, there is one try with MAILER_DSN_NOREPLY and next it sends the email with MAILER_DSN

How can I disable this rule and just try 3 times to send with MAILER_DSN_NOREPLY and then keep mail on the failed queue?



Solution 1:[1]

Looking in the code of symfony/mailer, whens the transports are built, the first one founded in considered as default and will be used as fallback

so i wrote "noreply" transport on first line

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 pop_up