Comment 3 for bug 670683

Revision history for this message
François Marier (fmarier) wrote :

Thanks for sorting that out Ruslan. That's a very handy patch for people to apply on their sites if they're affected by this problem.

Maybe we need to rethink a bit how we handle mail servers. What I mean by that is that clearly we need to include more options than just the name of an SMTP server:

- ssl or tls
- port number
- username/password (for those servers that require authentication)

So I think that it's probably time to change our simplistic comma-separated list of SMTP hosts to perhaps an array of arrays.

I'm thinking something along the lines of:

$cfg->smtphosts = array(array('server' => 'smtp.gmail.com', 'port' => 587), array('server' => 'localhost'));

but we should also make sure we are backwards-compatible and support the old:

$cfg->smtphosts = 'smtp.example.com,localhost';

and also _maybe_ a simplified form like:

$cfg->smtphosts = array(array('server' => 'smtp.gmail.com', 'port' => 587), 'smtp.example.com');

Of course, with confoptions becoming more complicated, maybe it's time to think of moving this to a proper UI under site administration. What do you think?