caronc / apprise

Apprise - Push Notifications that work with just about every platform!
https://hub.docker.com/r/caronc/apprise
BSD 2-Clause "Simplified" License
11.81k stars 413 forks source link

Can't send message through XMPP #227

Closed clarkspark closed 3 years ago

clarkspark commented 4 years ago

:mega: Notification Service(s) Impacted XMPP

:beetle: Describe the bug

:bulb: Screenshots and Logs When I executed

apprise --body='Test Message' 'xmpp://user:password@xmpp.nayr.us?to=user2@nayr.us' -vvv

I get the following output:

2020-04-06 09:56:27,750 - DEBUG - Loaded URL: xmpp://user:password@xmpp.nayr.us/user%40nayr.us?verify=yes&overflow=upstream&xep=30%2C199&format=text
2020-04-06 09:56:27,752 - DEBUG - Loaded Plugin: RFC 6120: Stream Feature: STARTTLS
2020-04-06 09:56:27,753 - DEBUG - Loaded Plugin: RFC 6120: Stream Feature: Resource Binding
2020-04-06 09:56:27,754 - DEBUG - Loaded Plugin: RFC 3920: Stream Feature: Start Session
2020-04-06 09:56:27,755 - DEBUG - Loaded Plugin: RFC 6121: Stream Feature: Roster Versioning
2020-04-06 09:56:27,755 - DEBUG - Loaded Plugin: RFC 6121: Stream Feature: Subscription Pre-Approval
2020-04-06 09:56:27,759 - DEBUG - Loaded Plugin: RFC 6120: Stream Feature: SASL
2020-04-06 09:56:27,761 - DEBUG - Loaded Plugin: XEP-0030: Service Discovery
2020-04-06 09:56:27,761 - DEBUG - Loaded Plugin: XEP-0199: XMPP Ping
2020-04-06 09:56:27,762 - DEBUG - DNS: Querying xmpp.nayr.us for AAAA records.
2020-04-06 09:56:27,766 - DEBUG - DNS: No AAAA records for xmpp.nayr.us
2020-04-06 09:56:27,766 - DEBUG - DNS: Querying xmpp.nayr.us for A records.
2020-04-06 09:56:27,770 - DEBUG - Connecting to 172.16.129.15:5222
2020-04-06 09:56:27,771 - DEBUG - Event triggered: connected
2020-04-06 09:56:27,771 - DEBUG -  ==== TRANSITION disconnected -> connected
2020-04-06 09:56:27,771 - DEBUG - Starting HANDLER THREAD
2020-04-06 09:56:27,771 - DEBUG - Loading event runner
2020-04-06 09:56:27,772 - DEBUG - SEND (IMMED): <stream:stream to='xmpp.nayr.us' xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' xml:lang='en' version='1.0'>
2020-04-06 09:56:27,774 - DEBUG - RECV: <stream:stream version="1.0" from="xmpp.nayr.us" id="fa8d02a2-c362-4ce1-864d-cf51f19bb22e" xml:lang="en">
2020-04-06 09:56:27,775 - DEBUG - RECV: <stream:features xmlns="http://etherx.jabber.org/streams"><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"><required /></starttls></stream:features>
2020-04-06 09:56:27,776 - DEBUG - SEND (IMMED): <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"><required /></starttls>
2020-04-06 09:56:27,778 - DEBUG - RECV: <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
2020-04-06 09:56:27,778 - DEBUG - Starting TLS
2020-04-06 09:56:27,779 - INFO - Negotiating TLS
2020-04-06 09:56:27,779 - INFO - Using SSL version: TLSv1
2020-04-06 09:56:27,782 - ERROR - CERT: Invalid certificate trust chain.
2020-04-06 09:56:27,782 - DEBUG - Event triggered: session_end
2020-04-06 09:56:27,782 - DEBUG - Event triggered: disconnected
2020-04-06 09:56:27,783 - DEBUG -  ==== TRANSITION connected -> disconnected
2020-04-06 09:56:27,783 - ERROR - Error reading from XML stream.
2020-04-06 09:56:27,783 - DEBUG - reconnecting...
2020-04-06 09:56:27,783 - DEBUG - connecting...
2020-04-06 09:56:27,783 - DEBUG - Waiting 2.08264954978 seconds before connecting.
^C2020-04-06 09:56:29,046 - DEBUG - Stopped event runner thread. 2 threads remain.
2020-04-06 09:56:29,075 - DEBUG - Stopped send thread. 1 threads remain.
2020-04-06 09:56:29,773 - DEBUG - Quitting Scheduler thread
2020-04-06 09:56:29,773 - DEBUG - Stopped scheduler thread. 0 threads remain.

