Corresponding ticket: [[!tails_ticket 8573]]

It would be nice to replace Pidgin with another secure IM client. Unfortunately no good alternative seems to exist today. To be able to decide, if another IM client would be a suitable replacement this document should list the requirements a client needs to fulfill to fit the bill.

The document can also list candidate clients together with some indication where they are lacking (and where they shine).

TODO: Would a pair of two separate client (XMPP and IRC) also be okay, or are we only looking for a single client that can do both? In fact, it is not even clear if Tails needs to contain an IRC client at all, after #tails and #tails-dev have been moved to XMPP.

# Requirements

**Note**: the key words "MUST", "MUST NOT", "REQUIRED", "SHALL", 
"SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and 
"OPTIONAL" in this document are to be interpreted as described in 
[RFC 2119](http://www.ietf.org/rfc/rfc2119.txt).

## General requirements

### Use cases

The client SHOULD support the following use cases:

1. Contributing to Free Software projects that use IRC chatrooms (and won't switch to anything else any time soon)
2. Contributing to Free Software projects that use XMPP chatrooms
3. One-to-one chat that is compatible with currently widespread practice. That basically means XMPP + OTR, nowadays.
4. Participation in public chatrooms for Tails user support.

The client MAY support the following use cases:

* One-to-one chat that protects metadata end-to-end (that is: "who is chatting with whom")

### Documentation

### Internationalization

The client must be internationalized, ideally already translated in many languages - if not, adding new languages should be easy.

### GUI

The client must have a easy to use GUI that makes it hard for users to use the client in an insecure way.

### TLS

The client must support connections using TLS.

TODO: Is STARTTLS needed?

### Support for Tor

The client must support Tor and must not leak any private data (hostname, username, local IP, ...) at the application level.

### Support for OTR

The client must support OTR and should make it easy to enforce usage of OTR for all conversations or only for specific contacts.

Ideally, some usability study for the OTR user interface has been done.

### Other

TODO: Pidgin already has an apparmor profile; should we require that a replacement also comes with an apparmor profile?

The client MUST NOT save logs of conversations.

## XMPP (Jabber)

 *( Here is a [list](https://developer.pidgin.im/wiki/SupportedXEPs) of XMPP extensions supported by Pidgin )*

### MUC
The client must support XMPP conference rooms [(XEP-0045)](https://xmpp.org/extensions/xep-0045.html).

## IRC
### SASL
The client must support SASL authentication.

# Candidate alternatives 

## Tor Messenger ([[!tails_ticket 8577]])

* Documentation, downloads and tickets in Tor's [Trac](https://trac.torproject.org/projects/tor/wiki/doc/TorMessenger)
* Tor Messenger supports XMPP, IRC and some other protocols.

## CoyIM (based on xmpp-client) ([[!tails_ticket 8574]])

* [Homepage](https://coy.im/)
* [Github](https://github.com/twstrike/coyim/)
* CoyIM only supports XMPP.

## Gajim

XMPP client in Debian with plugins for OTR and OMEMO (Signal-like) but
no IRC. Tickets were created and rejected some time ago
([[!tails_ticket 7868]] and [[!tails_ticket 11541]]) but might be worth
reconsidering after updating this blueprint ([[!tails_ticket 11686]]).

People from Security-in-a-Box have used it successfully in Tails.

Gajim ships with a plugin called "plugin installer" which allows a user to download new plugins. This sounds suspicious for security, because plugins are pieces of code running with full privilege. The implementation in Debian use unverified TLS connection, which is very very open to MITM. The development version has switched to verified HTTPS connection and is trying to make it more robust.
However, I think that Tails should not ship this plugin at all: it allows a user to download code without needing sudo. We could work debian-side to separate gajim-plugininstaller in a separate package so that Tails can choose not to install it?
