[Users] Difference between Alias and Listen

Mark Kent mark at noc.mainstreet.net
Fri Oct 20 19:23:03 CEST 2006


>> Basically what I am trying to achieve is to just have the server
>> listening on a specific (fixed) IP and just point multiple domain
>> names at it's public IP without having to edit the config or
>> restart openser. Do you know if this is possible?

I'ld like to see someone authoritative say Yes,
while waiting for that.... I'll say Yes, using the domain module.

I have one listen statement, listing one ip address and one port.
I have one alias statement listing the actual hostname of the machine.
I have a few domains listed in my db, and I use this code:

# checks if the URI either points at us or if it is from a trusted
# source.  If it does point AT us, then we just return with a positive
# value and the caller should continue
#
route[37] { 
  if (is_uri_host_local()) {
     return(1);
  }

  if (is_from_local()) {
     # it wasn't destined *for* us, but it's from 
     # someone we trust, so relay it
     log(1, "from local...\n");
     route(21);
  } else if (allow_trusted()) {
     # it wasn't destined *for* us, but it's from 
     # someone we trust, so relay it
     log(1, "from trusted...\n");
     route(21);
  } else {
     sl_send_reply("403", "Forbidden. We don't relay everything...");
  }

  return(-1);
}

and I use that at near the top of route[0]

route {
  xlog("L_ERR", "$rm $ru $si $fu\n");

  # sanity checks
  if (!route(39)) {
     exit;
  }

  if (!is_method("REGISTER")) {
     record_route();      
  }

  # loose-route
  if (!route(38)) {
     exit;
  }

  # meant for us?
  if (!route(37)) {
     exit;
  }
  [snip: handle different methods]
}

I would like to see someone authoritative comment on the above.

I've got more to say, but I'll put it in another email
so it doesn't get lost.

-mark




More information about the Users mailing list