Re: [exim] Help needed with router configuration [SOLVED]

Top Page

Reply to this message
Author: Mike Clarke
To: exim-users
Subject: Re: [exim] Help needed with router configuration [SOLVED]
On Wednesday 26 January 2011, Drav Sloan wrote:

> Mike Clarke wrote:

> > In order to reduce spam when purchasing
> > online I like to use unique email names so if I'm buying from
> > somesupplier.example I'll give my email name as mike-somesupplier@
> > so I know who to blame and blacklist if I get spam to that name. To
> > avoid having to keep reconfiguring my mail system every time I use
> > a new address I wanted something which would route all these
> > throwaway names to the appropriate user's mailbox and found that
> > exim was very good for this with it's ability to handle wildcards
> > in alias names.
> I've done this without the use of fetchmail:

It should work equally well with fetchmail which can be made to talk
SMTP to Exim in the same way a remote mail server would.
> suffixed_user:
> driver = redirect
> check_local_user
> file = $home/.suffixrc
> local_part_suffix = -*
> allow_filter
> allow_fail
> no_verify
> file_transport = address_file
> directory_transport = dravs_suffix_maildir
> The use then has to create a .suffixrc in their home dir to activate
> this address. Mine contains:
> --- BEGIN ---
> # Exim Filter
> if $local_part_suffix contains "-" then
>     # note that the save path here is for maildir, you will probably
>     # want to remove the trailing / to make it an mbox delivery. The 
>     # lc/substr  stuff lowercases the folder name and takes the suffix 
>     # part of the address.
>     save "$home/.folders/${lc:${substr_1:$local_part_suffix}}/"
> endif

> # paranoia
> if not delivered then
>     save $home/.mail/anomalous/
> endif
> --- END ---

> This means I can create any email I want just by adding a hypen and a
> new mailbox name for the new address, and the address will then
> deliver to that mailbox.

An interesting method but I think my approach is a bit simpler:

driver = redirect
data = ${lookup{$local_part}wildlsearch{/etc/aliases}}
user = mailnull
group = mail
file_transport = address_file
pipe_transport = address_pipe

I.E. just change lsearch to wildsearch in the default configuration for
the system_aliases router.

Then to allow user mike to use wildcard email names just
edit /etc/aliases with a line like this

^mike-.*: mike

... without the need for the user to have to set up any files.

Mike Clarke