6.0.0-beta1
8/9/25

[#2402] Multidomain - user.domain.tld@hostname
Summary Multidomain - user.domain.tld@hostname
Queue IMP
Queue Version 4.0
Type Enhancement
State Rejected
Priority 1. Low
Owners
Requester info (at) peter (dot) st
Created 08/07/2005 (7307 days ago)
Due
Updated 08/07/2005 (7307 days ago)
Assigned
Resolved 08/07/2005 (7307 days ago)
Milestone
Patch No

History
08/07/2005 12:41:52 PM Jan Schneider Comment #2
State ⇒ Rejected
Reply to this comment
All this is possible with builtin features for years.
08/07/2005 12:17:06 PM info (at) peter (dot) st Comment #1
State ⇒ New
Priority ⇒ 1. Low
Type ⇒ Enhancement
Summary ⇒ Multidomain - user.domain.tld@hostname
Queue ⇒ IMP
Reply to this comment
Hi guys,



I noticed that under IMP4 there is no function like 
imp_expand_fromaddress($imp). So if I want to compose a new mail on a 
fresh installation, as "From" address there you can see 
"user.domain.tld@hostname" instead of "user@domain.tld".



I made some changes to get it work again, but perhaps there is an 
other way to enable this function which I didn't find.



My changes (backup) to the origin source (current):



<snip>



diff -uNr ./current/imp/lib/Identity/imp.php ./backup/imp/lib/Identity/imp.php

--- ./current/imp/lib/Identity/imp.php        2005-01-03 13:25:35.000000000 +0100

+++ ./backup/imp/lib/Identity/imp.php        2005-07-12 19:52:25.000000000 +0200

@@ -232,9 +232,13 @@

              $val = $imp['user'];

          }



-        if (!strstr($val, '@')) {

+        $val = imp_expand_fromaddress($imp);

+

+                /*

+                if (!strstr($val, '@')) {

              $val .= '@' . $imp['maildomain'];

          }

+                */



          $this->_fromList[$ident] = $val;





<snip>



I also added these lines to my imp/config/conf.php:



[..]

/* CONFIG END. DO NOT CHANGE ANYTHING IN OR BEFORE THIS LINE. */

if (!function_exists('imp_expand_fromaddress')) {

     function imp_expand_fromaddress ($imp) {

         $db = mysql_pconnect($db_mail_host,$db_mail_user,$db_mail_pass);

         mysql_select_db($db_mail_database,$db);

         $user= $imp['user'];

         $sql = "SELECT alias FROM virtual WHERE username = '".$user."'";

         $result = mysql_query($sql,$db);

         $name = mysql_result($result,0,"alias");

         return (empty($name) ? $imp['user'] : $name );

     }

}



The alias-field comes from another database, not horde.



<snap>



So it works again. Perhaps I missed something to get multidomains to 
run without these patches.



Greetings, Peter


Saved Queries