Automatically redirect unregistered

If your UnrealIRCd is up and running but you have a question about it, then use this forum.
(NOT for installation or connecting issues! Use the other forum instead.)

Moderator: Supporters

Post Reply
David
Posts: 12
Joined: Sat Nov 05, 2022 9:27 am
Contact:

Automatically redirect unregistered

Post by David »

Hi, I'm running UnrealIRCd 6.2.5. I want to automatically redirect unregistered users (not identified to NickServ) from channel #alfa to channel #beta. Is it possible to use "deny channel" with "redirect" and "mask { security-group unknown-users; }" to achieve this? If not, what is the correct syntax to redirect unregistered users to another channel?
Thx
PeGaSuS
Official supporter
Posts: 121
Joined: Tue Jun 27, 2017 4:42 pm
Contact:

Re: Automatically redirect unregistered

Post by PeGaSuS »

Hi,

The unknown-users security-group doesn't match only unregistered users but also users that have a new IP even if they're old users (unless they use SASL).

One way to achieve what you want is by doing:

Code: Select all

/mode #alfa +b ~forward:#beta:~account:0
which will redirect users from #alfa to #beta that are not identified to services.

Useful reading: UnrealIRCd Extended bans
IRC Network: PTirc - GitHub: TehPeGaSuS - Help and support: #unreal-support
CrazyCat
Posts: 272
Joined: Thu Apr 28, 2005 1:05 pm
Location: France
Contact:

Re: Automatically redirect unregistered

Post by CrazyCat »

I think you can.
The documentation for deny channel doesn't seem to be up to date, but in the Security-group's documentation, I can see:
Where security groups are used
In any mask { } item in the configuration file, like oper Oper { mask { security-group xyz; } ...
That is in: allow::mask, ban user::mask, require authentication::mask, oper::mask, except ban::mask, tld::mask, vhost::mask, link::incoming::mask, deny channel::mask, allow channel::mask, connthrottle::except, blacklist::except, set::restrict::commands::except, set::antimixedutf8::except and set::antirandom::except
Doc: https://www.unrealircd.org/docs/Security-group_block
David
Posts: 12
Joined: Sat Nov 05, 2022 9:27 am
Contact:

Re: Automatically redirect unregistered

Post by David »

I insisted on a permanent direction in the settings, but by setting the room to +P and entering +b, it still remains fixed.
Thanks PeGaSuS for your help
PeGaSuS
Official supporter
Posts: 121
Joined: Tue Jun 27, 2017 4:42 pm
Contact:

Re: Automatically redirect unregistered

Post by PeGaSuS »

as CrazyCat pointed (and well), you can also use the config. I'd use something like:

Code: Select all

deny channel {
	channel "#alfa";
	reason "You need to have a registered account to join this channel.";
	redirect "#beta";
	mask {
		exclude-identified yes;
	}
}
I'm just a bit unsure about the mask, but you can test the different variations from here.

Just remember you will need to create a deny channel block for each channel and on every server. OTOH, if you use Anope your users can do /CS SET PERSIST #channel ON and then the channel won't be closed when the last user leaves and therefore any extban will be kept active, which makes this kind of management easier.
IRC Network: PTirc - GitHub: TehPeGaSuS - Help and support: #unreal-support
David
Posts: 12
Joined: Sat Nov 05, 2022 9:27 am
Contact:

Re: Automatically redirect unregistered

Post by David »

I tried as CrazyCat suggested and it gives me this error PeGaSuS.

Code: Select all

config.CONFIG_ERROR_GENERIC [error] /unrealircd/conf/unrealircd.conf:417: deny channel::mask specified without a value
I finally did the Persist mode and the ban and it works fine.
Thanks to both of you for your help.
CrazyCat
Posts: 272
Joined: Thu Apr 28, 2005 1:05 pm
Location: France
Contact:

Re: Automatically redirect unregistered

Post by CrazyCat »

Didn't test but I think you needto create a security group first:

Code: Select all

security-group unidentified { identified no; }
And then your deny:

Code: Select all

deny channel {
	channel "#alfa";
	reason "You need to have a registered account to join this channel.";
	redirect "#beta";
	mask { security-group unidentified; }
}
EDIT does the same error...
PeGaSuS
Official supporter
Posts: 121
Joined: Tue Jun 27, 2017 4:42 pm
Contact:

Re: Automatically redirect unregistered

Post by PeGaSuS »

David wrote: Thu Jun 04, 2026 6:03 pm I tried as CrazyCat suggested and it gives me this error PeGaSuS.

Code: Select all

config.CONFIG_ERROR_GENERIC [error] /unrealircd/conf/unrealircd.conf:417: deny channel::mask specified without a value
I finally did the Persist mode and the ban and it works fine.
Thanks to both of you for your help.
Well, thanks to this another bug was fixed and now it should work as expected, if you don't want to use persistent channels. :D
IRC Network: PTirc - GitHub: TehPeGaSuS - Help and support: #unreal-support
Post Reply