* added masquerade domain feature.
authorWilfried Göesgens <willi@citadel.org>
Wed, 2 May 2007 21:37:27 +0000 (21:37 +0000)
committerWilfried Göesgens <willi@citadel.org>
Wed, 2 May 2007 21:37:27 +0000 (21:37 +0000)
citadel/debian/changelog
citadel/internet_addressing.c
citadel/msgbase.c
citadel/routines2.c
citadel/serv_vcard.c

index 76db37597fcf42966af2183eed2d914f9ba0b190..c645680db04401acf56f0c19c77ebe36c263a74c 100644 (file)
@@ -1,24 +1,34 @@
+citadel (7.10-1) unstable; urgency=low
+
+  * update to actual Citadel SVN. many new features. see Packages changelog.
+
+ -- Wilfried Goesgens <citadel@outgesourced.org>  Sun, 29 Apr 2007 13:01:00 +0200
+
+
 citadel (7.08-15) unstable; urgency=high
   
     * fix permission bug
   
-   -- Wilfried Goesgens <citadel@outgesourced.org>  Fri, 06 Apr 2007 19:07:00 +0000
+ -- Wilfried Goesgens <citadel@outgesourced.org>  Fri, 06 Apr 2007 19:07:00 +0000
+
 citadel (7.07-14) unstable; urgency=low
+
+  * update to actual Citadel SVN. many new features. see Packages changelog.
   
-    * update to actual Citadel SVN. many new features. see Packages changelog.
-  
-   -- Wilfried Goesgens <citadel@outgesourced.org>  Fri, 06 Apr 2007 19:07:00 +0000
+ -- Wilfried Goesgens <citadel@outgesourced.org>  Fri, 06 Apr 2007 19:07:00 +0000
+
 citadel (7.06-13) stable; urgency=high
   
     * fixed location of key files
   
  -- Wilfried Goesgens <citadel@outgesourced.org>  Sun, 1 Apr 2007 11:09:00 +0100
+ -- Wilfried Goesgens <citadel@outgesourced.org>  Sun, 1 Apr 2007 11:09:00 +0100
   
 citadel (7.06-12) stable; urgency=high
   
     * updated mime-parser
   
-   -- Wilfried Goesgens <citadel@outgesourced.org>  Mon, 21 Mar 2007 11:09:00 +0100
+ -- Wilfried Goesgens <citadel@outgesourced.org>  Mon, 21 Mar 2007 11:09:00 +0100
+
 citadel (7.06-11) unstable; urgency=low
 
   * fixes to the configure script.
index 41666dfef3725060a748e3142f45ea72ddbebf28..3bbf8245423a483b77b05d3c5ab5b205c189913f 100644 (file)
@@ -94,6 +94,10 @@ int CtdlHostAlias(char *fqdn) {
                   && (!strcasecmp(&fqdn[strlen(fqdn)-strlen(host)], host)))
                        return(hostalias_directory);
 
+               if ( (!strcasecmp(type, "masqdomain"))
+                  && (!strcasecmp(&fqdn[strlen(fqdn)-strlen(host)], host)))
+                       return(hostalias_masq);
+
        }
 
        return(hostalias_nomatch);
@@ -564,7 +568,7 @@ void directory_key(char *key, char *addr) {
 /* Return nonzero if the supplied address is in a domain we keep in
  * the directory
  */
-int IsDirectory(char *addr) {
+int IsDirectory(char *addr, int allow_masq_domains) {
        char domain[256];
        int h;
 
@@ -573,6 +577,9 @@ int IsDirectory(char *addr) {
 
        h = CtdlHostAlias(domain);
 
+       if ( (h == hostalias_masq) && allow_masq_domains)
+               return(1);
+       
        if ( (h == hostalias_localhost) || (h == hostalias_directory) ) {
                return(1);
        }
@@ -598,7 +605,7 @@ void CtdlDirectoryAddUser(char *internet_addr, char *citadel_addr) {
 
        lprintf(CTDL_DEBUG, "Dir: %s --> %s\n",
                internet_addr, citadel_addr);
-       if (IsDirectory(internet_addr) == 0) return;
+       if (IsDirectory(internet_addr, 0) == 0) return;
 
        directory_key(key, internet_addr);
 
@@ -637,7 +644,7 @@ int CtdlDirectoryLookup(char *target, char *internet_addr, size_t targbuflen) {
        if (num_tokens(internet_addr, '@') != 2) return(-1);
 
        /* Only do lookups for domains in the directory */
-       if (IsDirectory(internet_addr) == 0) return(-1);
+       if (IsDirectory(internet_addr, 0) == 0) return(-1);
 
        directory_key(key, internet_addr);
        cdbrec = cdb_fetch(CDB_DIRECTORY, key, strlen(key) );
@@ -674,7 +681,7 @@ char *harvest_collected_addresses(struct CtdlMessage *msg) {
                strcat(addr, " <");
                strcat(addr, msg->cm_fields['F']);
                strcat(addr, ">");
-               if (IsDirectory(msg->cm_fields['F'])) {
+               if (IsDirectory(msg->cm_fields['F'], 0)) {
                        is_harvestable = 0;
                }
        }
index 5eb729f1084ab9ad9347a78ff06be2f74dd3f648..7a1abce384b7f14d551eda54319719d2411ff252 100644 (file)
@@ -3214,7 +3214,7 @@ struct recptypes *validate_recipients(char *supplied_recipients) {
                                 * because if the address were valid, we would have
                                 * already translated it to a local address by now.
                                 */
-                               if (IsDirectory(this_recp)) {
+                               if (IsDirectory(this_recp, 0)) {
                                        ++ret->num_error;
                                        invalid = 1;
                                }
index 190b69dd2b5026a4c51d28ea73ddd4da15d394ee..7be0e5b37de01266f520e24b36124539a6d6a9b0 100644 (file)
@@ -919,6 +919,7 @@ void get_inet_rec_type(CtdlIPC *ipc, char *buf) {
        keyopt(" <4> directory      (Consult the Global Address Book)\n");
        keyopt(" <5> SpamAssassin   (Address of SpamAssassin server)\n");
        keyopt(" <6> RBL            (domain suffix of spam hunting RBL)\n");
+       keyopt(" <7> masq domains   (Domains as which users are allowed to masquerade)\n");
        sel = intprompt("Which one", 1, 1, 6);
        switch(sel) {
                case 1: strcpy(buf, "localhost");
@@ -933,6 +934,8 @@ void get_inet_rec_type(CtdlIPC *ipc, char *buf) {
                        return;
                case 6: strcpy(buf, "rbl");
                        return;
+               case 7: strcpy(buf, "masqdomain");
+                       return;
        }
 }
 
index 8fbaf44ff505c6d3726dbe81b2462718e01e489b..f9f92c68bfa3bdc52595896017100e7a08e66823 100644 (file)
@@ -218,7 +218,8 @@ void extract_inet_email_addrs(char *emailaddrbuf, size_t emailaddrbuf_len,
                addr = strdup(s);
                striplt(addr);
                if (strlen(addr) > 0) {
-                       if ( (IsDirectory(addr)) || (!local_addrs_only) ) {
+                       if ( (IsDirectory(addr, 1)) || 
+                            (!local_addrs_only) ) {
                                ++saved_instance;
                                if ((saved_instance == 1) && (emailaddrbuf != NULL)) {
                                        safestrncpy(emailaddrbuf, addr, emailaddrbuf_len);