FAQ
Hello currently I struggled to keep my webserver up after sending a mail,
that was caused since I had something like that in my code:

if err = c.Quit(); err != nil {
log.Fatal(err)
}

I kept searching and if read the Docs so carefully..
(https://golang.org/pkg/net/smtp/#Client.Quit)

However Quit() doesn't return just an error as it seems...

We should prolly fix that to standard go like (string, error). Since the
250 Ok Message of the Client will also be an error, which is of course not
an error and it will shut your program down, if you check for an error..
https://github.com/golang/go/blob/master/src/net/smtp/smtp.go#L373-L383

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Andrew Gerrand at Jun 30, 2015 at 12:14 pm
    Hi Christian,

    Why would the 250 OK message from the client be an error?

    I'm reading the code, and I don't see anything but actual errors being
    returned by Quit.

    What am I missing?

    Andrew


    On 30 June 2015 at 01:27, Christian Schmitt wrote:

    Hello currently I struggled to keep my webserver up after sending a mail,
    that was caused since I had something like that in my code:

    if err = c.Quit(); err != nil {
    log.Fatal(err)
    }

    I kept searching and if read the Docs so carefully.. (
    https://golang.org/pkg/net/smtp/#Client.Quit)

    However Quit() doesn't return just an error as it seems...

    We should prolly fix that to standard go like (string, error). Since the
    250 Ok Message of the Client will also be an error, which is of course not
    an error and it will shut your program down, if you check for an error..
    https://github.com/golang/go/blob/master/src/net/smtp/smtp.go#L373-L383

    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Christian Schmitt at Jun 30, 2015 at 12:18 pm
    I used it with AWS SES and It returned the following:

         14:17:30 app | 2015/06/30 14:17:30 Quit Message: 250 Ok
    0000014e44669548-f3afa74a-3a31-41ea-b2c6-f7a61b9f63e9-000000

    Currently this is my code:

    https://gist.github.com/schmitch/1571d2c15864202830ab

    I'm not sure but 250 Ok doesn't seems to be an error...


    Am Dienstag, 30. Juni 2015 14:14:37 UTC+2 schrieb Andrew Gerrand:
    Hi Christian,

    Why would the 250 OK message from the client be an error?

    I'm reading the code, and I don't see anything but actual errors being
    returned by Quit.

    What am I missing?

    Andrew



    On 30 June 2015 at 01:27, Christian Schmitt <c.sc...@briefdomain.de
    <javascript:>> wrote:
    Hello currently I struggled to keep my webserver up after sending a mail,
    that was caused since I had something like that in my code:

    if err = c.Quit(); err != nil {
    log.Fatal(err)
    }

    I kept searching and if read the Docs so carefully.. (
    https://golang.org/pkg/net/smtp/#Client.Quit)

    However Quit() doesn't return just an error as it seems...

    We should prolly fix that to standard go like (string, error). Since the
    250 Ok Message of the Client will also be an error, which is of course not
    an error and it will shut your program down, if you check for an error..
    https://github.com/golang/go/blob/master/src/net/smtp/smtp.go#L373-L383

    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Bruno Albuquerque at Jun 30, 2015 at 12:25 pm
    Quit seems to expect code 221 and, if I understand the code, everything
    else is considered an error. So 250 is an error.

    This looks like a bug.


    Em ter, 30 de jun de 2015 às 09:18, Christian Schmitt <
    c.schmitt@briefdomain.de> escreveu:
    I used it with AWS SES and It returned the following:

    14:17:30 app | 2015/06/30 14:17:30 Quit Message: 250 Ok
    0000014e44669548-f3afa74a-3a31-41ea-b2c6-f7a61b9f63e9-000000

    Currently this is my code:

    https://gist.github.com/schmitch/1571d2c15864202830ab

    I'm not sure but 250 Ok doesn't seems to be an error...


    Am Dienstag, 30. Juni 2015 14:14:37 UTC+2 schrieb Andrew Gerrand:
    Hi Christian,

    Why would the 250 OK message from the client be an error?

    I'm reading the code, and I don't see anything but actual errors being
    returned by Quit.

    What am I missing?

    Andrew


    On 30 June 2015 at 01:27, Christian Schmitt <c.sc...@briefdomain.de>
    wrote:
    Hello currently I struggled to keep my webserver up after sending a mail,
    that was caused since I had something like that in my code:

    if err = c.Quit(); err != nil {
    log.Fatal(err)
    }

    I kept searching and if read the Docs so carefully.. (
    https://golang.org/pkg/net/smtp/#Client.Quit)

    However Quit() doesn't return just an error as it seems...

    We should prolly fix that to standard go like (string, error). Since the
    250 Ok Message of the Client will also be an error, which is of course not
    an error and it will shut your program down, if you check for an error..
    https://github.com/golang/go/blob/master/src/net/smtp/smtp.go#L373-L383 --
    You received this message because you are subscribed to the Google
    Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts...@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Christian Schmitt at Jun 30, 2015 at 12:30 pm
    Looks like that happens when you don't call w.Close..
    Sorry looks like my fault.

    Am Dienstag, 30. Juni 2015 14:25:38 UTC+2 schrieb Bruno Albuquerque:
    Quit seems to expect code 221 and, if I understand the code, everything
    else is considered an error. So 250 is an error.

    This looks like a bug.


    Em ter, 30 de jun de 2015 às 09:18, Christian Schmitt <
    c.sc...@briefdomain.de <javascript:>> escreveu:
    I used it with AWS SES and It returned the following:

    14:17:30 app | 2015/06/30 14:17:30 Quit Message: 250 Ok
    0000014e44669548-f3afa74a-3a31-41ea-b2c6-f7a61b9f63e9-000000

    Currently this is my code:

    https://gist.github.com/schmitch/1571d2c15864202830ab

    I'm not sure but 250 Ok doesn't seems to be an error...


    Am Dienstag, 30. Juni 2015 14:14:37 UTC+2 schrieb Andrew Gerrand:
    Hi Christian,

    Why would the 250 OK message from the client be an error?

    I'm reading the code, and I don't see anything but actual errors being
    returned by Quit.

    What am I missing?

    Andrew


    On 30 June 2015 at 01:27, Christian Schmitt <c.sc...@briefdomain.de>
    wrote:
    Hello currently I struggled to keep my webserver up after sending a mail,
    that was caused since I had something like that in my code:

    if err = c.Quit(); err != nil {
    log.Fatal(err)
    }

    I kept searching and if read the Docs so carefully.. (
    https://golang.org/pkg/net/smtp/#Client.Quit)

    However Quit() doesn't return just an error as it seems...

    We should prolly fix that to standard go like (string, error). Since
    the 250 Ok Message of the Client will also be an error, which is of course
    not an error and it will shut your program down, if you check for an error..
    https://github.com/golang/go/blob/master/src/net/smtp/smtp.go#L373-L383 --
    You received this message because you are subscribed to the Google
    Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to golang-nuts...@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts...@googlegroups.com <javascript:>.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Bruno Albuquerque at Jun 30, 2015 at 12:30 pm
    FYI.

    Looking at the RFC (https://tools.ietf.org/html/rfc821), it looks like the
    SMTP server being used is at fault. It should not reply with code 250 when
    it gets a QUIT command. It should be 221.


    Em ter, 30 de jun de 2015 às 09:25, Bruno Albuquerque <bga@bug-br.org.br>
    escreveu:
    Quit seems to expect code 221 and, if I understand the code, everything
    else is considered an error. So 250 is an error.

    This looks like a bug.


    Em ter, 30 de jun de 2015 às 09:18, Christian Schmitt <
    c.schmitt@briefdomain.de> escreveu:
    I used it with AWS SES and It returned the following:

    14:17:30 app | 2015/06/30 14:17:30 Quit Message: 250 Ok
    0000014e44669548-f3afa74a-3a31-41ea-b2c6-f7a61b9f63e9-000000

    Currently this is my code:

    https://gist.github.com/schmitch/1571d2c15864202830ab

    I'm not sure but 250 Ok doesn't seems to be an error...


    Am Dienstag, 30. Juni 2015 14:14:37 UTC+2 schrieb Andrew Gerrand:
    Hi Christian,

    Why would the 250 OK message from the client be an error?

    I'm reading the code, and I don't see anything but actual errors being
    returned by Quit.

    What am I missing?

    Andrew


    On 30 June 2015 at 01:27, Christian Schmitt <c.sc...@briefdomain.de>
    wrote:
    Hello currently I struggled to keep my webserver up after sending a mail,
    that was caused since I had something like that in my code:

    if err = c.Quit(); err != nil {
    log.Fatal(err)
    }

    I kept searching and if read the Docs so carefully.. (
    https://golang.org/pkg/net/smtp/#Client.Quit)

    However Quit() doesn't return just an error as it seems...

    We should prolly fix that to standard go like (string, error). Since
    the 250 Ok Message of the Client will also be an error, which is of course
    not an error and it will shut your program down, if you check for an error..
    https://github.com/golang/go/blob/master/src/net/smtp/smtp.go#L373-L383 --
    You received this message because you are subscribed to the Google
    Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send
    an email to golang-nuts...@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups
    "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an
    email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedJun 29, '15 at 3:27p
activeJun 30, '15 at 12:30p
posts6
users3
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase