Skip to content
Knowledge base Updated: February 5, 2026

Email Security - How to Protect Your Company from Ransomware and Phishing

90% of ransomware attacks start with an email. Learn practical methods to protect business email: SPF, DKIM, DMARC, attachment sandboxing, SEG.

Why is Email the Main Gateway for Ransomware?

The vast majority of ransomware attacks start with a malicious email. Phishing remains the most effective method for delivering ransomware to organizations because:

  • Email reaches employees with access to critical data directly
  • Users are accustomed to opening attachments and clicking links
  • Even aware employees make mistakes under time pressure
  • Attacks are increasingly sophisticated (spear phishing, BEC)

The dominant ransomware attack vector is email (phishing, attachments); less common ones are vulnerability exploitation (RDP, VPN), malvertising and drive-by downloads, as well as USB devices and insider threats.

📚 Read the complete guide: Ransomware: Ransomware - what it is, how to protect yourself, what to do after an attack

Anatomy of Email-Based Ransomware Attack

Typical attack scenario:

┌─────────────────────────────────────────────────────────────────┐
│ 1. RECON: Attacker gathers company info (LinkedIn, web)         │
└─────────────────────────────────────────────────────────────────┘
                              ↓
┌─────────────────────────────────────────────────────────────────┐
│ 2. WEAPONIZATION: Prepares email with attachment/link           │
│    - Fake invoice (invoice_2026.xlsm)                           │
│    - Document with macro                                        │
│    - Link to fake login page                                    │
└─────────────────────────────────────────────────────────────────┘
                              ↓
┌─────────────────────────────────────────────────────────────────┐
│ 3. DELIVERY: Sends email impersonating trusted sender           │
│    - Vendor domain spoofing                                     │
│    - Compromised trusted partner account                        │
└─────────────────────────────────────────────────────────────────┘
                              ↓
┌─────────────────────────────────────────────────────────────────┐
│ 4. EXPLOITATION: User opens attachment/clicks link              │
│    - Macro downloads dropper                                    │
│    - Credential harvesting                                      │
└─────────────────────────────────────────────────────────────────┘
                              ↓
┌─────────────────────────────────────────────────────────────────┐
│ 5. INSTALLATION: Ransomware installs in system                  │
│    - Persistence (autostart, scheduled tasks)                   │
│    - Lateral movement (PsExec, WMI, SMB)                        │
└─────────────────────────────────────────────────────────────────┘
                              ↓
┌─────────────────────────────────────────────────────────────────┐
│ 6. ENCRYPTION: File encryption, ransom demand                   │
└─────────────────────────────────────────────────────────────────┘

Layered Email Protection (Defense in Depth)

Effective protection requires multiple layers:

┌────────────────────────────────────────────────────────────┐
│                    EMAIL PROTECTION LAYERS                  │
├────────────────────────────────────────────────────────────┤
│ 1. SENDER AUTHENTICATION                                   │
│    • SPF - who can send on behalf of domain               │
│    • DKIM - cryptographic signature                       │
│    • DMARC - policy and reporting                         │
├────────────────────────────────────────────────────────────┤
│ 2. SECURE EMAIL GATEWAY (SEG)                              │
│    • Anti-spam, anti-malware                              │
│    • Sender/IP reputation                                 │
│    • Heuristic analysis                                   │
├────────────────────────────────────────────────────────────┤
│ 3. ATTACHMENT SANDBOXING                                   │
│    • Detonation in isolated environment                   │
│    • Behavioral analysis                                  │
│    • Zero-day protection                                  │
├────────────────────────────────────────────────────────────┤
│ 4. URL PROTECTION                                          │
│    • Time-of-click analysis                               │
│    • URL rewriting                                        │
│    • Malicious site blocking                              │
├────────────────────────────────────────────────────────────┤
│ 5. USER AWARENESS                                          │
│    • Phishing training                                    │
│    • Attack simulations                                   │
│    • Suspicious email reporting                           │
└────────────────────────────────────────────────────────────┘

