Thanks, and Postfix/Cyrus virtual domains

Julian Jares jjares@techie.com
Wed, 25 Jul 2001 15:37:37 -0300


---------------------- multipart/alternative attachment
Hi

(Pre-mail disclaimer: My home language is not english (is actually spanish),
and sometimes, things I say sound weird or unsorted... Ill try to do my
best, thanks :-) )

Now, I wanted to start my mail by thanking you for horde, and imp. I am
starting my own mail server (tired of the freemails that are filled with
issues), and horde is basically, so much better than ALL freemail providers
out there. Congratulations, and keep up the good work :-)

Also, I have running postfix/cyrus on my box, and I had a little trouble.
Basically, I need to run 2 or 3 different domains in my box, but cyrus won't
allow me to do that. So I made a little workaround in postfix, and a few
modifications to horde. Maybe this will only work in my box, maybe you can
use it, I just wanted to let you know.
What I did is this:

Scenario:
My local domain is called joule.no-ip.com
The domains I want to user are jares.com.ar and armonia.org.ar
I made (via virtual files) postfix send mail to all users to jares.com.ar,
map to jares+com+ar@joule.no-ip.com
Ex: julian@jares.com.ar will be julian+jares+com+ar

Horde modifications will be, when you log in, @ and \. have to be mande into
+
I did this in the code:
In mailbox.php3, where you see this:

/* if this is a login, check for a language preference */
if (isset($actionID) && $actionID == IMP_LOGIN) {

        if (isset($IMAPServer)) {

I made it into this:

/* if this is a login, check for a language preference */
if (isset($actionID) && $actionID == IMP_LOGIN) {

/* replace /@\./ for /+/ */
        $imapuser=eregi_replace("(\@|\.)","+",$imapuser);
/* end replace */

        if (isset($IMAPServer)) {

Also, when you send a mail, if the name has + in it, I recover the email
address.
I did this in the code:
In imp.lib, where you see this:
function get_barefrom () {
  /* format the bare (ie, just address@server.domain format) correctly */
  global $default, $imp, $_barefrom;

  if ($default->user_change_from || $default->use_db) {
    if (empty($_barefrom))
      $_barefrom = imp_get_from($imp->user, $imp->server);

  }

  if (empty($_barefrom)) {
    if ($default->custom_from_hook &&
function_exists('imp_expand_fromaddress'))
      $_barefrom = imp_expand_fromaddress($imp);
    else
      $_barefrom = $imp->user;
  }

  if (!strstr($_barefrom, '@')) { /* allow proper use of user@server
usernames, and let imp_expand_fromaddress return full addresses
 */
    $_barefrom .= '@' . $imp->from_server;
  }

  return $_barefrom;
}

I made it into this:

function get_barefrom () {
  /* format the bare (ie, just address@server.domain format) correctly */
  global $default, $imp, $_barefrom;

  if ($default->user_change_from || $default->use_db) {
    if (empty($_barefrom))
      $_barefrom = imp_get_from($imp->user, $imp->server);

  }

  if (empty($_barefrom)) {
    if ($default->custom_from_hook &&
function_exists('imp_expand_fromaddress'))
      $_barefrom = imp_expand_fromaddress($imp);
    else
      $_barefrom = $imp->user;
  }

  if (!strstr($_barefrom, '@')) { /* allow proper use of user@server
usernames, and let imp_expand_fromaddress return full addresses
 */
    $_barefrom .= '@' . $imp->from_server;
  }
  /* replace + for @. */
  if (strstr($_barefrom,"+")){
         $domain=strstr($_barefrom,"@");
         $_barefrom=str_replace($domain,"",$_barefrom);
         $_barefrom=preg_replace("/\+/","@",$_barefrom,1);
         $_barefrom=strtr($_barefrom,"\+","\.");
         $_barefrom=$_barefrom;
   }
   /* end replace */

  return $_barefrom;
}

Anyway, thank you all for your time (especially reading this), and thanks
for horde.
Bye,
Julian

---------------------- multipart/alternative attachment--