Use of .forward file

Post Reply
darden
Posts: 8
Joined: Wed May 05, 2021 3:38 pm

Hello there,

I'm checking the use of exim4 filters with the .forward file, under the user Maildir folder, p.e:

Code: Select all

/home/user/mail/domain.com/account/.forward
With no luck. The sample forward is:

Code: Select all

# Exim filter

if $header_From: contains "[email protected]"
then
  testprint "from=$header_From to=$h_To"
  save /home/user/mail/domain.com/account/.Test/
  finish
endif
The Test folder exists, and contain {new, cur, etc} subfolders.

Code: Select all

sudo -u user /usr/sbin/sendmail -bf /home/user/mail/domain.com/account/.forward -f [email protected] < test-email.eml 
Seems Ok, as it says test-email would be moved to the desired folder.

But when i try to check the filter with a mail, nothing happens. Am I missing something?

Edit: Debian 11 with Exim 4.94.2
Last edited by darden on Mon Sep 01, 2025 6:11 pm, edited 1 time in total.
darden
Posts: 8
Joined: Wed May 05, 2021 3:38 pm

Ok, a more in depth check about this.

Code: Select all

sudo exim -d -bt "[email protected]" 2>&1
Will throw the userforward router with:

Code: Select all

userforward router skipped: account is not a local user
I guess .forward filtering won't work with virtual accounts, just for system accounts.
merle4127
Posts: 1
Joined: Wed Sep 03, 2025 10:03 pm

You’re right—.forward only works for real system users, not virtual mail accounts. for virtual mailboxes, exim ignores it. the easy fix is to use dovecot sieve filters instead, since they work at the user level and can move mails into folders like test without touching exim configs.
Post Reply