Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Mailcatcher with Mailpit #1281

Merged
merged 3 commits into from
Jan 18, 2024
Merged

Replace Mailcatcher with Mailpit #1281

merged 3 commits into from
Jan 18, 2024

Conversation

ker0x
Copy link
Contributor

@ker0x ker0x commented Jan 11, 2024

Q A
License MIT
Doc issue/PR -

As suggested by @kbond in #1279, I would like to discuss replacing Mailcatcher with Mailpit, which offers many more features in addition to a much lighter docker image (27 MB for Mailpit compared to 90 MB for Mailcatcher).

I already use it in a project and integration with the Symfony CLI works without modification.

@symfony-recipes-bot symfony-recipes-bot enabled auto-merge (squash) January 11, 2024 16:41
Copy link

github-actions bot commented Jan 11, 2024

Thanks for the PR 😍

How to test these changes in your application

  1. Define the SYMFONY_ENDPOINT environment variable:

    # On Unix-like (BSD, Linux and macOS)
    export SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes/flex/pull-1281/index.json
    # On Windows
    SET SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes/flex/pull-1281/index.json
  2. Install the package(s) related to this recipe:

    composer req 'symfony/flex:^1.16'
    composer req 'symfony/mailer:^4.3'
  3. Don't forget to unset the SYMFONY_ENDPOINT environment variable when done:

    # On Unix-like (BSD, Linux and macOS)
    unset SYMFONY_ENDPOINT
    # On Windows
    SET SYMFONY_ENDPOINT=

Diff between recipe versions

In order to help with the review stage, I'm in charge of computing the diff between the various versions of patched recipes.
I'm going keep this comment up to date with any updates of the attached patch.

symfony/mailer/4.3/manifest.json Outdated Show resolved Hide resolved
fabpot
fabpot previously approved these changes Jan 18, 2024
welcoMattic
welcoMattic previously approved these changes Jan 18, 2024
@fabpot fabpot dismissed stale reviews from welcoMattic and themself via 62cc194 January 18, 2024 09:31
@fabpot fabpot disabled auto-merge January 18, 2024 09:31
@fabpot fabpot merged commit 66d9ffb into symfony:main Jan 18, 2024
1 of 2 checks passed
@ker0x ker0x deleted the feature/mailpit branch January 18, 2024 10:22
@RafaelKr
Copy link

RafaelKr commented Jan 19, 2024

@fabpot I just ran composer recipes:update and selected symfony/mailer from the list.

composer recipes:update    
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in phar:///usr/local/bin/composer/vendor/symfony/console/Command/DumpCompletionCommand.php:48
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in phar:///usr/local/bin/composer/vendor/symfony/console/Command/DumpCompletionCommand.php:56
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in phar:///usr/local/bin/composer/src/Composer/Autoload/AutoloadGenerator.php:881
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in phar:///usr/local/bin/composer/src/Composer/Autoload/AutoloadGenerator.php:886
Which outdated recipe would you like to update? (default: 0)
  [0] doctrine/doctrine-bundle
  [1] symfony/mailer
  [2] symfony/monolog-bundle
  [3] symfony/translation
 > 1
  Updating recipe for symfony/mailer...

                        
   Yes! Recipe updated! 
                        

  No files were changed as a result of the update.

So it told it updated the recipe and in the symfony.lock the ref of symfony/mailer changed to df66ee1f226c46f01e85c29c2f7acce0596ba35a. But my docker-compose.override.yml stayed the same. Only after the rollback of symfony.lock and running composer recipes:install symfony/mailer --force the docker config was updated.

composer recipes:install symfony/mailer --force
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in phar:///usr/local/bin/composer/vendor/symfony/console/Command/DumpCompletionCommand.php:48
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in phar:///usr/local/bin/composer/vendor/symfony/console/Command/DumpCompletionCommand.php:56
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in phar:///usr/local/bin/composer/src/Composer/Autoload/AutoloadGenerator.php:881
Deprecation Notice: Using ${var} in strings is deprecated, use {$var} instead in phar:///usr/local/bin/composer/src/Composer/Autoload/AutoloadGenerator.php:886
Run command with -v to see more details


Symfony operations: 1 recipe (0a02f8c0bedf619d1bf7e60e08493aad)
  - Configuring symfony/mailer (>=4.3): From github.com/symfony/recipes:main
  -  WARNING  symfony/mailer (>=4.3): From github.com/symfony/recipes:main
    The recipe for this package contains some Docker configuration.

    This may create/update compose.yaml or update Dockerfile (if it exists).

    Do you want to include Docker configuration from recipes?
    [y] Yes
    [n] No
    [p] Yes permanently, never ask again for this project
    [x] No permanently, never ask again for this project
    (defaults to y): 

                                                            
 Files have been reset to the latest version of the recipe. 
                                                            

  * Use git diff to inspect the changes.

    Not all of the changes will be relevant to your app: you now
    need to selectively add or revert them using e.g. a combination
    of git add -p and git checkout -p

  * Use git checkout . to revert the changes.

    New (untracked) files can be inspected using git clean --dry-run
    Add the new files you want to keep using git add
    then delete the rest using git clean --force

Is it expected behavior, that recipes:update doesn't update the docker config? I did expect that and was wondering why it wasn't working like that.

Besides from that this drop-in replacement works perfectly! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants