broadcast file to subscribers - xmpp

i am using pubsub protocol for subscribing and publishing content , now i want to publish a file so that it will be automatically available for the users those who have subscribed.
i have explored other protocols to transfer file like
XEP-0096: SI File Transfer
XEP-0095: Stream Initiation
XEP-0047: In-Band Bytestreams
XEP-0065: SOCKS5 Bytestreams
but all the above file transfer protocols are one to one / peer to peer file transfer.
what i am looking for is once the publisher publish the file it will be available to all the subscribers just like the normal msg we publish , so is there any way to achive this ?
Just the way whtsapp chatON and other messengers are sending multiple files to multifle contact

You could try using the pubsub message to prompt a standard file transfer between the client and the server.
This would require the creation of a component on the server that you could upload the file to and use to do the file transfers.
A better option might be to do the file transfer outside of XMPP altogether. Upload to a file server and then download from each client on receiving the message with the file info.

Related

Get device configuration when device connects to MQTT Broker

Previously I have setup a device to connect to Google Cloud IoT Core and when the device would connect it would get a callback from the server to a topic with the device configuration file.
I am currently moving off of that to a local MQTT broker on a Raspberry Pi with Mosquitto running. What I am trying to do is figure out how to replicate the sending of the configuration file when connected.
Is there a way for other clients to know when a new client connects? If so I could then just have a client running on the Pi that would is responsible for sending messages.
The thought was that the Pi would hold the configuration file of the connected device and once it connects it would be sent back over to it via a topic for that device
Or is there another solution that I dont even know about yet that accomplishes this? I have not set up my own end to end MQTT communication before so I dont exactly have a path forward here
Is there a way for other clients to know when a new client connects?
Not as part of the protocol; but it's simple enough to publish a message upon connection. I can see a few ways of accomplishing your aim:
Publish all of the configurations as retained messages. You would require a 'config' topic per device for this (say config/uniquedevicename). When the client starts up it will subscribe to the relevant topic and receive its configuration (the 'server' would need to publish a message to each of the config channels with the retain flag set).
Upon starting the device publishes a message requesting its configuration; the server is subscribed to the relevant topic and responds with the configuration. You can use preset topics for the response or pass the topic in as part of the request.
For one (or a small number of devices) option 1 would be very simple to implement; however option 2 provides more flexibility.

How to send a mail in activiti?

I made a process using activiti-explorer and I deployed.I have a startevent,mail task,user task and endevent.When I started the process it says "Warning!Could not send e mail". What should I do?
Thanks
The Activiti engine sends e-mails trough an external mail server with SMTP capabilities. To actually send e-mails, the engine needs to know how to reach the mail server. Following properties can be set in the activiti.cfg.xml configuration file.
More info: http://www.activiti.org/userguide/#bpmnEmailTask

perl client-to-server file sending and file retrieval

I'm a newbie in stackoverflow and perl IO::Socket sockets programming and I have a problem with my project. I have a TCP client and server script where the client can send file to the server. The server side creates a directory where it stores the received received files.
Is it possible for me to view and retrieve/download the files that I have sent to the server?
My professor told me that if i could add these functions he would reconsider my project.
help would be greatly appreciated. THANK YOU!
A possible approach will be to send a "string" command to the server that will trigger the server to scan the download directory for all file by using the code below
The names of the files can then be sent by the server app back through the client socket
Subsequently another string command for download can be sent to the server indicating the file path of the file your're interested in and you'll use the same process you used to send the file to the server in the first place to send it back to the client.

File Distribution via SMTP: How to do the receiving side?

I need to setup a file distribution system between different sites of a WAN. Files that are dropped into some input directories on the source machine should be distributed into a directory on each of the target machines at other sites. One of the requirements is that between certain sites the only allowed traffic is SMTP. There is already a daemon in place that covers the sending side by polling input directories and mailing all found files as attachments to configured addresses (was thought for human recipients originally).
How would you design the receiving side?
One could write a stripped down SMTP server that handles only this one case, strips attachments from incoming mails, and puts them into a local directory.
One could setup a full mail server with local delivery, poll the user’s inbox and try to extract files from there.
One could setup a full mail server with a configuration or procmail to directly extract attachments into a directory.
I don’t really like any of these proposals because they are all more involved than setting up a SSH or FTP server. Also I don’t have experience with setting up and administrating mail servers.
Do you have suggestions or experiences to share?
The target system is Linux/Unix, but if you know something platform independent I’d like to hear, too.
The most suitable way is to set up an ESB with SMTP support, like ServiceMix or Mule. Mule is more straight-forward to get started with.

Accept All Incoming Email Messages on Server

I want to write some email scanning software and don't understand how to setup my server. I have a hosted web server running Windows 2003 Server. It is running the Default SMTP Virtual Server with a fully-qualified domain name of abcdef.com (example). DNS is pointing abcdef.com to my server. If I spoof an email from my desktop pc so that it appears to come from info#abcdef.com, and I send the email to a 'non-existant' email address then the bounceback does arrive on my web server and is stored in C:\inetpub\mailroot\Queue on the server - great! (I can scan it and handle the bounceback). However, if I simply send an email straight to info#abcdef.com then it does not seem to get placed anywhere on the server. I don't understand why bouncebacks get stored but other incoming email doesn't. I'm keen to avoid having to install any 'email server software' on the server, as I want to keep things as clean as possible. All I really want is some way of telling the server to accept all incoming messages to abcdef.com so that I can process them myself, and to place the .eml files in a known directory that I can scan. I'll then write an eml file parser to process the files.
Thanks very much.
A possible reason for the lack of delivery is that your domain has a DNS A record, but no DNS MX record. MX records are used for delivery of mail. Historically, if no MX record was present for a domain, mail servers were supposed to fall back to looking for a domain's A record.
In your case, I'd guess that your local mail-sending software is looking for an MX record and then stopping if it doesn't find one, whereas the remote system sending you the bounce is looking for the MX record and then looking for an A record when it can't find one.
The Wikipedia article on MX records has more details.
SMTP is a message transfer agent (MTA), responsible only for handling the transfer of mail from one point (the client, perhaps) to another (the mailbox server, such as a POP or IMAP server). SMTP servers aren't the right tool for ultimately handling mail coming INTO a domain -- they only handle transferring the mail coming into a domain to another app, such as the aforementioned POP or IMAP server, which then know how to sort and store that mail.
In short, the Default SMTP Virtual Server isn't the tool you're looking for for your project.
From this other StackOverflow question, it looks like there are a few SMTP servers which are intended for development use but which might serve the purpose you seek -- they accept incoming messages and then write them to files (in some manner, and with some tweaking).
Ok, working now. Issues were as follows:
There was no MX record, so external email wasn't being directed to the server. The .EML file that existed on the server was indeed placed there by an outbound email process.
The firewall was blocking port 25 - now opened.
It is necessary to have some sort of inbound email service running on the server. Windows Server has a lightweight POP3 service which you can configure to place all incoming email into a single 'catch-all' mailbox. This fills with .EML files, which can then be scanned by our custom service.
Many thanks to delfuego & Jon.