SPF, DKIM, DMARC - Security Foundation

SPF (Sender Policy Framework)

SPF defines which servers can send email on behalf of your domain.

How it works:

  1. You publish a DNS TXT record with list of authorized servers
  2. Receiving server checks if sender is on the list
  3. If not - email may be rejected or marked as spam

Example SPF record:

yourcompany.com TXT "v=spf1 include:_spf.google.com include:sendgrid.net ip4:1.2.3.4 -all"

Explanation:

  • v=spf1 - SPF version
  • include:_spf.google.com - authorize Google Workspace servers
  • include:sendgrid.net - authorize SendGrid
  • ip4:1.2.3.4 - authorize specific IP
  • -all - reject everything else (hard fail)

SPF policies:

PolicyMeaningRecommendation
+allAccept everythingNEVER use
~allSoft fail (mark as suspicious)Testing phase
-allHard fail (reject)Production
?allNeutralDoesn’t protect

DKIM (DomainKeys Identified Mail)

DKIM adds a digital signature to every sent email.

How it works:

  1. Sending server signs email with private key
  2. Public key is published in DNS
  3. Receiving server verifies signature

Example DKIM record:

selector1._domainkey.yourcompany.com TXT "v=DKIM1; k=rsa; p=MIIBIjANBgkqh..."

Benefits:

  • Verification that email wasn’t modified in transit
  • Confirmation of sender domain identity
  • Required by DMARC

DMARC (Domain-based Message Authentication, Reporting & Conformance)

DMARC combines SPF and DKIM into coherent policy with reporting.

Example DMARC record:

_dmarc.yourcompany.com TXT "v=DMARC1; p=reject; rua=mailto:dmarc@yourcompany.com; pct=100"

Explanation:

  • v=DMARC1 - version
  • p=reject - policy (reject emails failing SPF/DKIM)
  • rua=mailto:... - address for aggregate reports
  • pct=100 - percentage of emails covered by policy

DMARC policies:

PolicyActionWhen to use
p=noneReporting onlyInitial phase (monitoring)
p=quarantineMark as spamTransition phase
p=rejectRejectFull protection

DMARC implementation timeline:

WeekAction
1-2Implement SPF for all email sources
3-4Implement DKIM
5-6DMARC p=none + report analysis
7-8Fix sources failing SPF/DKIM
9-10DMARC p=quarantine
11-12DMARC p=reject

Secure Email Gateway (SEG)

SEG is a dedicated solution filtering email before reaching users.

Key SEG Features

FeatureDescriptionEffectiveness
Anti-spamFiltering unwanted mailVery high
Anti-malwareKnown threat signaturesHigh
SandboxingAttachment analysis in isolationDetects zero-day
URL filteringMalicious link blockingReal-time
Impersonation protectionSpoofing detectionProtects against BEC
Data Loss PreventionData leak blockingCompliance
SolutionDeploymentKey Features
Microsoft Defender for Office 365CloudM365 integration, ATP
ProofpointCloud/On-premSandbox leader
MimecastCloudStrong BEC protection
Fortinet FortiMailOn-prem/CloudFortiGate integration

Configuration Best Practices

1. Enable blocking of dangerous file types:

Block: .exe, .scr, .bat, .cmd, .ps1, .vbs, .js, .jar, .msi
Block with password: .zip, .rar, .7z (if containing above)

2. Enable blocking of macros in Office documents:

Block: .xlsm, .docm, .pptm (or pass through sandbox)
Alternatively: convert to PDF

3. Enable sandboxing for all attachments:

Sandbox: all files except whitelist
Timeout: 60-120 seconds
Action on detection: quarantine + alert

Attachment Sandboxing

Sandboxing is a technique of running attachments in isolated environment to detect malicious behavior.

How Sandbox Works

