postal icon indicating copy to clipboard operation
postal copied to clipboard

How to trigger a hard bounce for incoming route

Open timraybould opened this issue 7 years ago • 1 comments

Mail coming into my postal hits a webhook endpoint which looks for a matched user. If no match is found, I'd like to trigger a hard fail and send a bounce email back saying "this email address doesn't exist anymore". I have two questions around this:

  1. What response should my webhook send back to trigger a hard fail? I tried sending back 550, but that's resulting in a soft fail.

and, sidenote question:

  1. I've edited /opt/postal/app/lib/postal/bounce_message.rb slightly -- when can I expect those changes will over overwritten? When I update postal I presume?

timraybould avatar Jun 29 '19 12:06 timraybould

  1. it looks like its expecting HTTP codes not SMTP code so I think you might want to try 400 but I could be mistaken if thats not the file. https://github.com/atech/postal/blob/5c8f9b99c019952ea93bdb6cf329af2cffd43336/lib/postal/http_sender.rb#L34-L53

  2. exactly, the files won't be replaced until you update Postal

willpower232 avatar Jul 01 '19 08:07 willpower232