Hourly IP Rotation With Cron Jobs On A Sending Server
When a single IP handles thousands of cold messages per day, mailbox providers quickly notice the pattern and start parking everything in spam. Rotating through a small pool of addresses spreads the load and keeps each IP's reputation from collapsing under the weight of high-volume outreach. Senders in Australia face an extra wrinkle because local recipients on Telstra and Optus mail servers tend to weigh .au sender reputations more heavily, and the ACMA's anti-spam rules mean a single blacklist hit can derail an entire campaign.
Cron is the simplest tool for the job. It runs quietly in the background, fires a script at the interval you choose, and leaves a paper trail in the system log. With a few lines of shell and a properly configured mail transfer agent, swapping the outbound address every sixty minutes becomes a hands-off routine rather than a manual chore.
Why IP Rotation Matters For Deliverability
Mailbox providers build a profile on every IP they observe. Volume, complaint rates, bounce ratios, and the diversity of recipient domains all feed into that profile. A sudden spike on one address looks abnormal even if the underlying list is clean, so splitting traffic across several IPs gives each one a calmer footprint. Warm-up plays into the same logic: you raise the daily ceiling on each IP gradually, and rotation lets the pool share the duty.
There is a secondary benefit around throttling. Many corporate gateways and Aussie SMB filters cap how many connections they will accept from a single source within a short window. Cycling through addresses gives the receiving end the appearance of multiple senders, which keeps queue build-up low. Operators who work with amateur radio timing understand that precise intervals can be just as important as the payload itself, and the same idea carries over to outbound mail.
Picking A Rotation Method That Suits Your Stack
The cheapest path is a shell script that updates Postfix or Exim's transport map and reloads the service. PowerMTA users often rely on a virtual MTA pool with a small management script that rewrites the active virtual-mta.txt. Each approach has trade-offs, and the right one depends on volume and tolerance for downtime during the swap.
A lighter option uses a round-robin DNS record pointing to several IPs, but that approach does not let you throttle per address or isolate a burned IP, so most serious senders move past it quickly. Whatever you choose, keep the rotation logic in a single file so the cron entry never has to make a decision on its own.
Prep Work Before The First Swap
Before the scheduler starts rotating, every address in the pool needs clean reverse DNS, an SPF record that lists it, and a matching DKIM key. Skipping any of these guarantees a softfail on the first batch out of a fresh IP. It is also worth confirming that each IP has its own warm-up history rather than being a brand-new lease that has never sent a legitimate message.
On the local side, the script should live somewhere stable such as /usr/local/sbin/rotate_ip.sh, with permissions that prevent the mail user from editing it. A simple lock file prevents overlapping runs if the previous hour's job is still finishing.
- Confirm PTR, SPF, DKIM, and DMARC for every IP in the pool.
- Pre-warm each address with low-volume transactional traffic for at least two weeks.
- Store the active IP reference in a single file that the MTA reads on reload.
- Place the rotation script outside the web root with root-only write access.
- Add a lock file so two cron cycles never run at the same time.
Writing The Crontab Entry
Open the root crontab with crontab -e and add a line that fires the script at the top of every hour. The exact entry reads 0 * * * * /usr/local/sbin/rotate_ip.sh >> /var/log/ip_rotation.log 2>&1, which routes any output to a log file for later review. Some operators prefer 5 * * * * so the swap lands a few minutes after the hour, lining up with quieter periods on Australian Eastern Standard Time when inbox activity dips.
If the rotation is part of a wider automation pipeline, chain the swap to a feed refresh or a bounce purge using the && operator. Keep the script idempotent: running it twice in a row should not break anything, and running it during a queued send should not corrupt the active connection.
Watching The Logs And Handling Failures
A rotation script that fails silently is worse than no rotation at all, because the rest of the system keeps sending from a stale address. Tail the log file with tail -f /var/log/ip_rotation.log after each hourly change and look for the expected banner line, which usually shows the timestamp and the IP that was just activated. Pair the log with a simple health check that pings a known address from the new IP, confirming SMTP connectivity before the queue drains.
Alerts matter just as much as visibility. A short script that posts to a chat channel or sends a push notification when the exit code is non-zero gives you a heads-up before a recipient block escalates. Treat any repeated failure as a sign that the upstream IP has been burned and needs to be pulled from the pool until its reputation recovers.
- Tail the rotation log right after each scheduled swap.
- Capture exit codes and forward failures to a chat channel.
- Test SMTP connectivity from the freshly activated IP.
- Compare sending rate per IP against historical baselines.
- Remove any address that scores above the local complaint threshold.
Australian Hosting Realities And Final Tweaks
Local VPS providers in Sydney and Melbourne data centres give a latency edge when targeting .au recipients, but the per-IP cost can climb fast. A common compromise is a hybrid pool that mixes a couple of Australian addresses with cheaper offshore IPs for lower-priority campaigns. Whatever the mix, make sure the cron schedule does not align with peak business hours in Sydney, Melbourne, or Brisbane, where recipient servers tend to throttle aggressively between 9 am and 11 am local time.
Finally, respect the local laws. The Spam Act in Australia requires consent before commercial email, and rotating IPs to dodge blocks is not a substitute for clean lists. Treat the scheduled swap as a tool that gives you smoother delivery rather than a workaround that hides bad practices.
BlackHatProTools