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 );
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;
free( localpart );
free( domainpart );
} else {
- sprintf( address, "%s@%s", localpart, domainpart );
+ sprintf( address, "%s", localpart );
free( localpart );
}
do_address( address, &tolist, &numto, &togroups, &ngroups,
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;
}
} 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 = ¤t_group->g_members;
current_nto = ¤t_group->g_nmembers;
split_address( address,