On 14/1/2006, "emily" <[EMAIL PROTECTED]> wrote:
>From: "Dean Holden" <[EMAIL PROTECTED]>
>>On 1/13/2006, "emily" <[EMAIL PROTECTED]> wrote:
>>>In the case of multiple smtp servers, how could i determine which smtp 
>>>server to use in sending based on the host selected? Means if you login 
>>>in domain1, u send email using smtp1.
>>
>>I think this is what you are looking for...
>>
>>Look in conf/login.php for this section:
>>
>>/******************* VDOMAIN_DETECT ************************ =09When
>>[...]
>
>That's not right. I have configured that. That's for incoming mail. I can
>configure different host to login but all of them are using the same smtp to
>send. 
>
>I would like to know if we can choose sending can be configured based on the
>host they logged in.

It's not a feature of the installed code, but it's quite easy to add
that functionality. The only trouble is, when you install a new version
of IlohaMail, you will need to modify the code again.

You didn't say whether you installed 0.8.14-rc3 or 0.9.x. Thankfully, it
doesn't matter for this hack. :-)

Step 1: edit conf/conf.php. Where it says:

$SMTP_SERVER = "your.standard.smtp.host";

change it to read this: (clearly you need to substitute the hosts you
want)

$SMTP_SERVER = "your.standard.smtp.host";
$VDOMAIN_SMTP_SERVER = array(
    "specialdomain.com"=>"your.special.smtp.host",
    "www.specialdomain.com"=>"your.special.smtp.host",
    "webmail.anotherexample.net"=>"another.example.smtp.host"
);

Therefore, $SMTP_SERVER holds the 'default' server, and the items in
the array() specify the special cases. (If you add more servers or
delete any, please note that there is a comma at the end of each line,
except for the last line.)

Step 2: tell Iloha how to use $VDOMAIN_SMTP_SERVER.
In IlohaMail-0.9.x, edit include/compose_send.inc.
In IlohaMail-0.8.x, edit source/compose2.php.

In either case, you will see the pair of lines:

$sent = false;
if (!empty($SMTP_SERVER)){

(In 0.9.x, it's right at the top of the file, in 0.8.x it's buried at
around line 600.)

Add the following lines between these two lines so they look like this:

$sent = false;
$HTTP_HOST = strtolower($_SERVER["HTTP_HOST"]);
if (isset($VDOMAIN_SMTP_SERVER[$HTTP_HOST])) {
    $SMTP_SERVER = $VDOMAIN_SMTP_SERVER[$HTTP_HOST];
}
if (!empty($SMTP_SERVER)){

That's it! Since it's only a few lines of code, I haven't tried it on
my installation but can't see how it wouldn't work. Please test it,
and report back if it's useful or not.

Best Wishes!
Andy


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Ilohamail-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ilohamail-users

Reply via email to