It seems that sleekXMPP does not try to determine the version of TLS used by the XMPP server, and instead just uses TLSv1 even if the server does no support it.

After enabling TLSv1 on the XMPP server I got the following:

2020-04-06 10:02:13,360 - DEBUG - Loaded URL: xmpp://user:password@xmpp.nayr.us/user%40nayr.us?verify=yes&overflow=upstream&xep=30%2C199&format=text
2020-04-06 10:02:13,362 - DEBUG - Loaded Plugin: RFC 6120: Stream Feature: STARTTLS
2020-04-06 10:02:13,363 - DEBUG - Loaded Plugin: RFC 6120: Stream Feature: Resource Binding
2020-04-06 10:02:13,364 - DEBUG - Loaded Plugin: RFC 3920: Stream Feature: Start Session
2020-04-06 10:02:13,365 - DEBUG - Loaded Plugin: RFC 6121: Stream Feature: Roster Versioning
2020-04-06 10:02:13,366 - DEBUG - Loaded Plugin: RFC 6121: Stream Feature: Subscription Pre-Approval
2020-04-06 10:02:13,369 - DEBUG - Loaded Plugin: RFC 6120: Stream Feature: SASL
2020-04-06 10:02:13,371 - DEBUG - Loaded Plugin: XEP-0030: Service Discovery
2020-04-06 10:02:13,372 - DEBUG - Loaded Plugin: XEP-0199: XMPP Ping
2020-04-06 10:02:13,372 - DEBUG - DNS: Querying xmpp.nayr.us for AAAA records.
2020-04-06 10:02:13,376 - DEBUG - DNS: No AAAA records for xmpp.nayr.us
2020-04-06 10:02:13,377 - DEBUG - DNS: Querying xmpp.nayr.us for A records.
2020-04-06 10:02:13,380 - DEBUG - Connecting to 172.16.129.15:5222
2020-04-06 10:02:13,382 - DEBUG - Event triggered: connected
2020-04-06 10:02:13,382 - DEBUG -  ==== TRANSITION disconnected -> connected
2020-04-06 10:02:13,382 - DEBUG - Starting HANDLER THREAD
2020-04-06 10:02:13,382 - DEBUG - Loading event runner
2020-04-06 10:02:13,383 - DEBUG - SEND (IMMED): <stream:stream to='xmpp.nayr.us' xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' xml:lang='en' version='1.0'>
2020-04-06 10:02:13,388 - DEBUG - RECV: <stream:stream version="1.0" from="xmpp.nayr.us" id="347c9080-c36f-4ff6-9b6d-5bf17122fd4c" xml:lang="en">
2020-04-06 10:02:13,388 - DEBUG - RECV: <stream:features xmlns="http://etherx.jabber.org/streams"><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"><required /></starttls></stream:features>
2020-04-06 10:02:13,389 - DEBUG - SEND (IMMED): <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"><required /></starttls>
2020-04-06 10:02:13,391 - DEBUG - RECV: <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
2020-04-06 10:02:13,391 - DEBUG - Starting TLS
2020-04-06 10:02:13,392 - INFO - Negotiating TLS
2020-04-06 10:02:13,392 - INFO - Using SSL version: TLSv1
2020-04-06 10:02:13,904 - DEBUG - CERT: -----BEGIN CERTIFICATE-----
MIIG9zCCBd+gAwIBAgISAx4xdCT+J2NntCKIHvypzA9sMA0GCSqGSIb3DQEBCwUA
MEoxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MSMwIQYDVQQD
ExpMZXQncyBFbmNyeXB0IEF1dGhvcml0eSBYMzAeFw0yMDAzMjUxOTE0MjRaFw0y
MDA2MjMxOTE0MjRaMBIxEDAOBgNVBAMTB25heXIudXMwggIiMA0GCSqGSIb3DQEB
AQUAA4ICDwAwggIKAoICAQDdStSc5KAsDovVgFF7gqnCVgUXtWxmnO/5kr+0ydAD
yvwR825vZDHywv21J4Caj26Ny1I/pYg8c5WW0hrcRNTxLjch71J7LabXE1Irhlut
vZysHxVVl5G76wpUv9EZPZrHW1fII5wIDhEhkyBsE2FWB315oI7cl0I0U16bCnJ0
KDr/KQ6nXG9ql5usSN57guPz2HYbnDpJogNs8zCYfrfIc3KCZkEFMdRYbgw0l36r
P2TNOlpBdMeJBJjcH8TS2Ap3mYNH8F32mkstaKPGxYi1/9dPJVj9/4bGx2Dxyt+k
xaTgXH9ny5+ITxko+59nePuSPA64XgDILNZwgTKeNZLWFe+zhUTSij+e4tAnq1dw
TWspp+iSEb+b6+zpSqB1CdFLDj2pybrDp8vZB3v5KWB4SnT9rrZY+CEvAyNG0gue
wueCtC/nusVNQqkS4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M+jmyL328ll0FOymK
fSco1ZbguaMhuV2+AiEA9UgTCiGcOQ/5UOi+HDQeXO2x3eqE8Aen3Ucj993ShAgA
dgCyHgXMi6LNiiBOh2b5K7mKJSBna9r6cOeySVMt74uQXgAAAXETVOo7AAAEAwBH
MEUCIBsXWrQgWyQgwsOY1P1u/cvu/mqbDxrFywPlxcsQ+FaHAiEA3XX2T7rhveSe
1mDQcxEUYIAF5VuwxA6+d5Uz1GAosx4wDQYJKoZIhvcNAQELBQADggEBAIy435NI
cZehzSNsDMMm9sCh5mQL1vr4OKci9Pv3wkJ5+4PSPNH9HgD5iryEXW5VYcEiW9gR
Qy10g7sbWYrQw2S0K8X2QnTSEowaOXxoMQO6r2qHT7G5xq8yitWp7bskXz0HZkmj
s5rVtZUyOnsfEFuYZr7ZpSR+u6oUuhi/iIiHLH6iUUZkOBIP7vFMxkdqQ+bT7OEn
VdL8w53Z3hcCF2lbddCZG7QBE+mlKb0XloA2pP8k4K9hn0Yc3ryWIq+YNpyVPprQ
BbcnS8n0V9smpO/1PbxmhQGXKfTNSaFnG6VxjOaKaI34NPtfPOAzaCJYNfj/O1Bd
eADeD8IJia8Uvi0=
-----END CERTIFICATE-----

