Sub topic 5
Checking email addresses, domains, and links
This chapter assumes you have searched and applied for jobs online, use email and messaging apps, and know that a domain is the name of a website, such as example.com. You will learn how to check whether an email address or a link really belongs to the company it claims to represent.
Why the domain is the part that matters
An email address has two parts. In [email protected], jane is the local part and example.com is the domain. Anyone can choose the local part. Only the owner of a domain controls who gets an address on it. So the domain is the part you check.
A link works the same way. The part that decides who runs the page is the host, which is the text between https:// and the first /. Everything after that is just a path on that host.
Reading a link from right to left
Read the host from right to left, starting at the first /. A host belongs to a company if it is the company's domain or a subdomain of it. A subdomain is a name placed in front of a domain, such as careers in careers.example.com.
| Link | Host | Belongs to example.com? |
|---|---|---|
| `https://careers.example.com/jobs/123` | `careers.example.com` | Yes, a subdomain |
| `https://example.com.jobs-apply.net/jobs/123` | `example.com.jobs-apply.net` | No, the real domain is `jobs-apply.net` |
| `https://example-careers.com/apply` | `example-careers.com` | No, a different domain |
| `https://examp1e.com/apply` | `examp1e.com` | No, a look-alike with a digit 1 |
Scammers rely on you reading from the left, where the familiar name appears first.
Checking a link in code
This function applies the rule exactly. It accepts the domain itself or a name that ends in a dot plus the domain.
from urllib.parse import urlparse
def link_belongs_to(url: str, official_domain: str) -> bool:
host = (urlparse(url).hostname or "").lower()
return host == official_domain or host.endswith("." + official_domain)
print(link_belongs_to("https://careers.example.com/jobs/123", "example.com"))
print(link_belongs_to("https://example.com.jobs-apply.net/jobs/123", "example.com"))The first call prints True. The second prints False, even though the URL starts with "example.com". A plain test such as "example.com" in url would wrongly accept it, so avoid that shortcut.
Checking a sender address
The sender's domain should match the company. Free mail providers such as Gmail are a common warning sign for a company role, because a real employer normally writes from its own domain.
FREE_MAIL = {"gmail.com", "outlook.com", "yahoo.com"}
def sender_flags(sender_email: str, company_domain: str) -> list[str]:
domain = sender_email.rsplit("@", 1)[-1].lower()
flags = []
if domain in FREE_MAIL:
flags.append("free mail address used for a company role")
elif domain != company_domain and not domain.endswith("." + company_domain):
flags.append("sender domain does not match the company domain")
return flags
print(sender_flags("[email protected]", "example.com"))
print(sender_flags("[email protected]", "example.com"))The first call returns one flag. The second returns an empty list.
Practical checks beyond the code
- Find the company's official domain yourself, from a search or from a source you already trust. Do not take it from the message you are checking.
- Hover over a link, or press and hold on a phone, to see the real destination before you open it.
- Be wary of shortened links. Expand them with a preview tool first, or ask for the full address.
- Look for look-alike characters:
rnform, a digit1or0for the lettersloro, and extra words such as-careersor-hr. - Type the company's address into your browser, or use its careers page, instead of clicking from the message.
- Compare the reply-to address with the sender address. A different reply-to is a warning sign.
Exercise
A message from "[email protected]" invites you to apply at https://example.com.hiring-portal.org/apply. The company's official domain is example.com. Does the link belong to the company, and how do you know?
Show answer
No. Read the host from right to left: the real domain is hiring-portal.org, and example.com is only a subdomain label placed in front of it. The sender address has the same problem. Find the company's real careers page yourself and do not use this link.
Exercise
A recruiter writes from [email protected], and your check finds no flags. Is the message safe to trust?
Show answer
Not necessarily. Sender addresses can be forged and real mailboxes can be compromised. Confirm the role through the company's official careers page or main phone number, which you found independently.