[imp] imap/smtp server variable

Jon Parise jon@csh.rit.edu
Fri, 22 Jun 2001 14:15:57 -0400


[Copying dev@lists.horde.org for everyone's benefit]

On Thu, Jun 21, 2001 at 06:08:39PM -0400, Cliff Green wrote:

Okay, I just finished coding and testing support for an
'smtphost' parameter in config/servers.php.  Grab my changes
from cvs and let me know how things work for you.

> I've added:
> -another parm to $servers ('smtphost') in config/servers.php,

I also went with this.

> -a line to login.php to load $smtphost_value from 
>  $servers[$server_key]['smtphost'] 

I didn't bother adding any login support for 'smtphost' because
it really isn't a necessary parameter for IMAP/POP logins.

Instead, I added the logic to lib/IMP.php.  I conditionally store
the value as $imp['smtphost'] if we're using the SMTP mailer type
and the value in config/servers.php is non-empty.  This is
performed upon session creation.

Later on, whenever I send a message, I override the value of
$conf['mailer']['params']['host'] with $imp['smtphost'], provided
that $imp['smtphost'] is non-empty.

> Still doesn't work.  I'm sure I've done stuff that doesn't need
> doing (global?), and certainly haven't done something critical.
> Mail.php sends the messages on from localhost, so it's not
> getting the value of 'smtphost'.

Well, my code appears to work correctly, but I'm still seeing
instances of 'localhost' in the mail logs.  There may be a
problem with Mail/SMTP.php, but I don't really want to look into
that right now.

I am going to take a few minutes and add some error reporting to
compose.php in the case where $mailer->send() returns an error.
At the moment, it appears to just ignore that case.

-- 
Jon Parise (jon@csh.rit.edu)  .  Rochester Inst. of Technology
http://www.csh.rit.edu/~jon/  :  Computer Science House Member