Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-8558

Board Emails not setting a correct email header

    Details

    • Type: Bug
    • Status: Unverified Fix
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.5
    • Fix Version/s: 3.1.0-b3
    • Component/s: Other
    • Labels:
      None
    • Environment:
      PHP Environment: PHP 5.3.0
      Database: MySQL 5.0.83

      Description

      When users receive emails from the board, the functions_messenger.php code uses the board_contact config, which is encapsulated with angle brackets and set as the from header.

      This is fine and well for regular email addresses (ie. person@company.com), however it looks rather ugly, and many people prefer to put a name rather from an email address there (ie. Company Forums). This seems to work well most of the time, however this creates a non-valid email address, which is not correctly displayed by all email clients and interfaces.

      A notable example is gmail, which reports emails coming from any non-email address as being from "Unknown Sender". The solution to this is pretty simple - setting the from header to the form of ' "Company Forums" <email@company.com> ' - however unfortunately this is impossible to do with phpBB, because the angle brackets from the input get parsed to < and >, now to mention the whole thing gets encapsulated in angle brackets by the email functions.

      I propose either of two things. The first option is for phpBB to let the user specify the From header (ie. Board Email) in whatever format the user wishes, and to not conduct any parsing or other modifications if these seem unnecessary.

      The second option is to automatically generate a from header in the above "nice" format. This would involve changing l:408 in functions_messenger from:

      $this->from = '<' . $config['board_contact'] . '>';

      to something like this:

      $this->from = '"' . $config['sitename'] . '" <' . $config['board_contact'] . '>';

      Either way, it would accomplish the desired result.

      Thank you!

        Activity

        Hide
        MarkTheDaemon Mark Barnes added a comment -

        Saw this as an easy introduction into the new (to me anyway!) tracker, GitHub and Git itself. If someone could provide some feedback I would appreciate it.

        Show
        MarkTheDaemon Mark Barnes added a comment - Saw this as an easy introduction into the new (to me anyway!) tracker, GitHub and Git itself. If someone could provide some feedback I would appreciate it.
        Hide
        Oleg Oleg [X] (Inactive) added a comment -

        Mark - please create a pull request, patch url is 404 now.

        Show
        Oleg Oleg [X] (Inactive) added a comment - Mark - please create a pull request, patch url is 404 now.
        Hide
        bantu Andreas Fischer added a comment -

        Don't want this in 3.0.x.

        Show
        bantu Andreas Fischer added a comment - Don't want this in 3.0.x.
        Hide
        naderman Nils Adermann added a comment -

        mail_encode prevents header injection. Fixed the htmlspecialchars issue in https://github.com/phpbb/phpbb/commit/76574d4b5e6c2f6de0faf175c745bcdc74c60f4e

        Show
        naderman Nils Adermann added a comment - mail_encode prevents header injection. Fixed the htmlspecialchars issue in https://github.com/phpbb/phpbb/commit/76574d4b5e6c2f6de0faf175c745bcdc74c60f4e

          People

          • Assignee:
            naderman Nils Adermann
            Reporter:
            starcraftmazter starcraftmazter
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development