Stopping outgoing emails to certain users

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
bmccool
Posts: 14
Joined: 10 Apr 2006, 10:48

Stopping outgoing emails to certain users

Post by bmccool »

so, i've loaded this patch to allow incoming emails to be loaded into the mantis system. A very nice feature indeed.

What i need is to exclude all email addresses (except internal) from receiving the signup notification.

I also need to exclude certain email addresses (these would be internal) from receiving any mails whatsoever. These will be messages that come from other systems relating to downtime, program errors, etc.

I'm pretty sure that this will require me to customise

Any help would be appreciated!
bmccool
Posts: 14
Joined: 10 Apr 2006, 10:48

Post by bmccool »

Anybody?

I'm pretty sure that i have to edit email_api.php but my php knowledge is less than zero :(

Please guys...
bmccool
Posts: 14
Joined: 10 Apr 2006, 10:48

Post by bmccool »

hmmmm, i've found the following in user_api.php

Code: Select all

	
# Signup a user.
# If the use_ldap_email config option is on then tries to find email using
# ldap. $p_email may be empty, but the user wont get any emails.
# returns false if error, the generated cookie string if ok
	function user_signup( $p_username, $p_email=null ) {
		if ( null === $p_email ) {
			$p_email = '';

# @@@ I think the ldap_email stuff is a bit borked
#  Where is it being set?  When is it being used?
#  Shouldn't we override an email that is passed in here?
#  If the user doesn't exist in ldap, is the account created?
#  If so, there password won't get set anywhere...  (etc)
#  RJF: I was going to check for the existence of an LDAP email.
#  however, since we can't create an LDAP account at the moment,
#  and we don't know the user password in advance, we may not be able
#  to retrieve it anyway.
#  I'll re-enable this once a plan has been properly formulated for LDAP
#  account management and creation.

/*			$t_email = '';
			if ( ON == config_get( 'use_ldap_email' ) ) {
				$t_email = ldap_email_from_username( $p_username );
			}

			if ( !is_blank( $t_email ) ) {
				$p_email = $t_email;
			}
*/
		}

[b]		$p_email = trim( $p_email );

		$t_seed = $p_email . $p_username;
		# Create random password
		$t_password	= auth_generate_random_password( $t_seed );

		return user_create( $p_username, $t_password, $p_email );
	}[/b]
Something to do with the bit in bold perhaps? I still have no idea about the allowing internal users bit though :(
Post Reply