From 503e25af1abd198c4cc6a4dc8028b974374fcb45 Mon Sep 17 00:00:00 2001 From: jmdunsing <113212353+jmdunsing@users.noreply.github.com> Date: Wed, 6 Mar 2024 12:30:07 -0600 Subject: [PATCH 1/4] Jmdunsing patch 1 (#11) * Fix: allow build for jmdunsing version of postal Signed-off-by: jmdunsing <113212353+jmdunsing@users.noreply.github.com> * Fix: Revise version number for jmdunsing version of postal Signed-off-by: jmdunsing <113212353+jmdunsing@users.noreply.github.com> --------- Signed-off-by: jmdunsing <113212353+jmdunsing@users.noreply.github.com> --- .github/workflows/ci.yml | 14 +++++++------- .release-please-manifest.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f16fce0a..b9e653de8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: - uses: docker/build-push-action@v4 with: push: true - tags: ghcr.io/postalserver/postal:ci-${{ github.sha }} + tags: ghcr.io/jmdunsing/postal:ci-${{ github.sha }} cache-from: type=gha cache-to: type=gha,mode=max target: ci @@ -54,10 +54,10 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - run: docker-compose pull env: - POSTAL_IMAGE: ghcr.io/postalserver/postal:ci-${{ github.sha }} + POSTAL_IMAGE: ghcr.io/jmdunsing/postal:ci-${{ github.sha }} - run: docker-compose run postal sh -c 'bundle exec rspec' env: - POSTAL_IMAGE: ghcr.io/postalserver/postal:ci-${{ github.sha }} + POSTAL_IMAGE: ghcr.io/jmdunsing/postal:ci-${{ github.sha }} release-branch: name: Release (branch) @@ -83,8 +83,8 @@ jobs: with: push: true tags: | - ghcr.io/postalserver/postal:${{ steps.tag.outputs.tag }} - ghcr.io/postalserver/postal:commit-${{ github.sha }} + ghcr.io/jmdunsing/postal:${{ steps.tag.outputs.tag }} + ghcr.io/jmdunsing/postal:commit-${{ github.sha }} cache-from: type=gha cache-to: type=gha,mode=max target: full @@ -108,8 +108,8 @@ jobs: with: push: true tags: | - ghcr.io/postalserver/postal:stable - ghcr.io/postalserver/postal:${{ needs.release-please.outputs.version }} + ghcr.io/jmdunsing/postal:stable + ghcr.io/jmdunsing/postal:${{ needs.release-please.outputs.version }} cache-from: type=gha cache-to: type=gha,mode=max target: full diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ada7355e0..466df71c8 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "3.1.0" + ".": "0.1.0" } From c66f007d5f77b4172e035ee651e7688ae86c21f7 Mon Sep 17 00:00:00 2001 From: jmdunsing <113212353+jmdunsing@users.noreply.github.com> Date: Wed, 6 Mar 2024 12:41:04 -0600 Subject: [PATCH 2/4] Revert "Jmdunsing patch 1 (#11)" (#13) This reverts commit 503e25af1abd198c4cc6a4dc8028b974374fcb45. --- .github/workflows/ci.yml | 14 +++++++------- .release-please-manifest.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b9e653de8..1f16fce0a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: - uses: docker/build-push-action@v4 with: push: true - tags: ghcr.io/jmdunsing/postal:ci-${{ github.sha }} + tags: ghcr.io/postalserver/postal:ci-${{ github.sha }} cache-from: type=gha cache-to: type=gha,mode=max target: ci @@ -54,10 +54,10 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - run: docker-compose pull env: - POSTAL_IMAGE: ghcr.io/jmdunsing/postal:ci-${{ github.sha }} + POSTAL_IMAGE: ghcr.io/postalserver/postal:ci-${{ github.sha }} - run: docker-compose run postal sh -c 'bundle exec rspec' env: - POSTAL_IMAGE: ghcr.io/jmdunsing/postal:ci-${{ github.sha }} + POSTAL_IMAGE: ghcr.io/postalserver/postal:ci-${{ github.sha }} release-branch: name: Release (branch) @@ -83,8 +83,8 @@ jobs: with: push: true tags: | - ghcr.io/jmdunsing/postal:${{ steps.tag.outputs.tag }} - ghcr.io/jmdunsing/postal:commit-${{ github.sha }} + ghcr.io/postalserver/postal:${{ steps.tag.outputs.tag }} + ghcr.io/postalserver/postal:commit-${{ github.sha }} cache-from: type=gha cache-to: type=gha,mode=max target: full @@ -108,8 +108,8 @@ jobs: with: push: true tags: | - ghcr.io/jmdunsing/postal:stable - ghcr.io/jmdunsing/postal:${{ needs.release-please.outputs.version }} + ghcr.io/postalserver/postal:stable + ghcr.io/postalserver/postal:${{ needs.release-please.outputs.version }} cache-from: type=gha cache-to: type=gha,mode=max target: full diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 466df71c8..ada7355e0 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0" + ".": "3.1.0" } From 3dc769c7a24362d380dc1bf9b84dabb50bc5bd4e Mon Sep 17 00:00:00 2001 From: jmdunsing <113212353+jmdunsing@users.noreply.github.com> Date: Wed, 6 Mar 2024 13:01:21 -0600 Subject: [PATCH 3/4] feat: Add message token to return path Adding the message token to the return path would be beneficial for users to link bounces to email addresses when X-Postal-MsgID was not included in the bounce message's headers. Signed-off-by: jmdunsing <113212353+jmdunsing@users.noreply.github.com> --- app/senders/smtp_sender.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/senders/smtp_sender.rb b/app/senders/smtp_sender.rb index 897282e4b..b762443be 100644 --- a/app/senders/smtp_sender.rb +++ b/app/senders/smtp_sender.rb @@ -142,10 +142,10 @@ def determine_mail_from_for_message(message) # If the domain has a valid custom return path configured, return # that. if message.domain.return_path_status == "OK" - return "#{message.server.token}@#{message.domain.return_path_domain}" + return "#{message.server.token}+#{message.token}@#{message.domain.return_path_domain}" end - "#{message.server.token}@#{Postal::Config.dns.return_path_domain}" + "#{message.server.token}+#{message.token}@#{Postal::Config.dns.return_path_domain}" end # Return the RCPT TO to use for the given message in this sending session From 0e0bd15fa8dfb1eb662d21c9f96a599a3a2cc7dd Mon Sep 17 00:00:00 2001 From: jmdunsing <113212353+jmdunsing@users.noreply.github.com> Date: Wed, 6 Mar 2024 14:26:46 -0600 Subject: [PATCH 4/4] test: update smtp_sender_spect.rb to reflect design changes to mail from Signed-off-by: jmdunsing <113212353+jmdunsing@users.noreply.github.com> --- spec/senders/smtp_sender_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/senders/smtp_sender_spec.rb b/spec/senders/smtp_sender_spec.rb index d61c532d8..5c20c04d7 100644 --- a/spec/senders/smtp_sender_spec.rb +++ b/spec/senders/smtp_sender_spec.rb @@ -261,7 +261,7 @@ sender.send_message(message) expect(sender.endpoints.last).to have_received(:send_message).with( kind_of(String), - "#{server.token}@#{domain.return_path_domain}", + "#{server.token}+#{message.token}@#{domain.return_path_domain}", ["john@example.com"] ) end @@ -272,7 +272,7 @@ sender.send_message(message) expect(sender.endpoints.last).to have_received(:send_message).with( kind_of(String), - "#{server.token}@#{Postal::Config.dns.return_path_domain}", + "#{server.token}+#{message.token}@#{Postal::Config.dns.return_path_domain}", ["john@example.com"] ) end @@ -306,7 +306,7 @@ it "adds the resent-sender header" do sender.send_message(message) expect(sender.endpoints.last).to have_received(:send_message).with( - "Resent-Sender: #{server.token}@#{Postal::Config.dns.return_path_domain}\r\n#{message.raw_message}", + "Resent-Sender: #{server.token}+#{message.token}@#{Postal::Config.dns.return_path_domain}\r\n#{message.raw_message}", kind_of(String), kind_of(Array) )