Cold Email Infrastructure

Using Azure Virtual Machines for Cold Email Infrastructure: A Step-by-Step Guide

Cold email campaigns can be a powerful tool for reaching potential customers, but setting up the infrastructure to handle these campaigns requires careful planning. With Azure Virtual Machines (VMs) and SendGrid (now Twilio), you can create a robust, scalable, and compliant cold email solution. This article will guide you through setting up your email infrastructure and ensure your campaigns align with CAN-SPAM and GDPR regulations.


Why Use Azure for Cold Email?

Azure offers a reliable, scalable platform with tools like Virtual Machines and SendGrid to power your cold email campaigns. Here’s why Azure is ideal:

  • Scalability: Start small and scale as needed.
  • Flexibility: Customize VMs for your specific requirements.
  • Integration: Azure services like Logic Apps and Monitor ensure smooth operations.
  • Compliance: Tools and configurations to meet legal requirements.

Step 1: Setting Up Azure Virtual Machines

  1. Create a Resource Group
    • Log in to the Azure Portal.
    • Navigate to Resource Groups and click Create. Name your group (e.g., ColdEmailInfra) and choose a region.
  2. Deploy a Virtual Machine
    • Go to Create a Resource > Compute > Virtual Machine.
    • Configure:
      • OS: Ubuntu Server (recommended for email server compatibility).
      • VM Size: Start with a B2s instance (2 vCPUs, 4GB RAM).
      • Networking: Use a static public IP and ensure SMTP ports (25, 587) are open.
  3. Set Up Storage
    • Add an Azure Storage Account to store logs, email templates, and campaign data.
  4. Secure the VM
    • Configure Azure Network Security Groups to allow only essential traffic.
    • Use SSH keys for secure access to the VM.

Step 2: Integrating SendGrid

  1. Activate SendGrid in Azure
    • Go to Create a Resource > SendGrid.
    • Choose a plan based on your email volume (e.g., Basic for small campaigns).
  2. Configure the API Key
    • After setting up SendGrid, generate an API key from the SendGrid dashboard.
    • Save the API key securely—it will be used for email-sending software integration.
  3. Connect SendGrid to Your Domain
    • Add DNS records for SPF, DKIM, and DMARC in your domain registrar:
      • SPF: v=spf1 include:sendgrid.net -all
      • DKIM: Configure via SendGrid settings.
      • DMARC: v=DMARC1; p=none; rua=mailto:your-email@example.com.
  4. Test the Configuration
    • Use SendGrid’s “Test Your Integration” tool to verify your email-sending setup.

Step 3: Setting Up Email Aliases for SDRs

  1. Create Dedicated Domains
    • Use professional domains like yourteam-outreach.com or subdomains (e.g., mail.yourdomain.com) for SDR emails.
  2. Set Up Email Aliases
    • Create unique aliases for each SDR (e.g., john.doe@mail.yourdomain.com).
    • Use these aliases with SendGrid to track individual performance.
  3. Personalize and Automate
    • Configure personalization in SendGrid to dynamically insert recipient names, company details, etc.
    • Use tools like Zapier or Azure Logic Apps to automate campaign workflows.
  4. Warm-Up New Accounts
    • Gradually increase the number of emails sent daily to build a positive sender reputation.

Step 4: Monitoring and Scaling

  1. Use Azure Monitor
    • Set up alerts for issues like high bounce rates or failed email sends.
    • Integrate with Azure Log Analytics for advanced insights.
  2. Scale as Needed
    • Add more VMs or upgrade SendGrid plans to handle higher email volumes.
    • Use Azure’s autoscaling feature to adjust resources dynamically.

Compliance with CAN-SPAM and GDPR

CAN-SPAM Compliance

  1. Include an Opt-Out Option
    • Every email must have a clear, functional opt-out link.
    • Honor opt-out requests within 10 business days.
  2. Provide a Physical Address
    • Include your company’s mailing address in the email footer.
  3. Avoid Misleading Subject Lines
    • Your subject line should accurately represent the email content.
  4. Use Real Information
    • Emails must come from a legitimate domain and include valid sender information.

GDPR Compliance

  1. Obtain Consent (If Required)
    • Ensure recipients in the EU have explicitly consented to receive emails.
    • Document how and when consent was obtained.
  2. Provide a Privacy Notice
    • Link to a privacy policy explaining how you handle recipient data.
  3. Enable Data Access and Deletion
    • Allow recipients to request access to their data or have it deleted.
  4. Secure Recipient Data
    • Store contact details securely in Azure Storage or a database with encryption.

