Era Host hosting
EraHost – Free Domain, Cheap Hosting!
Client Area
Support 24/7
Menu

Exim Syntax Errors: Causes and Fixes

3 min read
03.02.2026

Exim is a popular mail transfer agent (MTA) used on Unix-like operating systems. Syntax errors in Exim typically occur when there are issues in its configuration file (exim.conf) or related files.

Exim Syntax Errors Fix Guide
Exim config — strict syntax, easy to break by hand-editing.

For other Exim / mail-stack debugging topics, see Fixing t_dkim_invalid (DKIM Signature Issue), Understanding dovecot_virtual_delivery, and "EHLO not accepted from server!" — Complete SMTP Error Fix.

Common Causes of Exim Syntax Errors

1. Misconfigured exim.conf File

Incorrect syntax in directives or parameters. Missing or misplaced sections.

2. Invalid ACL (Access Control List) Configuration

ACL rules in Exim are strict, and any misalignment can cause errors.

3. Incorrect Variable Usage

Using undefined or misconfigured variables.

4. Incorrect Formatting

Missing colons, semicolons, or indentation issues in configuration lines.

5. Updates or Incompatibility

Configuration files may break after an Exim version update.

6. Third-Party Modifications

Improper changes made by third-party plugins or scripts.

Linux VDS
High performance for your projects
  • Root access and flexible setup
  • Control panel
  • NVMe disks
  • DDR5
Linux VDS

How to Troubleshoot and Resolve Syntax Errors

Check Exim Configuration

Run Exim built-in syntax checker to identify errors:

exim -bV

Alternative: Check the configuration file explicitly:

exim -C /etc/exim.conf -bV

This will display the configuration details and pinpoint any errors.

Debugging Configuration

Run Exim in debug mode to identify syntax or operational issues:

exim -d -bh 127.0.0.1

This will output detailed information about Exim operations.

Review the Error Logs

Check the Exim error logs for details about syntax or runtime issues:

tail -f /var/log/exim_mainlog

Other log files to check:

  • /var/log/exim_rejectlog
  • /var/log/exim_paniclog

Correct Common Syntax Issues

Missing or Misplaced Colons

Exim directives often require a colon (:) to separate key-value pairs:

acl_check_data:

Ensure every directive has the correct syntax.

Indentation Issues

Some sections, especially ACLs, require proper indentation:

accept:

  condition = ${if eq{$sender_address}{valid@example.com}{yes}{no}}

Check for consistent spaces or tabs.

Misconfigured Variables

Ensure that all variables (e.g., $domain, $sender_address) are defined correctly. For example:

  • If using ${if}, confirm the conditional logic is valid.

ACL Errors

Errors in the ACL section are common. Ensure each block (e.g., accept, deny) is well-formed:

acl_check_rcpt:

  deny:

    condition = ${if eq{$sender_address}{blacklist@example.com}{yes}{no}}

  accept:

Validate Updates

After updating Exim, ensure compatibility:

  1. Verify the Exim version:
  2. exim -bV
  3. Check if the exim.conf file needs adjustments for the new version.

Revert to a Backup

If recent changes caused errors, revert to a working backup of exim.conf:

  1. Check for backups:
  2. ls /etc/exim.conf.bak*
  3. Restore a previous version:
  4. cp /etc/exim.conf.bak /etc/exim.conf

Regenerate the Configuration

If the file is too corrupted, regenerate it:

  1. Use a default configuration file provided by Exim:
  2. cp /usr/share/doc/exim/examples/exim.conf /etc/exim.conf
  3. Customize it to suit your server needs.

Test Changes

After making corrections, restart Exim and test:

sudo systemctl restart exim

Verify functionality by sending test emails and checking for errors.

Preventing Syntax Errors

  1. Validate Configuration Changes:
    • Always use exim -bV to test changes before applying them.
  2. Keep Backups:
    • Backup the exim.conf file before making changes.
  3. Document Modifications:
    • Maintain notes about changes for easier troubleshooting.
  4. Update Carefully:
    • Review the changelog of Exim updates to ensure configuration compatibility.
Frequently asked questions
`exim -bV` — prints version and config-parse status. If config has syntax errors, this is where they show. Always run before `systemctl reload exim` on production — a broken reload can leave Exim refusing connections. On cPanel: `/scripts/buildeximconf` regenerates from WHM templates, then `exim -bV` to confirm.
`/etc/exim.conf` is regenerated from `/etc/exim.conf.local` (cPanel custom additions) and the WHM template. WHM's UI doesn't always preserve manual edits to `exim.conf` directly. Always make changes in `/etc/exim.conf.local` and run `/scripts/buildeximconf`. To recover: `cp /etc/exim.conf.previous /etc/exim.conf` if you have a backup, then re-apply your changes via the proper local file.
Exim reports the line in the *generated* exim.conf, not exim.conf.local. On cPanel, line 547 in the error is in `/etc/exim.conf`, but you need to find the corresponding block in `exim.conf.local`. Use `grep -n 'your_acl_name'` to locate it. After fixing, regenerate and re-validate.
Look in `/var/log/exim_mainlog` for delivery attempts. If you see "<= sender" but no matching "=> recipient" or "Completed", the message accepted but routing failed and was discarded. Common cause: transport pointing to a non-existent destination, or ACL accept condition that drops with `discard`. Tail the log while sending a test message — Exim is verbose; the rejection reason is in there.
Related articles
Debugging session_start() Errors in PHP Using Error Logs
MySQL error in file: /engine/classes/mysql.php at line 61
/usr/sbin/sendmail -t — Sending Email with File Attachment (Script Example)