I am using also python smtplib for sending emails (on another project) and they added a patch for getting back the response code and message text. https://github.com/python/cpython/pull/12148/files parsing the text should be user side business, but I expected javamail to at least return a response object I ca work with.
Earlier on this thread @Shay Ginsburg suggested parsing the jmeter debug and parse the log file (where indeed this text exists) but it's a way more work to parse large log file instead of a returned object. -----Original Message----- From: Felix Schumacher [mailto:[email protected]] Sent: Sunday, 11 April 2021 11:47 To: [email protected] Subject: Re: SMTP Handler - get queue id Am 11.04.21 um 10:17 schrieb Oren Nudelman: > Hi , > > Thank you for the feedback. > I need the queue id so I can later track the mail on our logs (in case of > delivery problems). In that case, I would go with the message-id header. Postfix will log it and it is in the mail headers. Plus, it will be in the mails on the destination server and can be seen in the clients. > I am not sure if all smtp server return it on the response. Testing it > via telnet with postfix I get it > > 220 <ommitted> ESMTP Postfix (Ubuntu) > ehlo <ommitted> > 250-<ommitted> > 250-PIPELINING > 250-SIZE 10240000 > 250-VRFY > 250-ETRN > 250-STARTTLS > 250-AUTH PLAIN LOGIN > 250-AUTH=PLAIN LOGIN > 250-ENHANCEDSTATUSCODES > 250-8BITMIME > 250 DSN > mail from:<ommitted> > 250 2.1.0 Ok > rcpt to:<ommitted> > 250 2.1.5 Ok > data > 354 End data with <CR><LF>.<CR><LF> > bla > . > 250 2.0.0 Ok: queued as AE804D63A22 But according to RFC 5321 Section 4.2 the text part (which would be 2.0.0 Ok: queued as AE..) is optional (if I interpret it correctly). I didn't find anything specifying a format for the Ok text message. It seems to be not defined. Implementing a parser for that information seems to be a tricky thing and I would not suggest doing it without more information. Felix > > -----Original Message----- > From: Felix Schumacher [mailto:[email protected]] > Sent: Thursday, 8 April 2021 13:44 > To: [email protected] > Subject: Re: SMTP Handler - get queue id > > > Am 07.04.21 um 15:38 schrieb Oren Nudelman: >> Hi , >> >> I am trying to get back the queue id in the SMTP response when sending email >> using SMTP handler. >> I can see it in the logs when enabling debug but could not find any way to >> retrieve it during execution. > With "can see it in the logs", you probably the logs from the Java mail api. > I don't think that there is (currently) an easy way to parse those or to get > at the queue id by other means from within JMeter. > > Why do you want to get the queue id? > > If you really need it, you could open an enhancement issue on the bug > tracker. After dabbling a bit, I think we could parse the queue-id from the > Transport instance in the sendmailcommand by issuing getLastServerResponse on > it. But, it is unclear to me, whether the queue id is always part of the > response and the call chain in JMeter doesn't allow the addition of that > information in a trivial way (at least not at first glance). > > Felix > >> Anyone? >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] >
