Skip to content

vfilter.8

Manvendra Bhangui edited this page Feb 25, 2024 · 4 revisions

NAME

vfilter - Filter capable MDA for IndiMail

SYNOPSYS

vfilter "" default_account

DESCRIPTION

vfilter is a MDA which implements IndiMail's powerful vfilter mechanism. These filters can be set up by the vcfilter(1) program. Filters are run one by one and action taken the moment the first match is found. Once a match is found, vfilter ignores other filters (which could also result in a match). Hence care should be taken by the user to have filters in the proper order in case where multiple matches are possible.

vfilter can be enabled by replacing vdelivermail(8) in the .qmail-default file. For optimization, vfilter skips filters if the file .vfilter is not found in the user's Maildir patch. This file is created by vcfilter when the first filter is added and removed when the last filter is deleted. If in case, While processing, any fatal error occurs, vfilter passes the mail to vdelivermail directly (or any other mail delivery agent defined by the MDA environment variable) without any further processing. In case of temporary errors, the mail remains in the queue and retried later and hence again passes through the filter. vfilter can perform various actions on a filter match. These actions are

Delivering to any one specific mailbox (Maildir format – if this is different from Inbox, the environment variable MAILDIRFOLDER is set, causing vdelivermail to deliver mail to a different folder).

[step]
Bouncing the mail back to sender

[step]
Forwarding the mail to another address

[step]
Running the email through another program

On a successful match, the mail is removed from the queue. If mail passes through the filter without any match, mail remains in the queue and is handed over to vdelivermail (or the mda defined by the MDA environment variable) for further processing.

These actions make vfilter a powerful mechanism to organize your emails, spam control, automation based on email, taking specific action on receipt of specific emails, etc. In fact a complex email based system can be developed around vfilter mechanism. However, due to complexity and current limitations, forwarding are not checked for errors.

vfilter can also be configured to run global filters. There are two global filters

Pre Filter
This can be set by setting filters for the special user prefilt@virtual_domain by using the program vcfilter. All filters defined for this user will be applied for all users before applying the user defined filters. Pre-filters can be turned off for specific users by having a file named .noglobal in the user's Maildir.

Post Filter
This can be set by setting filters for the special user postfilt@virtual domain using the vfilter program. These filters will be applied for all users after applying the user defined filters. Post-filters can be turned off for specific users by having a file named .nopostfilt in the user's Maildir.

vfilter can also be run in test mode by specifying emailid of the user on the command line. The only other arguments permitted in test mode is the -v option. If the -v option is specified, all actions performed are shown on screen. This option can be used to test so that important mails do not get lost due to misconfiguration of filters.

vfilter uses a sophisticated mechanism called Email Processing System (EPS) to parse the email (headers, mime and body). EPS is a set of API calls which allow systems to understand the contents of an email message. The fact that email messages are rather complex, means that EPS cannot jump around the email randomly like a monkey and be expected to understand its content. vfilter runs the email through EPS line by line to understand specific things like MIME attachments.

OPTIONS

[""]
Blank double quote for backward compatibility (with vdelivermail)

[default account for delivery]
If the email does match any .qmail-user file and also does not match any virtual domain user, this is the default delivery instructions. There are three values this may contain.

Full path to a indimail user directory

[step]
email address to forward email too

[step]
the string bounce-no-mailbox to bounce the email back to the sender.

RETURN VALUE

  • 0 if all steps were successful.
  • 100 for permanent errors. i.e. if user is over quota or bounce-no-mailbox is set and no matching user is found.
  • 111 for all temporary error occurring during mail delivery.

SEE ALSO

vdelivermail(8), vcfilter(1),

Clone this wiki locally