┌─────────────────────────────────────────────────────────────┐
│                    SANDBOX WORKFLOW                          │
├─────────────────────────────────────────────────────────────┤
│ 1. Email with attachment arrives at gateway                 │
│ 2. Attachment sent to sandbox                               │
│ 3. Detonation in isolated virtual machine                   │
│    - File execution                                         │
│    - Monitoring: processes, network, registry, filesystem   │
│ 4. Behavioral analysis (does it try to download malware,    │
│    encrypt files, connect to C2)                            │
│ 5. Verdict: clean / malicious                               │
│ 6. If malicious → quarantine + alert                        │
│ 7. If clean → deliver to user                               │
└─────────────────────────────────────────────────────────────┘

Evasion Techniques and Countermeasures

Attackers try to bypass sandbox:

Evasion TechniqueDescriptionCountermeasure
Time delayMalware waits before activationExtended analysis (5+ min)
VM detectionChecks if in VMBare-metal sandbox
User interactionRequires clickClick simulation
Environment checkChecks computer nameRealistic environment
Encrypted payloadPassword in email bodyML analysis, OCR

URL Protection

Links in emails are the second main attack vector.

URL Attack Techniques

  1. Phishing page - fake login page
  2. Drive-by download - automatic malware download
  3. Redirect chains - chain of redirects hiding destination
  4. URL shorteners - bit.ly, tinyurl hiding real URL
  5. Homoglyph attacks - microśoft.com instead of microsoft.com
Original URL: https://malicious.com/invoice
                              ↓
Rewritten URL: https://urldefense.proofpoint.com/v2/url?u=https%3A%2F%2Fmalicious.com...
                              ↓
On click: real-time scan → if malicious → block

URL Protection Configuration

✓ Enable URL rewriting for all emails
✓ Enable time-of-click analysis
✓ Block known-bad domains
✓ Display warning on redirect to external sites
✓ Block URL shorteners or expand before analysis
✓ Enable typosquatting detection

Security Awareness Training

Technology isn’t enough - employees must be aware of threats.

Training Program

FrequencyFormatContent
OnboardingTrainingPhishing basics, email security
MonthlyMicro-learning5-min modules, quizzes
QuarterlyPhishing simulationTest + feedback
AnnuallyFull trainingReview + new threats

Awareness Metrics

MetricTargetHow to Measure
Click rate (simulation)< 5%Phishing campaigns
Reporting rate> 20%Reports to SOC
Training completion> 95%LMS tracking
Time to report< 5 minFrom opening to reporting

Phishing Button

Implement “Report Phishing” button in email client:

Benefits:

  • Easy reporting of suspicious emails
  • Automatic analysis in SOC
  • Building security culture
  • Crowd-sourced threat intel

Email Security Implementation Checklist

Phase 1: Fundamentals (Week 1-4)

□ Audit current email configuration
□ Implement SPF for all sources
□ Implement DKIM
□ Implement DMARC p=none + monitoring
□ Inventory all applications sending email

Phase 2: SEG and Sandboxing (Week 5-8)

□ Select and deploy SEG
□ Configure dangerous file type blocking
□ Enable attachment sandboxing
□ Configure URL protection
□ Integrate with SIEM

Phase 3: Hardening (Week 9-12)

□ DMARC p=quarantine → p=reject
□ Fine-tune SEG rules (reduce false positives)
□ Implement impersonation protection
□ Configure DLP
□ Email security penetration testing

Phase 4: Awareness (Ongoing)

□ Implement training program
□ First phishing simulation campaign
□ Implement phishing button
□ Analyze and iterate based on results

Effectiveness Metrics

MetricHow to MeasureTarget
DMARC complianceDMARC reports> 99%
Malware blockedSEG logsTrack trend
Phishing blockedSEG logsTrack trend
User click rateSimulations< 5%
Time to blockSOC metrics< 15 min
False positive rateUser reports< 0.1%

FAQ

Isn’t Microsoft 365 / Google Workspace enough?