2020-04-06 10:02:13,904 - DEBUG - Event triggered: ssl_cert
2020-04-06 10:02:13,904 - WARNING - Could not find pyasn1 and pyasn1_modules. SSL certificate COULD NOT BE VERIFIED.
2020-04-06 10:02:13,905 - DEBUG - SEND (IMMED): <stream:stream to='xmpp.nayr.us' xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' xml:lang='en' version='1.0'>
2020-04-06 10:02:13,914 - DEBUG - RECV: <stream:stream version="1.0" from="xmpp.nayr.us" id="3defaadf-675f-48b6-8e09-b3a7f3a0b985" xml:lang="en">
2020-04-06 10:02:13,915 - DEBUG - RECV: <stream:features xmlns="http://etherx.jabber.org/streams"><mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><mechanism>SCRAM-SHA-1</mechanism><mechanism>SCRAM-SHA-1-PLUS</mechanism><mechanism>PLAIN</mechanism></mechanisms></stream:features>
2020-04-06 10:02:13,916 - DEBUG - SEND (IMMED): <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="SCRAM-SHA-1-PLUS">cD10bHMtdW5pcXVlLCxuPWFsZXJ0LHI9OTMxMzIzNjMzNjQ2</auth>
2020-04-06 10:02:13,925 - DEBUG - RECV: <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized /></failure>
2020-04-06 10:02:13,926 - INFO - Authentication failed: not-authorized
2020-04-06 10:02:13,926 - DEBUG - Event triggered: failed_auth
2020-04-06 10:02:13,927 - DEBUG - SEND (IMMED): <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="SCRAM-SHA-1">eSwsbj1hbGVydCxyPTM4Njc2MDI1MTEwNQ==</auth>
2020-04-06 10:02:13,929 - DEBUG - RECV: <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><malformed-request /></failure>
2020-04-06 10:02:13,930 - INFO - Authentication failed: malformed-request
2020-04-06 10:02:13,930 - DEBUG - Event triggered: failed_auth
2020-04-06 10:02:13,931 - DEBUG - SEND (IMMED): <auth xmlns="urn:ietf:params:xml:ns:xmpp-sasl" mechanism="PLAIN">AGFsZXJ0AHd3OEJNYUMzSjAxX2ZQYVlOMGdEZUFvYTJ5amdUeHdUOWlWU1RKcU0=</auth>
2020-04-06 10:02:13,935 - DEBUG - RECV: <failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl"><not-authorized /><text>Unable to authorize you with the authentication credentials you&apos;ve sent.</text></failure>
2020-04-06 10:02:13,936 - INFO - Authentication failed: not-authorized
2020-04-06 10:02:13,936 - DEBUG - Event triggered: failed_auth
2020-04-06 10:02:13,936 - ERROR - No appropriate login method.
2020-04-06 10:02:13,936 - DEBUG - Event triggered: no_auth
2020-04-06 10:02:13,936 - DEBUG - Event triggered: failed_auth
2020-04-06 10:02:13,936 - DEBUG - Event triggered: session_end
2020-04-06 10:02:13,937 - DEBUG - SEND (IMMED): </stream:stream>
2020-04-06 10:02:13,937 - INFO - Waiting for </stream:stream> from server
^C2020-04-06 10:02:16,819 - DEBUG - Keyboard Escape Detected in _process
2020-04-06 10:02:16,819 - DEBUG - Event triggered: killed
2020-04-06 10:02:16,819 - DEBUG - Event triggered: session_end
2020-04-06 10:02:16,819 - DEBUG - SEND (IMMED): </stream:stream>
2020-04-06 10:02:16,819 - INFO - Waiting for </stream:stream> from server
2020-04-06 10:02:20,820 - DEBUG - Waiting for 3 threads to exit.
2020-04-06 10:02:20,820 - DEBUG - Stopped event runner thread. 2 threads remain.
2020-04-06 10:02:20,899 - DEBUG - Stopped send thread. 1 threads remain.
2020-04-06 10:02:21,385 - DEBUG - Quitting Scheduler thread
2020-04-06 10:02:21,386 - DEBUG - Stopped scheduler thread. 0 threads remain.
2020-04-06 10:02:21,386 - DEBUG - Event triggered: socket_error
2020-04-06 10:02:21,387 - DEBUG - Event triggered: disconnected
2020-04-06 10:02:21,387 - DEBUG -  ==== TRANSITION connected -> disconnected

