[imp] hook for virtual user's from address

Dale Gallagher fastfoo at fastmail.fm
Tue Aug 2 23:39:05 PDT 2005


Hi there

I found Daniel Frazier's post which appears to offer a solution to my 
requirement, but for some reason I cannot get it to work. Pointers would 
be appreciated - thanks.

Here's Daniel's post:

http://archives.free.net.ph/message/20050701.130643.b1042d9b.en.html

Requirement Summary:

My users login using their imap/pop3 logins, which are of the form 
vuser%vhost. I would like the sending From/Return-Path address and 
"Identity", as it appears on the message compose screen to be vuser at vhost.

What I've tried:

In horde/config/hooks.php:

if (!function_exists('_prefs_hook_from_addr')) {
   function _prefs_hook_from_addr($user = null) {
     if (is_null($user)) {
       $user = Auth::getAuth();
     }
     return str_replace('%', '@', $user);
   }
}

In horde/config/prefs.php:

$_prefs['from_addr'] = array(
   'value' => '',
   'locked' => true,
   'shared' => true,
   'type' => 'text',
   'hook' => true,
   'desc' =>  _("Your From: address:")
);

In horde/config/conf.php:

$conf['hooks']['from_addr'] = true;

System Summary:

Linux 2.6.9
Apache 2.0.54 (compiled with --with-mpm=prefork)
PostgreSQL 8.0.0
PHP 5.0.4 configured as follows

./configure \
   --prefix=/usr \
   --with-imap=../imap-2002e \
   --with-apxs2=/usr/local/apache2/bin/apxs \
   --with-config-file-path=/etc \
   --with-gettext \
   --with-xml \
   --with-dom \
   --with-gd \
   --with-png-dir \
   --with-zlib-dir=/usr/lib \
   --with-jpeg-dir \
   --with-mime-magic \
   --with-iconv \
   --enable-mbstring \
   --with-mbstring=all \
   --with-mcrypt \
   --with-pgsql

cheers
Dale


More information about the imp mailing list