Re: [exim] Wildcard subdomains and script

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Daniel Tiefnig
Ημερομηνία:  
Προς: exim-users
Αντικείμενο: Re: [exim] Wildcard subdomains and script
dpicon wrote:
> I want to process al emails sent to *@*.loprometo.com (that is any
> subdomain of example.com)


A router that simply matches your domain name(s) will do the trick. You
may use wildcarded patterns in domain lists[0] like in the following
example:

catch_subs:
driver = accept
domains = *.loprometo.com
transport = your_transport

Or if you want to store domain names in a separate file:

domains = /path/to/your/wildcarded_domain_list.txt

You will be able to use "*" as a wildcard in the file like in the
example above. You may also use a lookup to do (nearly) the same, like this:

domains = partial-lsearch;/path/to/your/wildcarded_domain_list.txt

This is not exactly the same, as it will match "loprometo.com" itself
too, while the above do really only match the subdomains.

Of course it would also be possible to store domain names in a MySQL DB
and use MySQL's substring features to do the right query.

> 1) send all email to a catchall account all@??? and have
> a cron job checking the account every minute
>
> 2) pipe? emails into a php script that does the job real time.


> What would be the configuration for 1) and for 2) ???


You'll just need two different transports. For 1) a simple appendfile[1]
transport will suffice, for 2) you may use a pipe[2] transport. Both are
documented quite well in the exim4 specification.[3]

Also have a look at the exim4 FAQ[4] (i.e. chapters 4 and 6) for further
discussion on that topic.

lg,
daniel

[0]
http://exim.org/exim-html-4.62/doc/html/spec_html/ch10.html#SECTdomainlist
[1] http://exim.org/exim-html-4.62/doc/html/spec_html/ch26.html
[2] http://exim.org/exim-html-4.62/doc/html/spec_html/ch29.html
[3] http://exim.org/exim-html-4.62/doc/html/spec_html/index.html
[4] http://exim.org/exim-html-4.62/doc/html/FAQ-html/FAQ.html