So I:

pip install pyasn1 pyasn1_modules

which then gets me:

2020-04-06 10:04:39,084 - DEBUG - Loaded URL: xmpp://user:password@xmpp.nayr.us/user%40nayr.us?verify=yes&overflow=upstream&xep=30%2C199&format=text
2020-04-06 10:04:39,087 - DEBUG - Loaded Plugin: RFC 6120: Stream Feature: STARTTLS
2020-04-06 10:04:39,087 - DEBUG - Loaded Plugin: RFC 6120: Stream Feature: Resource Binding
2020-04-06 10:04:39,088 - DEBUG - Loaded Plugin: RFC 3920: Stream Feature: Start Session
2020-04-06 10:04:39,089 - DEBUG - Loaded Plugin: RFC 6121: Stream Feature: Roster Versioning
2020-04-06 10:04:39,090 - DEBUG - Loaded Plugin: RFC 6121: Stream Feature: Subscription Pre-Approval
2020-04-06 10:04:39,093 - DEBUG - Loaded Plugin: RFC 6120: Stream Feature: SASL
2020-04-06 10:04:39,095 - DEBUG - Loaded Plugin: XEP-0030: Service Discovery
2020-04-06 10:04:39,096 - DEBUG - Loaded Plugin: XEP-0199: XMPP Ping
2020-04-06 10:04:39,096 - DEBUG - DNS: Querying xmpp.nayr.us for AAAA records.
2020-04-06 10:04:39,099 - DEBUG - DNS: No AAAA records for xmpp.nayr.us
2020-04-06 10:04:39,099 - DEBUG - DNS: Querying xmpp.nayr.us for A records.
2020-04-06 10:04:39,103 - DEBUG - Connecting to 172.16.129.15:5222
2020-04-06 10:04:39,103 - DEBUG - Event triggered: connected
2020-04-06 10:04:39,103 - DEBUG -  ==== TRANSITION disconnected -> connected
2020-04-06 10:04:39,104 - DEBUG - Starting HANDLER THREAD
2020-04-06 10:04:39,104 - DEBUG - Loading event runner
2020-04-06 10:04:39,105 - DEBUG - SEND (IMMED): <stream:stream to='xmpp.nayr.us' xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client' xml:lang='en' version='1.0'>
2020-04-06 10:04:39,113 - DEBUG - RECV: <stream:stream version="1.0" from="xmpp.nayr.us" id="8527860a-fcb1-49d6-a601-89b93dabcaac" xml:lang="en">
2020-04-06 10:04:39,114 - DEBUG - RECV: <stream:features xmlns="http://etherx.jabber.org/streams"><starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"><required /></starttls></stream:features>
2020-04-06 10:04:39,115 - DEBUG - SEND (IMMED): <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"><required /></starttls>
2020-04-06 10:04:39,117 - DEBUG - RECV: <proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls" />
2020-04-06 10:04:39,117 - DEBUG - Starting TLS
2020-04-06 10:04:39,117 - INFO - Negotiating TLS
2020-04-06 10:04:39,117 - INFO - Using SSL version: TLSv1
2020-04-06 10:04:39,618 - DEBUG - CERT: -----BEGIN CERTIFICATE-----
MIIG9zCCBd+gAwIBAgISAx4xdCT+J2NntCKIHvypzA9sMA0GCSqGSIb3DQEBCwUA
MEoxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MSMwIQYDVQQ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dL8w53Z3hcCF2lbddCZG7QBE+mlKb0XloA2pP8k4K9hn0Yc3ryWIq+YNpyVPprQ
BbcnS8n0V9smpO/1PbxmhQGXKfTNSaFnG6VxjOaKaI34NPtfPOAzaCJYNfj/O1Bd
eADeD8IJia8Uvi0=
-----END CERTIFICATE-----

