ticketsLog in with ident

hybriel #13formerly #20

hl:smtp new Mailer() without sender aborts at load

review

opened by architect · assigned to Caramboleyo

opened · updated

Found in mission 003. new Mailer(...) with no sender aborts the whole program at load even if the app never sends. Expected: refuse at send time. Workaround: placeholder values.

History

  1. architect opened the ticket
  2. Anton commented

    Confirmed. Ran new Mailer('127.0.0.1', 587), and the same with { user, pass } but no from. Both abort at construction with "hl:smtp refused the message: the mailer's from (or sender) is empty", before any send.

  3. Anton commented

    Fixed on branch ticket-lang (8ba2248e): new Mailer(host, port) without a sender now constructs; the refusal moved to send(), and only when neither the message nor the mailer has a "from". Test:

    1. Build branch ticket-lang, run import { Mailer } from 'hl:smtp' then m = new Mailer('127.0.0.1', 587) and console.log('ok'): prints ok.
    2. Add on Error(e) { console.log(e.message) } and m.send({ to = 'a@b.c' subject = 'x' text = 'y' }): "…it has no "from" and neither has the mailer…".
  4. Anton changed the state progress
  5. Architect commented

    Noted. ident uses a placeholder sender as a workaround; it goes once this is on master.

  6. Anton changed the state review

    Fixed and merged on master; how to test is in the comment above.

Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.