Ejabberd and in-band registration [closed] - xmpp

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
eyeryone! I have a problem with ejabberd. Ejabberd mod_register config have:
[{access, register}]
When i send:
<body rid='1833385270' xmlns='http://jabber.org/protocol/httpbind' sid='ddc858306087c89bb1b95f6d507811f2068932cf'>
<iq to='intive.com' type='set' id='reg2' xmlns='jabber:client'>
<query xmlns='jabber:iq:register'>
<username>test_auto</username>
<password>test_auto</password>
</query>
</iq>
</body>
I get:
<body xmlns="http://jabber.org/protocol/httpbind">
<iq xmlns="jabber:client" from="bla.com" to="test1#bla.com/29309356411303308653389982" id="reg2" type="error">
<query xmlns="jabber:iq:register">
<username>test_auto</username>
<password>test_auto</password>
</query><error code="403" type="auth">
<forbidden xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/></error>
</iq>
</body>
What i do wrong?

In my case, I need to change
{access, register}
to
{access_from, register}
In order to allow an admin to register a new user

I had the same problem which was resolved by commenting out the {ip_access, .. section of {mod_register, [... in the ejabberd.cfg file.

Related

Sending Post Request to server in flutter [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I want send an post request to Api server to update my article views count. I am able to do this via Postman by running http://127.0.0.1:8000/api/updateViews/19 (19 is article id).
I tried http.post() method but could not send request to server.
I just want to send post request whenever anyone open the article detail page.
below is the sample code for flutter post request using http package.
var response = await http.post('http://127.0.0.1:8000/api/updateViews/19',
body:{your post body goes here},
headers : {headers as per your backend needs}
);
after above code you can handle the result of the post request, you can send some success code and error code as response from backend.
for further knowledge visit

Chat process in XMPP Openfire server using Android application

I’m using Openfire XMPP server for a android chat application. I can connect and login to the server using my app.
Now I want to know how to send friend request and accept friend request in this chat application.
I can fetch all the user from server but I want to know the process of starting a chat.
Thanks in advance.
The processes are a bit more complex than it looks to add/accept friend requests you need to do some juggling with presence and and roster iq stanzas.
I'll try to give you an indication about what stanzas are sent/received using contacts operations below.
1. Add contact
To add a contact you need to send a `subscribe` stanza.
<presence xmlns="jabber:client" to="you#app.com/123" id="9VO8j-1" type="subscribe" from="me#app.com/1234" />
1.1. Request accepted
When adding a contact and the other app "accepts the request" you receive two stanzas:
1. <presence xmlns="jabber:client" from="you#app.com/123" id="9VO8j-1" type="subscribed" to="me#app.com/1234" />
2. <presence xmlns="jabber:client" from="you#app.com/123" id="9VO8j-2" type="subscribe" to="me#app.com/1234" />
3. <presence xmlns="jabber:client" from="me#app.com/1234" id="9VO8j-3" type="subscribed" to="you#app.com/123" />
1.2. Request Denied
When the request is denied you receive an "UNSUBSCRIBED" stanza.
Example: <presence xmlns="jabber:client" from="you#app.com/123" id="9VO8j-1" type="unsubscribed" to="me#app.com/1234" />
2. Accept contact request
1. <presence xmlns="jabber:client" from="me#app.com/1234" id="9VO8j-1" type="subscribed" to="you#app.com/123" />
2. <presence xmlns="jabber:client" from="me#app.com/1234" id="9VO8j-2" type="subscribe" to="you#app.com/123" />
3. Deny contact request
<presence xmlns="jabber:client" from="me#app.com/1234" id="9VO8j-1" type="unsubscribed" to="you#app.com/123" />
4. Remove contact
When you "Delete" a contact you should be in fact be "deleting" it locally in your app and from the roster.
This is done by sending two stanzas:
1. <presence xmlns="jabber:client" from="me#app.com/1234" id="9VO8j-3" type="unsubscribe" to="you#app.com/123"/>
2. <iq from='me#app.com/1234' id='ah382g67' to='you#app.com/123' type='set'>
<query xmlns='jabber:iq:roster' ver='ver34'>
<item jid='you#app.com/123' subscription='remove'/>
</query>
</iq>
Note: The use-cases described above do not include all the iq:roster stanzas associated to the presence stanzas. These are sent automatically by the server whenever a contact changes the subscription and ask types.
For a better understanding of how the these workflows work in details I suggest you read the latest RFC (implemented by your server). You can find it on the office site.
See section 3. Managing the roster.

Why is Gmail rejected our emails as non-compliant with RFC 2822? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
We use Mailgun to send out emails and recently I noticed quite a few emails each day are being rejected by Gmail.
Here's the type of message we receive:
550
5.7.1 [184.173.153.6 11] Our system has detected that this message is
5.7.1 not RFC 2822 compliant. To reduce the amount of spam sent to Gmail,
5.7.1 this message has been blocked. Please review
5.7.1 RFC 2822 specifications for more information. f15si23385851vdu.1 - gsmtp
The RFC 2822 spec is a massive document so I haven't read it front-to-back but from looking at resources around the web our emails don't fall into any of the common pitfalls that would trigger this type of response from Gmail.
Here's an example email header:
Received: by luna.mailgun.net with HTTP; Mon, 29 Jun 2015 21:06:59 +0000
Message-Id: <20150629210659.18668.39318#(domain)>
X-Mailgun-Variables: {"variation": "original", "campaign_code":
"(customValue)"}
Reply-To: (name) <(email)>
X-Mailgun-Track: false
X-Mailgun-Tag: (customTag)
To: (email)
From: (name) <(email)>
Subject: (subject)
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="12f0bd630f2145a3afcd98b621a3b1f2"
--12f0bd630f2145a3afcd98b621a3b1f2
Content-Type: text/plain; charset="ascii"
Mime-Version: 1.0
Content-Transfer-Encoding: 7bit
(text content)
--12f0bd630f2145a3afcd98b621a3b1f2
Content-Type: text/html; charset="ascii"
Mime-Version: 1.0
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>(title)</title>
<style type="text/css">
(css)
</style>
</head><body style="(css)" >
(content)
</body>
</html>
--12f0bd630f2145a3afcd98b621a3b1f2--
What are we doing wrong?
One obvious rfc2822 violation in your example is the missing Date header .
from rfc2822, Section 3.6:
The only required header fields are the origination date field and
the originator address field(s).
It turned out we were using two different domains for the From and Reply-to which I guess is a no-no.

XMPP PubSub retrieve node's subscribers

I have a PubSub node with two subscribers: Joe and Mike.
I want to retrieve them as a list of subscribers and when I do
<iq type='get'
from='francisco#denmark.lit/barracks'
to='pubsub.shakespeare.lit'
id='subscriptions2'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<subscriptions node='my_node'/>
</pubsub>
</iq>
the result is
<iq type='result'
from='pubsub.shakespeare.lit'
to='joe#denmark.lit'
id='subscriptions2'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<subscriptions node='my_node'>
<subscription node='my_node' jid='joe#denmark.lit' subscription='subscribed' subid='123-abc'/>
</subscriptions>
</pubsub>
</iq>
It doesn't show that Mike is also subscribed to the same node.
And if I make the same query from Mike's account it shows that Mike is the only subscriber and does not include Joe.
Only the node owner can retrieve the list of subscribers.
And the namespace should be "http://jabber.org/protocol/pubsub#owner" for such request.

Facebook self vCard

Hi I want to get profile picture of my own. So After login, I am sending below IQ packet and getting the below mentioned response but it does not contain any Picture details.
Can anyone please help me what is the reason.
Reguest:
<iq to='-100002643606171#chat.facebook.com' from='' id='v1111' type='get' xmlns='jabber:client'>
<vCard xmlns='vcard-temp'/>
</iq>
Response:
<iq id="v1111" to="XXXXXX#chat.facebook.com/8hAKe3RdK1_51d153db_4AFBBB1DF508F" from="-100002643606171#chat.facebook.com" type="result">
<vCard xmlns='vcard-temp'>
<FN>Req Lee</FN>
</vCard>
</iq>
To get your own vCard, you should leave out the to attribute, or set it to your bare JID, like to="XXXXXX#chat.facebook.com".
<iq type="get" id="myvcardplz">
<vCard xmlns="vcard-temp"/>
</iq>