I started implementing a mail project on Node.js. Now I'm trying to figure out how to send a message to another mailbox, do I understand correctly that:
port 25 is used for connection between different mail agents, that is, if I want to send a message from telnet (or from my mail) to gmail, then I should use this port? (Is this called sending?)
Port 587 is used if I want to send messages from my mail (for example Gmail), that is, I have to go through to send a message? (This is called retransement? When does the letter go between the accounts of one postal agent)
on port 25 do I need to use the mx record to connect to other mail?
UPT: if you are looking for answers, i recommend you check this link:
https://serverfault.com/questions/1045480/e-mail-transmission-example
Related
I'm using Nodemailer for a website, and everything works fine emails get sent. The website and email is on Ionos.
After a few days though I always get a warning message on the Email account that it has detected strange activity on the account and I have to change the password, if I ignore the message I can't send or receive any further Email.
Is this a common problem with Nodemailer? Is there a way to prevent this or is there a better mail solution I could use where it's less of a chance of this happening?
Nodemailer a lot of the time needs insecure app access, ionos email client doesn't and will not use insecure app access this means, this is a problem with ionos not being insecure allowing the API to connect to the email client
I would like to have a very simple client in nodejs (an example) that can receive messages from specific channels and groups in telegram. I just searched in internet but I only get bot samples. I want to receive group messages in what I don't have access to give privileges to my bot so I would like to know if I can receive my own messages with no bot as intermediary.
Refer to the Getting Started section to learn more about your first steps.
In short:
Create your client application
Get your app_id
Establish user authorization
Learn more about channels
Use channel methods to work with channel messages
I'm trying to implement a communication method between client and admin (bidirectional) using Paho MQTT JS + Mosquitto broker 1.6.8 and I'm having some trouble with retained messages and persistent sessions.
What I want to accomplish:
My web client is subscribed to a topic where the admin publishes (let's say topicA) and the admin is subscribed to a topic where the client publishes (topicB). When any of the users received a message for that topic, it appears on the screen, and they keep appearing below the previous so that they form a list of messages. When they are both online, they have to see the messages that are being sent and if they go offline, they have to see the old and new messages as well. Also, the users must have the ability to clear the list of messages.
What I've tried so far:
My first try was setting the published messages with the retained value to true, so that the message can be delivered to future subscribers. However, I see that only the last message is retained. I investigated and found that I can establish a persistent session (by cleanSession: false) between broker and client, so that if I set the qos of the message to a value greater than 0 (0 or 1) and the client is subscribed to the topic, they'll get all the undelivered messages. This doesn't work for me, or at least the way I expect it to work. I've tried removing the Mosquitto Db and restarting (didn't change anything). I also tried using the same id for all clients and another id for all admins, because I thought that maybe, the broker saves the messages only for a particular clientID, so if a client with a completely different ID connects, they won't get the messages.
Is there a way of delivering ALL the undelivered messages (because of one client being online and the admin offline, or viceversa) and not only the las one (retained)? Or is there a way of retaining more than one message (better in my opinion, if I could clear the retained ones by sending a null payload) ?
First every client must have a unique client id. When there is a client id clash the oldest connected client will be disconnected.
Second it's the QoS of the subscription, not the publish that dictates if the broker will queue a message for a offline client with a persistent session
So for a client to receive messages published while it is offline, it must
Have previously connected and subscribed to the topic with a QoS of 1 or 2
When reconnecting it must use the same client id as last time
Have cleansession set to false
The messages will only be delivered once so there is no need to clear the messages, but if you don't have to receive the queued messages, set the cleansession flash to true.
The broker will only retain the last message published on a given topic that had the retained bit set, there is no way to change this.
I am trying to use RabbitMQ to send messages to users on a website. While I know how to communicate between different scripts I can't find anything about how I can get a new user to recieve messages.
Let's take chapter 1 of the tutorial as example: https://www.rabbitmq.com/tutorials/tutorial-one-python.html
How would I be able to send "Hello World" to a user on my website and be displayed in the console? Would it even be possible using python?
Try using the RabbitMQ Web-STOMP plugin: https://www.rabbitmq.com/web-stomp.html
You wouldn't use RabbitMQ for that. It's for communication between different services in your back end, not for sending messages between arbitrary users on your front end.
I'm interning for a company and have been given an assignment. I'm to write a Javascript script (it's for internal use only; security is not a concern) that accesses an RDS database on an AWS instance, grabs a list of email addresses, and uses the server's smtp to send emails to the whole list. The problem is that I know nothing about AWS and RDS. Here are the things I was provided:
--Server address, port, and credentials file of smtp server
--Address of AWS DB, and its username, password, database name, and table
--The company's server url, security key, and I was also given SSH and SCP commands.
Where do I start learning how to do this? I feel like it's within my grasp, but I just don't know the overall process of what I need to do to get this information. I've never used SQL or RDS before. Any direction whatsoever would be appreciated!
Try to break the problem down into chunks:
Write your Database Query as SQL
If the RDS database instance in question is publicly available, try to connect to it with your preferred (GUI?) SQL client, and inspect its tables. Figure out how to write the SQL query you need in order to grab the e-mail addresses you'll need in the next step, e.g. select email_address from users where user_type='Internal'. The w3schools SQL Introduction is a good place to start.
If the RDS database instance isn't publicly available (i.e. if you can only connect to the database from within AWS - from the server on which you plan to run your code), then figure out how to log in to that server using SSH or RDP, and then use a database client on your AWS server to write and test your SQL query.
Check first that you're not logging into a production machine that you could break by mistake.
Use a Server-Side program to run your SQL query
You must then connect to the RDS database instance using some code that runs server-side. If you're using a server-side JavaScript environment such as NodeJS, this is fine, but whilst it's potentially feasible to use JavaScript directly from a browser to connect to a database, it's not good practice, even for your assignment, so make sure you're using some server-side code.
Find out what your company's usual platform is (Java? Python? PHP? NodeJS?) and go with that. Search the internet for example code - you'll easily find some, because querying a database is an extremely common programming task. Since you've already got your SQL query, you'll be able to write some simple code that connects to the database and grabs your desired email addresses. For now, just have it print them out to a log file or to the console.
Send a test e-mail
Separately, in your server-side program, figure out how to connect to your company's SMTP server and send an e-mail to yourself, as a start. Again, search the internet for examples in your chosen programming language.
Once you've done that, define two or three e-mail addresses in an array or list, and figure out how to send the same message to these users simultaneously.
Connect your Database Query Code and SMTP Code
You're able to query the database, and you're able to send an e-mail to multiple users. Now add to your code to join those two functions together. Don't spam everyone in your firm and get yourself fired!
You mentioned JavaScript
Make sure you are clear about the requirements of your assignment. Should the program be started from a browser? Does a user need to click a button on a webpage saying 'Send Email'? If so, figure out how to submit a request to your server to have the server-side code execute. Search the internet for examples of POSTing HTML forms from JavaScript.
Good luck!