Benefits of Using Azure and SendGrid

  • High Deliverability: SendGrid ensures your emails land in inboxes, not spam folders.
  • Scalable Infrastructure: Azure lets you scale resources on demand.
  • Regulatory Compliance: Built-in tools for DNS records, monitoring, and data security help you stay compliant.

Infrastructure Setup on Azure

  1. Create a Resource Group
    • Log into your Azure account.
    • Navigate to the Azure Portal and create a new resource group to organize all resources related to cold email infrastructure.
  2. Deploy Virtual Machines (VMs)
    • Go to “Create a Resource” and select Virtual Machine.
    • Configure:
      • Operating System: Use Ubuntu Server for cost efficiency and compatibility with email server software.
      • Size: Start with a low-tier VM (e.g., B2s: 2 vCPUs, 4GB RAM) for ~$30/month.
      • Networking: Ensure the VM has a static public IP address.
  3. Configure VM Security
    • Open necessary ports for email communication:
      • SMTP: Port 25, 587 (ensure Port 25 is enabled; Azure might require a support ticket for this).
      • IMAP/POP3: Ports 143, 993, 110, 995.
    • Set up a firewall to prevent unauthorized access to the VM.
  4. Set Up Storage
    • Attach a storage disk for email logs and tracking data.
    • Use Azure Blob Storage for cost-efficient storage of large files (e.g., email templates).

2. Email Server Configuration

  1. Install Email Server Software
    • SSH into your VM and install email server software like Postfix, Exim, or a full-featured platform like Postal.
    • Follow the software-specific setup guide for installation and initial configuration.
  2. Configure SMTP
    • Set up the VM as an SMTP relay.
    • Use DKIM, SPF, and DMARC (details below) for email authentication to prevent emails from being flagged as spam.
  3. IP Rotation (Optional)
    • If needed, assign multiple IP addresses to the VM.
    • Use tools like Postfix’s transport mapping to assign specific IPs to email-sending tasks.
  4. Monitoring
    • Install monitoring tools (e.g., MailScanner, Azure Monitor) to track email bounces, spam flags, and deliverability metrics. MailScanner is completely free.

3. Domain Management

  1. Purchase Domains
    • Buy domains/subdomains for SDR emails (e.g., sales-team-xyz.com, consultants-abc.com).
    • Keep domains short, professional, and aligned with your primary business domain.
  2. Configure DNS Records
    • In Azure DNS or your registrar, set the following records:
      • SPF: v=spf1 ip4:<VM_IP_ADDRESS> include:spf.protection.outlook.com -all
      • DKIM: Generate DKIM keys using your email software, then add the DNS TXT record.
      • DMARC: v=DMARC1; p=none; rua=mailto:dmarc-reports@yourdomain.com
  3. Test Configuration
    • Use tools like MXToolBox to verify DNS and email configurations.

4. Email Aliasing for SDRs

  1. Create Mailboxes
    • Use an email provider like Microsoft 365 or Google Workspace to create user accounts for SDRs.
    • Alternatively, set up aliases on your mail server (e.g., sdr1@domain.com, sdr2@domain.com).
  2. Automate Aliases
    • Use automation scripts to create and manage email aliases dynamically.
    • Example (Postfix on Ubuntu):
      • Open /etc/postfix/virtual and map SDR emails to real accounts: sdr1@domain.com realuser1@domain.com sdr2@domain.com realuser2@domain.com
      • Update and reload Postfix: postmap /etc/postfix/virtual service postfix reload
  3. Personalize SDR Accounts
    • Add names and signatures to email aliases for personalization.
    • Use tools like lemlist or Mailshake to manage the personalization at scale.
  4. Warm-Up New Domains
    • Gradually increase email volume (start with 20/day/account and increase by 10 daily) to build sender reputation.

5. Automation and Campaign Management

  1. Integrate Automation Tools
    • Use software like SendGrid or Postmark for transactional emails.
    • For cold campaigns, tools like LinkedHelper, Reply.io, or Woodpecker can automate outreach.
  2. Track Responses
    • Use CRM integration (e.g., Salesforce, HubSpot) to track responses and leads.
    • Store logs in Azure Blob Storage or a database like Azure SQL.

6. Compliance and Risk Mitigation

  • Compliance: Always include opt-out links and respect email marketing laws (e.g., CAN-SPAM, GDPR).
  • Monitoring: Regularly check domain and IP reputation using tools like Google Postmaster Tools or Talos Intelligence.
Scroll to Top