Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a WHM/cPanel box which is working fine with the configured domains for web and mail. I have also configured wildcard subdomains so that anything.mysite.com takes you to the same as mysite.com website which I then do slightly different things dependant on the subdomain etc.

I now need email to work similarly where I want me@anything.mysite.com to be caught by the exim server and handled locally the same as me@mysite.com is - what the aim here is that I have setup a script which catches all non-specified email and will do something with it depending on subdomain and user etc.

the problem here is that while the message is definitely going to the right server I am getting a 451 response back telling me there will be a delay. email to me@mysite.com works 100%.

I can't speficy all the subdomains as these are dynamic.

I have tried adding the *.mysite.com entry into /etc/localdomains as per someone else's suggestion and then the error becomes "Unroutable Address". I do have root access to the machine, but I am not very versed in exim configuration. Any help appreciated.

EDIT: I have had cPanel support on the case for me and while they were pretty helpful they have commented that the request is beyond the scope of their support. They have recommended adding a router entry to the exim config for the wildcard subdomains - I have tried this and while I did get it working for a subdomain i cannot figure out the wildcard part the equation. Any direction at all would be great.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

I have figured this out - for the benefit of others searching on the subject these are the bits I had to put in.

  • add the wildcard domains to the /etc/localdomains file
  • in exim.conf change the lsearch to wildlsearch where it references the above file.

Now it should be delivering mail - I added the following to pipe mail to a script for further manipulation

in routers

catch_subs: 
driver = accept 
domains = *.mysite.com 
transport = pipesubmail

in transport

pipesubmail: 
driver = pipe 
delivery_date_add 
envelope_to_add 
return_path_add 
group = mail 
user = me
command = /usr/bin/php /home/ /mailproc.php

works like a charm.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.