2020-04-06 10:04:39,618 - DEBUG - Event triggered: ssl_cert
2020-04-06 10:04:39,623 - ERROR - day is out of range for month
Traceback (most recent call last):
  File "/home/admin1/.local/lib/python2.7/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 1492, in _process
    if not self.__read_xml():
  File "/home/admin1/.local/lib/python2.7/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 1564, in __read_xml
    self.__spawn_event(xml)
  File "/home/admin1/.local/lib/python2.7/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 1632, in __spawn_event
    handler.prerun(stanza_copy)
  File "/home/admin1/.local/lib/python2.7/site-packages/sleekxmpp/xmlstream/handler/callback.py", line 64, in prerun
    self.run(payload, True)
  File "/home/admin1/.local/lib/python2.7/site-packages/sleekxmpp/xmlstream/handler/callback.py", line 76, in run
    self._pointer(payload)
  File "/home/admin1/.local/lib/python2.7/site-packages/sleekxmpp/features/feature_starttls/starttls.py", line 64, in _handle_starttls_proceed
    if self.xmpp.start_tls():
  File "/home/admin1/.local/lib/python2.7/site-packages/sleekxmpp/xmlstream/xmlstream.py", line 889, in start_tls
    cert.verify(self._expected_server_name, self._der_cert)
  File "/home/admin1/.local/lib/python2.7/site-packages/sleekxmpp/xmlstream/cert.py", line 133, in verify
    not_before, not_after = extract_dates(raw_cert)
  File "/home/admin1/.local/lib/python2.7/site-packages/sleekxmpp/xmlstream/cert.py", line 115, in extract_dates
    not_after = datetime.strptime(not_after, '%Y%m%d%H%M%SZ')
  File "/usr/lib/python2.7/_strptime.py", line 458, in _strptime
    datetime_date(year, 1, 1).toordinal() + 1
