Skip to content

Envelope address passed to sendmail #78

Closed

Description

@MartinMystikJonas

We just encountered increasing undelivered messages rate on certain recipient server and it was caused by mismatch between From header and envelope address. Then we found out that Nette did not pass required parameter (-f) to sendmail automatically and it must be set manually. I would expect this would be handled by mailer.

We solved it by replacing default SendmailMailer by this child class:

class SendmailMailer extends \Nette\Mail\SendmailMailer {

  public function send(Message $mail)
  {
    $from = array_keys($mail->getFrom());
    if($from) {
      $this->commandArgs = "-f".reset($from);
    }
    parent::send($mail);
    $this->commandArgs = null;
  }

}

I just think this should either be default behaviour (is the any case when yo do not want to pass -f parameter?) or be configurable either by providing subclass (EnvelopeSendmailMailer, FromSendmailMailer, ...) as we did it or even better maybe as option (setPassEnvelopeFrom()) of SendmailMailer.

Activity

  1. dg commented on Jan 5, 2021

    @dg
    Member

    Can it cause some problems when it will be the default?

  2. MartinMystikJonas commented on Jan 6, 2021

    @MartinMystikJonas
    Author

    I think not. At least if you do not use some quite non-standard configuration of mail delivery system. But I am not 100% sure.

  3. dg commented on Jan 6, 2021

    @dg
    Member

    We will see :)

  4. added a commit that references this issue on Jan 11, 2021
    2fac4f0
  5. added a commit that references this issue on Jan 26, 2021
    148480c
  6. added 3 commits that reference this issue on Feb 24, 2021
    2435b39
    9edc67c
    cf358e0
  7. added a commit that references this issue on Apr 16, 2021
    97d2b32
  8. added 2 commits that reference this issue on Jun 2, 2021
    e6aa31d
    241ad30
  9. added a commit that references this issue on Aug 25, 2021
    4d5ed8a
  10. added 2 commits that reference this issue on Dec 12, 2021
    35f3c7d
    7cf0baf
  11. 5 remaining items

  12. added a commit that references this issue on Oct 13, 2022
    d1a71b0
  13. added 2 commits that reference this issue on Dec 14, 2022
    06c6f30
    32eb2b9
  14. added 12 commits that reference this issue on Jan 9, 2023
    20ae2b7
    e2105d3
    298fd86
    0309545
    eaffb1b
    c21f7c6
    efb81a6
    a84bd88
    e486f97
    e984b06
    2b09bbf
    0e236e4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions