emacs-circe / circe

Circe, a Client for IRC in Emacs
GNU General Public License v3.0
395 stars 51 forks source link

How to connect to Bitlbee ? #367

Closed apraga closed 1 year ago

apraga commented 4 years ago

Hi guys, I can connect to bitlbee without any issue using ERC. Here is my minimal working example for circe

(require 'package)
(add-to-list 'package-archives
             '("melpa-stable" . "http://stable.melpa.org/packages/") t)
(package-initialize)
(add-to-list 'load-path "~/.emacs.d/lisp/circe")
(require 'circe)

(setq circe-network-options
      '(("Bitlbee"
         :host "localhost" :port 6667
         :nick "alex"
         :nickserv-password "XXXX"
         :nickserv-identify-challenge "use the \x02identify\x02 command to identify yourself"
         :nickserv-identify-command "PRIVMSG &bitlbee :identify {password}"
         :nickserv-identify-confirmation "Password accepted, settings and accounts loaded"
         :lagmon-disabled t)))

When i start circe, I only have a screen with

*** [: from nil] NOTICE * BitlBee-IRCd initialized, please go on
*** [: from nil] CAP * LS sasl multi-prefix extended-join away-notify
    userhost-in-names server-time

Instead of the usual flurry of text. Setting irc-debug-log to true gives :

E: "conn.connected" 
C: CAP LS
C: NICK alex
C: USER alex 8 * alex
S: : NOTICE * :BitlBee-IRCd initialized, please go on
E: ":" nil "NOTICE" "*" "BitlBee-IRCd initialized, please go on"
S: : CAP * LS :sasl multi-prefix extended-join away-notify userhost-in-names server-time
E: ":" nil "CAP" "*" "LS" "sasl multi-prefix extended-join away-notify userhost-in-names server-time"

Any advice ? Thanks

Edit : new version with minimal working example

apraga commented 4 years ago

I've used both Bitlbee with and without lipurple (according to #285 ) but it does not help.

wasamasa commented 4 years ago

There shouldn't be any need for setting :pass. As you can see from the debug log a PASS command is sent, but no NickServ command. If you remove the :pass line, the NickServ command should be tried instead and successfully authenticate you.

apraga commented 4 years ago

Thanks for the answer. :pass was a result of a series of test. Removing it still does not connect properly to bitlbee.

I also tried with and without lagmon because I had a warning without it. Warning (emacs): Unknown option :lagmon-disabled, ignored

I modified my inital report to have a minimal working example without doom-emacs.

wasamasa commented 4 years ago

Thanks for adjusting the report, but it doesn't contain the new log. What does it say now?

apraga commented 4 years ago

The log is the same as far as I can see. I've updated it for good measure.

ecraven commented 1 year ago

I've just fought this too, you need to also set nickserv-mask. I have the following block, and it seems to work:


:nickserv-mask "root!root@localhost"
:nickserv-nick "ecraven" :nickserv-password "XXX" :nickserv-identify-challenge "command to identify yourself."
:nickserv-identify-command "PRIVMSG &bitlbee :identify {password}" :nickserv-identify-confirmation "Password accepted, settings and accounts loaded"
wasamasa commented 1 year ago

That doesn't make sense, the default nickserv-mask is "\\(bitlbee\\|root\\)!\\(bitlbee\\|root\\)@":

(string-match "root!root@localhost" "root!root@localhost") ;=> t
(string-match "\\(bitlbee\\|root\\)!\\(bitlbee\\|root\\)@" "root!root@localhost") ;=> t

Are you sure it's not something else?

edit: Here's a redacted log (password and buddy list have been removed): bitlbee.log

edit2: I've noticed in the original log that the IRC message from the server is malformed:

Expected: "S: :localhost NOTICE :BitlBee-IRCd initialized, please go on" Actual: "S: : NOTICE :BitlBee-IRCd initialized, please go on"

Looking at the bitlbee source code, this appears to be either getsockname or getpeername returning an empty string. An empty servername leads to irc--parse returning nil as sender, which gives the "from nil" messages. Which appears to be invalid according to the grammar given on https://modern.ircdocs.horse/#source. At the very least, Circe should catch this kind of mistake so that it's more apparent and people can contribute proper logs to investigate what is going wrong. Can you please also include a log?

ecraven commented 1 year ago

how sure are you about that default? I see

(defvar circe-nickserv-mask nil
  "The regular expression to identify the nickserv on this network.

Matched against nick!user@host.")

in circe.el, and on my machine circe-nickserv-mask is nil.

circe-20221126.1508

EDIT: ok, my bad, I've just found circe-network-defaults, which does set some settings for bitlbee.. however, I've defined my own bitlbee settings in circe-network-options. how are those two merged? mine is called "bitlbee" (lowercase b), maybe that's the problem?

ecraven commented 1 year ago

After some testing, the network needs to be named "Bitlbee" exactly (uppercase B), then I only set nickserv-password, nothing else, and everything works fine for me ;)

wasamasa commented 1 year ago

Yeah, it is. That makes your issue different from the original problem OP reported. Change it to "Bitlbee" and things should just work™.

@apraga Are you still using Bitlbee and running into this issue?

apraga commented 1 year ago

@wasamasa I am not using Bitlbee at the moment so cannot test this issue anymore. Feel free to close it if needed. Thanks.