ValueError: day is out of range for month
2020-04-06 10:04:39,625 - DEBUG - reconnecting...
2020-04-06 10:04:39,625 - DEBUG - Event triggered: session_end
2020-04-06 10:04:39,625 - DEBUG - SEND (IMMED): </stream:stream>
2020-04-06 10:04:39,626 - INFO - Waiting for </stream:stream> from server
^C
Aborted!

I then tried to set verify=no:

apprise --body='Test Message' 'xmpp://user:password@xmpp.nayr.us?to=user2@nayr.us&verify=no' -vvv

But see the same error message:

ValueError: day is out of range for month

:computer: Your System Details:

:crystal_ball: Additional context As these seem to be issues with the sleekxmpp lib I'm not sure who/how would/could make changes to it.

I just wanted to let you know my experience trying to use xmpp with apprise.

Thanks, Ryan

caronc commented 4 years ago

It's unfortunate that the maintainer of sleexmpp also did not make both pyasn1 and pyasn1_modules dependencies of it. It wouldn't make sense for me to make them dependencies of apprise at this point since sleekxmpp isn't even one.

One option is to make sleekxmpp a part of apprise and try to fix it locally. I do this for one other library already since it was also no longer maintained either (gntp used by Prowl services). There are a list of pending merge requests already; perhaps one of them hold the key to your problem. There is also a ticket here which identifies a similar date/time issue suggesting that downgrading to SleekXMPP 1.3.1 might solve your problem.

Unfortunately I'm not really an XMPP expert and was relying on this one dependent library to shine here.

Also, what happens if you use Python v3? Do you experience the same symptoms?

amotl commented 4 years ago

Dear @clarkspark,

does using verify=no and uninstalling pyasn1 and pyasn1_modules work for you? While I know this is not a perfect solution, it might make things work at least.

With kind regards, Andreas.

Neustradamus commented 4 years ago

@caronc: Have you looked for Slixmpp the successor of SleekXMPP?

caronc commented 4 years ago

@Neustradamus Thanks for making the point. In this case the OP is using Python 2.7 which Slixmpp isn't compatible with. I realize Python 2.7 is a thing of the past these days. Honestly, I've been trying my best to keep Apprise backwards compatible with it (only because I use CentOS 7 at home and at work which is still very much supported). Unfortunately RedHat/Oracle Linux/CentOS 7 all use Python v2.7 as their base.

However I could see value in the Apprise NotifyXMPP plugin at least using Slixmpp first (if available) and then falling back to SleekXMPP? I need to look at how Slixmpp works; is it a similar commands/setup?

I don't mind taking the archived master branch of SleekXMPP into this package as well (as it's MIT Licensed) and seeing if i can fix the time issue the OP suggested. Apparently just using an older version of SleekXMPP works great (mentioned here on an issue you were even part of :slightly_smiling_face:)

# The last known working version with respect to the date issue
pip install sleekxmpp==1.3.1

What are your thoughts?

caronc commented 4 years ago

Better late then never right?

Can one of you guys give this a test? The easiest way to do it is like so (with Python 3):

# Create a virtual environment to work in
# This way you can just destroy it after when it's all over.
# It will create a directory called apprise
python3 -m venv apprise

# Change into our new directory
cd apprise

# Activate our virtual environment
source bin/activate

# Install our branch:
pip install git+https://github.com/caronc/apprise.git@227-xmpp-slixmpp-support

# install just slixmpp
pip install slixmpp

# Give it a go:
apprise -t "Title" -b "Body" xmpp://{your_details}

I'll merge the code into the master branch if we have success (and will become part of Apprise v0.8.6).

This plugin will now always use slixmpp first if it's installed, if not it will fall back to sleekxmpp (if installed).

caronc commented 4 years ago

@clarkspark : I don't suppose you'd be able to test this for me would you? Your my goto guy since i made the change just for you :wink:

No pressure; alternatively i just plan to just continue to leave this issue blocked until someone can let me know if it works okay for them.

caronc commented 3 years ago

I've merged all of the Apprise slixmpp code as I've gotten a workaround in place for it to work properly in harmony with sleekxmpp. Issue resoved in #240