WIP: Answering with SMTP error code, for testing#405
WIP: Answering with SMTP error code, for testing#405ThomasLandauer wants to merge 1 commit intoaxllent:developfrom
Conversation
Closes axllent#402 My knowledge of Go is (in your syntax): `nil` But I'm sure you get the idea :-) Based on your comment at axllent#402 (comment) > the email would need to have already been processed in order to process the addresses I'm *guessing* that maybe you aren't using the address given at `MAIL FROM` at all. If this is indeed the case, then it certainly would be easy to capture the contents of your `mailFromRE`s first parentheses into some variable.
Not quite (I worded that poorly). What I am meaning is that in order to parse the It also means there is always a 100% failure guarantee, whereas some testers may want a random failure to test things like retrying a send based on a temporary failure. By using a constant in a mail address like this, a retry would always trigger the same response because the same address is parsed again and again. Please don't get me wrong - I like your approach because it is dynamic and does not introduce new CLI & environment variables, but it may be too limited to address "the bigger requirement". I just need time to think this through properly and consider all the options and requirements 👍 |
|
Foreword: I came up with the idea of I think that thoroughly testing the entire SMTP session with Mailpit just doesn't make any sense, cause: In production, the app (which uses an SMTP library in 99%, not some self-written code) needs to talk to the real MTA. So testing if this SMTP library plays together nicely with Mailpit is quite useless, isn't it? IMO, the real use-case is that people want to ensure how their app reacts if the MTA returns 500. In my case, I'm currently generating the error in my app with something like that: But since this is ugly, it would be nice to have a way to make Mailpit simulate such an error. |
Closes #402
My knowledge of Go is (in your syntax):
nilBut I'm sure you get the idea :-)
Based on your comment at #402 (comment)
I'm guessing that maybe you aren't using the address given at
MAIL FROMat all. If this is indeed the case, then it certainly would be easy to capture the contents of yourmailFromREs first parentheses into some variable.