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 |
State ⇒ Rejected
State ⇒ New
Priority ⇒ 1. Low
Type ⇒ Enhancement
Summary ⇒ Multidomain - user.domain.tld@hostname
Queue ⇒ IMP
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