]> git.sur5r.net Git - openldap/blobdiff - clients/maildap/main.c
Update copyright notices
[openldap] / clients / maildap / main.c
index 9a2ad1aceba02c23ddf68e96ca22cebd58b536f6..36b58576b8439c13ced327235eddad9e1d226296 100644 (file)
@@ -191,7 +191,7 @@ main ( int argc, char **argv )
        int             i, j;
        char            *conffile = NULL;
 
-       if ( (myname = strrchr( argv[0], '/' )) == NULL )
+       if ( (myname = strrchr( argv[0], *LDAP_DIRSEP )) == NULL )
                myname = strdup( argv[0] );
        else
                myname = strdup( myname + 1 );
@@ -218,6 +218,11 @@ main ( int argc, char **argv )
 
                case 'f':       /* who it's from & where errors should go */
                        mailfrom = strdup( optarg );
+                       /* Deal with <> */
+                       if ( mailfrom[0] == '\0' ) {
+                               free( mailfrom );
+                               mailfrom = strdup( "<>" );
+                       }
                        for ( j = 0; sendmailargs[j] != NULL; j++ ) {
                                if ( strcmp( sendmailargs[j], "-f" ) == 0 ) {
                                        sendmailargs[j+1] = mailfrom;
@@ -329,7 +334,7 @@ main ( int argc, char **argv )
                        free( localpart );
                        free( domainpart );
                } else {
-                       sprintf( address, "%s@%s", localpart, domainpart );
+                       sprintf( address, "%s", localpart );
                        free( localpart );
                }
                do_address( address, &tolist, &numto, &togroups, &ngroups,
@@ -702,7 +707,7 @@ new_group( char *dn, Group ***list, int *nlist )
        Group   *this_group;
 
        for ( i = 0; i < *nlist; i++ ) {
-               if ( strcmp( dn, (*list)[i]->g_dn ) == 0 ) {
+               if ( strcasecmp( dn, (*list)[i]->g_dn ) == 0 ) {
                        syslog( LOG_ALERT, "group loop 2 detected (%s)", dn );
                        return NULL;
                }
@@ -1317,6 +1322,13 @@ entry_engine(
                        } else {
                                current_group = new_group( dn, togroups,
                                                           ngroups );
+                               if ( ! current_group )
+                                       /*
+                                        * We have already considered
+                                        * this group, so we just
+                                        * return resolved.
+                                        */
+                                       return 1;
                                current_to = &current_group->g_members;
                                current_nto = &current_group->g_nmembers;
                                split_address( address,
@@ -1414,7 +1426,7 @@ entry_engine(
         * Sendmail 8.10.0 does, if compiled properly.
         *
         * The second method, that is most emphatically not recommended
-        * is routing in mail500.  This is going to require using the
+        * is routing in maildap.  This is going to require using the
         * percent hack.  Moreover, this may occasionally loop.
         */
        if ( needs_mta_routing ) {