Skip to content

Conversation

@lucaforni
Copy link

Questa PR replica la PR originale: postalserver#2855

Autore originale: @jmdunsing
Branch originale: update-mail-from
Repository originale: jmdunsing/postal


This PR incorporates a minor change to the way the return path is generated to allow for additional bounce processing and message forwarding. Those using postal strictly as a transactional email solution should notice no difference in performance. Those who wish to be able to capture all hard bounces and those who use postal as a marketing solution will have another method besides the X-Postal-MsgID header to identify bounces and replies, since the message token will be included in the return path.

Background:
Some mail servers return a bounce but omit identifiable information and strip the X-Postal-MsgID header from the email, leaving postal users unable to prevent future hard bounces. This change will provide the ability for a subsequent coding solution to tie bounces and replies to emails to their original sender.

This design change is consistent with the current bounce design, which splits the domain path on "@" then subsequently on "+", and checks the uname to see if the server was a bounce (specifically line 328), see https://github.com/postalserver/postal/blob/6df963651d6d7d4613caebde090753123398da5f/app/lib/smtp_server/client.rb#L303-L340:

These bounces will still not be identified by postal as bounces, and the incoming messages will still hardfail, because the current code still searches exclusively for the X-Postal-MsgID header https://github.com/postalserver/postal/blob/6df963651d6d7d4613caebde090753123398da5f/lib/postal/message_db/message.rb#L496-L508:

* 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>
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>
Signed-off-by: jmdunsing <113212353+jmdunsing@users.noreply.github.com>
@github-actions
Copy link

github-actions bot commented Sep 2, 2025

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the stale label Sep 2, 2025
@github-actions
Copy link

github-actions bot commented Nov 7, 2025

This PR was closed because it has been stalled for 10 days with no activity.

@github-actions github-actions bot closed this Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants