[horde] Mail-From address as drop-down list to choose from

MailingListe lst_hoe02 at kwsoft.de
Thu Nov 13 13:20:08 UTC 2008


Hello

the "default" solution of Horde/IMP for setting the sender address is  
not really useful for us because the user can type in anything he/she  
likes. We therefore use a hack in Horde prefs.php to get a drop-down  
list to choose from populated from the alias database of our MTA. This  
has the advantage that every sender address is valid and is "owned" by  
the user in question. We unfortunately never get it to work as a hook  
as it should to be widely useful but maybe some others can do this.


// HACK
global $conf;
$account = Auth::getAuth();
include_once 'DB.php';
$_db = &DB::connect($conf['sql2'],true);
$query = 'SELECT alias FROM virtual WHERE username=?';
$sqldata=$_db->getCol($query,'alias',$account);
foreach ($sqldata as $key => $value) {
     $result["$value"] = $value;
}

// user preferred email address for From: line
// If you lock this preference, you must specify a value or a hook for it in
// horde/config/hooks.php.
$_prefs['from_addr'] = array(
     'value' => '',
     'locked' => false,
     'shared' => true,
//    'type' => 'text',
     'type' => 'enum',
     'enum' => $result,
     'desc' =>  _("Your From: address:")
);


Regards

Andreas


-- 
All your trash belong to us ;-)  www.spamschlucker.org
To: stephan at spamschlucker.org



More information about the horde mailing list