[imp] Dynamic mailer config based on FROM and TO addresses

Michael M Slusarz slusarz at horde.org
Tue Oct 29 05:39:59 UTC 2013


Robin has reported he has solved this in a different manner.  But for  
purpose of archive and education, I answer some of his questions below.

Quoting Robin Bankhead <horde at headbank.co.uk>:

> Quoting Michael M Slusarz <slusarz at horde.org>:
>
>> Again, there's no need to autoload.  Just because we have an  
>> autoloader doesn't mean that require can't be used.  In this  
>> particular case, it is a heck of a lot easier to simply require the  
>> file directly instead of trying to manipulate autoloading to work.
>>
> Point taken, but in this case where would I require it _from_?

A config file.  Or a hook.

>>>> To ensure a class is autoloadable, just directly include/require  
>>>> the file at some point prior to the class being accessed.
>>>>
>>> Isn't that just manual loading?
>>
>> Yes.  Again, there's nothing wrong with this.  Autoloading is  
>> important when you are distributing code.  When you are doing  
>> something locally, there's no problem to include a single file when  
>> necessary.
>>
> I guess I think like a distributor ;) I would be updating the horde  
> distro once in a while, and for those times it'd seem easier (to me)  
> if my own code additions were in the form of an "overlay" rather  
> than a patch-set. No distro files being touched seems better.

Most of my clients want all their configuration in a single place, if  
possible.  That was the suggestion for config/.  There's nothing  
special about the directory, other than the fact that is generally the  
only place an installation will ever need to change the local files.

michael

___________________________________
Michael Slusarz [slusarz at horde.org]



More information about the imp mailing list