• Resolved michaelbruch

    (@michaelbruch)


    Hello,

    I am using MEOW SMTP on a WordPress installation and would like to continue using it.

    A custom plugin on the same website dynamically sets a dedicated bounce address as the Return-Path / Envelope-From for outgoing emails. The bounce address itself does not need to be configured in MEOW SMTP.

    Other SMTP plugins provide an option called “Set Return Path”, described as follows:

    The Return-Path determines where non-delivery reports and bounce emails are sent. If this option is not enabled, bounce messages may be lost.

    I could not find a similar option in MEOW SMTP.

    Does MEOW SMTP support a Return-Path set by another plugin, for example through PHPMailer’s Sender property or the phpmailer_init hook? Is there a setting, filter, or hook that ensures MEOW SMTP preserves and uses this value instead of overriding or removing it?

    The visible From address should remain unchanged. Only the Return-Path / Envelope-From is set dynamically by my custom plugin.

    Thank you for your help.

Viewing 1 replies (of 1 total)
  • Plugin Author Jordy Meow

    (@tigroumeow)

    Hello,

    You were right that it was missing, and I have just added it. It will be in 0.2.0.

    First, why your current approach could not have worked, so you do not go on debugging it. Once a provider is selected, Meow Mailer takes over from wp_mail before WordPress builds its own PHPMailer object, so phpmailer_init never fires at all. Nothing was overriding the Sender your plugin sets. The hook it listens on simply never ran.

    In 0.2.0 there are three ways to set the envelope sender, and none of them touch the visible From:

    There is a Return Path field in Settings, under Sender, for a fixed bounce mailbox. Leave it empty and bounces follow the From address exactly as they do today.

    A Return-Path header passed to wp_mail is now taken as the envelope sender for that message, instead of being carried along as a header that the receiving server rewrites anyway.

    For your case, a filter called mwmail_return_path receives the address and the message it belongs to, so you can return a different bounce address per email. That is the one to use for a dynamic address, and it replaces your phpmailer_init hook entirely.

    One caveat worth knowing. This is the SMTP envelope sender, so it applies to Generic SMTP. The API providers, Mailgun, SendGrid, Brevo and the rest, wrap your message in their own envelope and handle bounces on their side, so the field is inert there rather than wrong. If you are on Generic SMTP you are covered.

    Cheers,
    Jordy.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.