Skip to content

Invalid DSN creation, if SwiftMailer had special chars #2

@Benjamin-K

Description

@Benjamin-K

Problem description

If the old SwiftMailer configuration had some special chars in their username like @, # or other special chars, the migrated DSN will be invalid. This leads to DSNs that will not work and show an error. To prevent this, all special chars need to be urlencoded.

Current behaviour

Neos:
  SwiftMailer:
    transport:
      type: "Swift_SmtpTransport"
      options:
        host: "domain.com"
        port: 576
        username: "user@domain.com"
        password: "passw%rd-with-s#me-speci@l-chars"

will produce

smtp://user@domain.com:passw%rd-with-s#me-speci@l-chars@domain.com:576

Expected behaviour

All parts of the new DSN are urlencoded, so they work as expected in the new SymfonyMailer. The correct DSN for the example above would be

smtp://user%40domain.com:passw%25rd-with-s%23me-speci%40l-chars@domain.com:576

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