liiight/notifiers

EMAIL provider - stalling connect

cherusk opened this issue ยท 9 comments

Describe the bug
Various SMTP(EMAIL) providers, even local happen to stall in SMTP server connection phase when interacted by with notifiers. Could be down to/linked to or caused underlying SMTP library issue reported earlier (https://bugs.python.org/issue37572).

It was made sure not underlying, ostensible networking culprit is in way. The transport flow path is reported open by e.g. nmap.

To Reproduce
On pristine runtime with freshly installed notifiers via cli, with dbg traces activated in notifiers:


# notifiers email notify
        --from testing@mail.de
        --to   testing@mail.de
        --subject "TEST"
        --host smtp.mail.de
        --port 465
        --username <YOUR_USR>@mail.de
        --password <YOUR_PW> 
        "SOME"

Does end in stalling at:
[...]
connect: ('smtp.mail.de', 465)
connect: to ('smtp.mail.de', 465) None

Expected behavior
Swift delivery of msg, without hanging/stalling.

Additional context
Python version: 3.6-3.7
OS: latest fedora/ubuntu

Thanks for opening your first issue here! Be sure to follow the issue template! ๐Ÿ‘‹๐Ÿž๐Ÿ‘‹

Thanks for reporting this issue! Unfortunately I cannot think of anything other than looking at logs, which I have not enabled via the CLI (I'll make sure to add a verbosity option for that).

If it's possible, please try to reproduce via the pyrhon API with logging enabled. I hope there's sufficient logging in place, and if not, I'll add them

Thanks for coming back so swiftly.

I might kindly refer you to my fork in the light you said as to logging. Here I've placed dedicated tracing required to distill the python issue mentioned initially:
cherusk@94afb21

Further, please find the script I attached to https://bugs.python.org/issue37572. It's running the API for interacting with a smtp server locally, with similar symptoms. I'm bedazzled to find same with a public smtp provider.

Nigh, I can come forth with API traces for the specific upstream provider interaction also, in case needed in case you think it's non-generic an issue.

@liiight or in general, any progress, please?

Not yet

A general question related to that topic: Are the notifications be buffered and sent in a separate thread? Imagine, that the service provider is currently unreachable, would that block the main programm for the request's timeout period? Would be nice if there wouldn't be an influence on the applications repsonsiveness.

@cherusk is this issue still relevant?

@mahadi I agree that using this with threading would be beneficial, but I believe it's the clients' decision to do (or not) do this

Not necessarily, @liiight I solved this with another mailing framework, containerized.

Ok, I guess I'll close then