Send email to Gmail server from IOT devices - networking

I have an IoT device (SEL). I want to send an email to a company gmail email (random.email#mycomp.com).
The IoT device requires the numerical IP address of the server, but I was informed that the IP address of the Gmail server always changes. How could I get the fixed IP address of the Gmail server?
Thanks.

With the limitation of this device, I am afraid you will need a proper mail server/service that you can send to (specifying an ip) and that will send the email to the gmail servers.
you can find the ip address of gmail servers with the dig command under linux
dig +short gmail.com MX
dig +short gmail-smtp-in.l.google.com A
or online : https://www.digwebinterface.com/
but it is most likely that gmail will flat out refuse your email for a few reasons; lack of spf record, lack of dkim record lack of reverse dns and lack of a matching A record and if the email comes from a redidential ip, although it is not part of the email standards, it might also get refused.
if you can authenticate as an existing existing user in gmail (with user and password) (the screenshot provided does not show if it is a possibility) then you might be able to send as this specific user.

Related

What should I check for when a client's public IP address doesn't appear to match "What's My IP" for OLEDB connections over Port 1433

Here's an odd one... We have an application that uses OLEDB to connect to an Azure SQL database over port 1433.
Users authenticate through a REST API. Once the API has validated the authentication it will fetch the connection details and pass those back to the application which will then attempt to connect to the database using the connection string it builds up using those pieces of information.
The Azure SQL Server Firewall is configured not to let through any IP addresses by default. Our REST API, after authenticating the user, will then determine what their IP address is and add it to the firewall temporarily.
All of this normally works quite well. But with one site we have experienced a strange issue.
When you start a browser and you enter "What's My IP" in the user's browser, it returns an IP Address (IPv4), say, A.B.C.D
I confirm that the REST API also seems to be getting that value for the IP Address, as after authentication I see that the REST API has added A.B.C.D to the firewall rules.
But our application wouldn't connect. Luckily, we have a "direct" mode which connects directly to the database without using the REST API - this is normally used for clients who prefer to keep their databases On Premises. So I switch the app to this "direct" mode and it reports an error.....
The error it comes back with reports that IP Address A.B.E.F isn't allowed to connect to the database.
"What's my IP" still reports A.B.C.D as the site's external IP Address
My question is: How might this situation have arisen? What can we tell their IT support to check or change to prevent this?

Obtaining MAC address

According to Obtain client MAC address in ASP.NET Application, it is not possible. I am not entirely convinced because whenever I connect to Tim Hortons WiFi, my MAC address is known.
Occasionally, the network is slow and I see this URL like this before being redirected to the Connect page:
http://timhortonswifi.com/cp/tdl3/index.asp
?cmd=login
&switchip=172.30.129.73
&mac=60:6c:66:17:1a:83
&ip=10.40.66.229
&essid=Tim%20Hortons%20WiFi
&apname=TDL-ON-NEP-02177-WAP1
&apgroup=02177
&url=http%3A%2F%2Fweather%2Egc%2Eca%2Fcity%2Fpages%2Fon-72_metric_e%2Ehtml
So according to this URL, the site knows the IP address of the router, my MAC address, the IP address assigned to my device by the router, the network SSID, some other pieces of information, and the URL I was trying to access prior to connecting.
There's two options: Tim Hortons WiFi Basic and Tim Hortons WiFi Plus, where the "Plus" option allows me to connect to any Tim Hortons WiFi access point in Canada automatically with this device. Registration requires an email address, so I'm assuming this is possible by checking the MAC address and storing it in a database that routers ping upon connection. More info here.
According to the extension of this page, I can safely assume it is ASP. How are they obtaining this information?
When your client traffic reaches the first router, that router will route the traffic to the adecuated port, changing the response MAC address with its own MAC address so the answer will be routed to it. And this will happen for each of the routers the packets travel by. So, at the end, the web server will only see the MAC address of the last router where the answer will be sent to be routed back to the previous roter, and this process repeated until the answer reaches the client.
No, there is not way to obtain the MAC address of client from server side.
But, what you are seeing is a client sending its information to a server. So, the answer can be converted into "how can i obtain my local mac address and send it to the server?".
Browsers do not allow to read this information. Some properly signed/configured ActiveX or Java applets can do it, but they can be blocked, or you can have some device that will not execute java nor activex, so it is not a reliable way of doing it.
In the case in your post, the easiest way of doing it is configuring the wifi access point dhcp or dns server to serve a proxy configuration file that will allow to configure a redirection to the desired web server, redirection that has been created inside the access point, which have all the shown information in your post.

Classic asp emails are going to spam instead of inbox

I have moved my classic asp websites from vps to dedicated server(windows server 2012). All the emails are going to spam instead of inbox(gmail and hotmail), emails are not at all receiving at yahoo. I have properly configured smtp on windows server.
Most receiving email servers are quite picky about where your email is sent from. They check your sending IP address and can choose to classify your email as spam or reject it all together unless all of the following things are true:
reverse-DNS for you IP address should give a proper name (and not look like a dynamic or dial-up address)
the reverse-DNS should again forward resolve to the same IP address
your IP address must not be on any blocklist or have a bad reputation. The problem here is that there are may different blocklists and you do not necessarily know what lists they check. You could test your IP address at http://multirbl.valli.org and see if there are any known issues
the domain-name of your sender email address can have SPF policies published in DNS that explicitly tells the world what IP addresses are allowed to send emails for that domain, and if your IP address is not included you are considered a fake sender
And there can be any number of other anti-spam/forgery checks in place that cause trouble for you. The best bet would be for you to relay your outgoing emails via an official mail server (for the domain your are trying to send from), as that already has the above things covered, but that usually requires some authentication mechanism or other agreement with the real mail server you want to use.
All these checks by the receiving end are there to stop spam and other unwanted emails. In order to not be classified as a spammer, you cannot just set up a random server at a random address and start sending emails from a random email address (or email address that normally are sent from some more official email server).

IP Spoofing in HTTP Request?

I know someone that is able to take a list of emails + ip addresses and
subscribe each email to an autoresponder (GetResponse / Aweber).
But the amazing thing is that he can do it with the ip address that's provided
in the list.
So if he has an email xxx#abc.com and IP 185.252.123.321
he's able so subscribe this email to the autoresponder but
if you enter into the autoresponder account and look on the
lead record, you'll see 185.252.123.321 in the IP address field
and not the real IP address that the request sent from.
Does someone have any idea how could he do it?
If the software is using the X-Originating-IP mail header to determine the IP address of the email, then this can be easily spoofed.
X-Originating-IP: 185.252.123.321
It is trivial to set this header from a mail client that allows customer headers to be set or if the person is connecting to an SMTP server directly and setting it themselves. You may find this answer relevant too.

how to get mac address from ip address from client site in asp.net?

i want to store details of visitor in site like
ip and mac address
i got ip address of client
but how can i get mca address of client ?
Simple answer: you can't. The MAC address is never transmitted. The best you can hope is to get the IP but remember that this IP could be the one of a proxy server situated anywhere in the world if the user configured some proxy to access the internet.
If your website has been compromised you will have to contact the authorities in order to attempt to catch the person who did it. In most countries regular citizens do not have the power or authority to request the type of information you need from ISPs.

Resources