Built-in protections are good but not the best. Consider additional SEG if:

  • You’re a spear phishing / APT target
  • You need advanced sandboxing
  • You have compliance requirements (e.g., DORA)

How much does email security implementation cost?

ComponentCost (estimated)
SPF/DKIM/DMARCFree (configuration)
Microsoft Defender for O365 P2~$5/user/month
Enterprise SEG$3-15/user/month
Awareness platform$1-5/user/month

How quickly do you see results?

  • SPF/DKIM/DMARC: immediately (spoofing reduction)
  • SEG: immediately (known threat blocking)
  • Sandboxing: immediately (zero-day protection)
  • Awareness: 3-6 months (behavior change)

Summary

  • The vast majority of ransomware starts with email - it’s the main attack vector
  • SPF + DKIM + DMARC is the foundation - implement with p=reject policy
  • SEG with sandboxing detects zero-day - essential for every company
  • URL protection blocks phishing - enable time-of-click analysis
  • Awareness changes behaviors - quarterly phishing simulations
  • Layered protection (Defense in Depth) - one layer isn’t enough

Want to check your email security? Order email security audit or phishing simulation. Contact us.

How do you protect email in Microsoft 365 and Google Workspace as part of the workspace?

Email is no longer a separate system. In Microsoft 365 and Google Workspace the mailbox is tied to cloud storage, chat, the calendar and the browser, and an attachment is increasingly replaced by a link to a shared file. The same route that phishing comes in by is also used to move data out — by mistake or on purpose. That is why email protection is worth planning together with the rest of the workspace (workspace security), not as a gateway in front of the mailbox alone.

In practice it comes down to three questions. First, what happens to a message before it reaches the user: filtering, attachment analysis in a sandbox, link rewriting. Second, what can be done with a message that has already been delivered and only later turned out to be malicious — can it be pulled from all mailboxes without involving users. Third, what leaves the organisation: sensitive data in attachments and in the body of outgoing messages.

The last question is often overlooked. According to the 2025 Data Security Report, prepared by Fortinet and Cybersecurity Insiders from a survey of 883 IT and security specialists, 46% of organisations use email DLP, i.e. fewer than half (figures as declared by respondents).

FortiMail is one example of an implementation. It can work as an email gateway (with an MX record change) or in API mode, which complements the built-in protections of Microsoft 365 and Google Workspace without changing MX: it scans mailboxes in real time and on a schedule, and pulls a message identified as malicious after delivery out of the mailboxes. On top of that come attachment analysis in a sandbox, link protection at the time of click, DLP and email encryption. In its FortiMail Workspace Security offering, Fortinet combines email protection with protection of the browser and collaboration tools such as Teams, Slack or OneDrive. Details on the FortiMail page.

Technology is half of the protection — the other half is people who recognise a message sent from a contractor’s compromised mailbox or an unusual request to change the bank account for a transfer. We test this as part of our phishing simulations.


Learn key terms related to this article in our cybersecurity glossary:

  • Phishing — Phishing is a type of social engineering attack that aims to deceive the victim…
  • Ransomware — Ransomware is a type of malicious software (malware) that blocks access to a…
  • Spear Phishing — Spear phishing is an advanced form of phishing in which attackers target…
  • Cybersecurity — Cybersecurity is a collection of techniques, processes, and practices used to…
  • Email Spoofing — Email spoofing is a cyberattack technique involving falsifying the sender’s…

Learn More

Explore related articles in our knowledge base:


Explore Our Services

Need cybersecurity support? Check out:

Explore Our Products

Solutions mentioned in this article that can help protect your organization:


See also:

Share:

Talk to an expert

Have questions about this topic? Get in touch with our specialist.

Sales Representative
Grzegorz Gnych

Grzegorz Gnych

Sales Representative

Response within 24 hours
Free consultation
Individual approach

Providing your phone number will speed up contact.

Want to Reduce IT Risk and Costs?

Book a free consultation - we respond within 24h

Response in 24h Free quote No obligations