(feature request) support for non-stdio plugins (like Hydroxide)

Bug #1938719 reported by Bill Yikes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
fetchmail (Ubuntu)
Invalid
Wishlist
Unassigned

Bug Description

Protonmail-Hydroxide users are inconvenienced with having to manually execute this command prior to running fetchmail:

$ torsocks hydroxide imap

The fetchmailrc stanza looks like this:

skip protonmail-hydroxide via 127.0.0.1
        protocol imap
        port 1143
        username "billyikes"
        sslproto ''
        fetchall

The workflow above functions, but it's a nuissance to have to execute a daemon manually before running fetchmail. In principle, it would be ideal to add: 'plugin "torsocks hydroxide imap"', but the problem is that fetchmail has the limitation of having to interact with plugins through standard I/O, which is unsupported by hydroxide.

I suggest adding the following options:

stdio <boolean>
plugin_is_a_daemon <boolean>
kill_plugin <boolean>

If the stdio boolean is true, then the plugin mechanism works the way it always has. If the boolean is false, then fetchmail connects to the IP and port given in the stanza.

If plugin_is_a_daemon is true, then fetchmail should check whether the process is already running and if not fetchmail should launch it and disown it before fetching the mail.

If kill_plugin is true, fetchmail should kill the plugin after each fetch.

Perhaps those 3 options could be consolidated into fewer options but I'm merely brainstorming the degree of control that would be useful to users.

*Alternatively*

Perhaps there is a hack that avoids a fetchmail code change. For example, would it work to layer in socat alongside hydroxide? Such as:

plugin "torsocks hydroxide imap & socat STDIO TCP:127.0.0.1:%h:%p"

I'm not real proficient with socat (it's very complex), but if there is a way to launch hydroxide and combine socat as middleware to keep fetchmail code simple, then this feature request could boil down to simply adding an example of a hydroxide configuration to the man page.

FYI, Hydroxide lives here: https://github.com/emersion/hydroxide

BTW, I know the upstream tracker is normally the appropriate place for feature requests, but gitlab.com is inaccessible to myself and probably many others (largely people using Tor or whose ISP uses CGNAT). So I've posted it here just to get it on record, in hopes that an upstream developer sees it.

Bill Yikes (yik3s)
description: updated
description: updated
Revision history for this message
Matthias Andree (matthias-andree) wrote :

Bill,

judging from the hydroxide webpage, all you need to do is make sure that hydroxide is running properly and then you can tell fetchmail to use that port 1143 to fetch through.

You may need to use the "via" keyword in a fetchmail configuration file (it is not available through the command line interface) to connect to the server.

I do not see a reason to duplicate daemon control features into fetchmail for which more than half a dozen solutions exist already.

Revision history for this message
Matthias Andree (matthias-andree) wrote :

Also, if you really must shoot your feet and knees at the same time, fetchmail has a "preconnect" directive, too. See the manual.

Changed in fetchmail (Ubuntu):
status: New → Invalid
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Thanks for taking the time to file this bug.

I am not a fetchmail user so I do not know if this is a common use case or if it is used by a few people. Since this is a feature request I am setting the importance to Wishlist and I am adding to our backlog. Let's see if someone with more experience chime in and give us a comprehensive analysis.

Changed in fetchmail (Ubuntu):
importance: Undecided → Wishlist
Revision history for this message
Matthias Andree (matthias-andree) wrote :

Lucas, it is still a support request rather than a feature request since the feature is already there - but unsuitable for the use case. That's why I marked it invalid already. It makes no sense to burden distributions with feature requests because users are unaware of existing features for rare use cases that reveal shortcomings in other tools.

Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Thanks for the reply Matthias. Based on your comments I'll be also removing it from our backlog.

Revision history for this message
Bill Yikes (yik3s) wrote (last edit ):

> Lucas, it is still a support request rather than a feature request since the feature is already there

It's not. You misunderstood the ticket. Your first response mirrors my opening statement, but neglects everything that followed.

The "plugin" option only works with stdio. This ticket is to implement a new capability: to spawn an executable that does *not* talk to fetchmail via standard i/o. My opening statement and your response is the /workaround/ because that capability is lacking.

There is however a complication with the idea of making fetchmail capable of spawing a daemon: when a daemon is executed in the background, it's not necessarily ready to accept traffic instantly. There would be a possible problem if fetchmail were to try to connect to a port before the listener is ready. It's a race condition, and fetchmail would have to be smart about connection reattempts and even have a timeout if the daemon never comes up. So it's perhaps more effort than it's worth. So Hydroxide users will probably have to live with scripting things outside of fetchmail. I think "wontfix - wishlist" is probably a more accurate status, but i suppose it doesn't make much difference.

Revision history for this message
Matthias Andree (matthias-andree) wrote :

I was proposing preconnect, not plugin. -> comment #2. There is also postconnect in fetchmail.
You may need to script interfaces with delay and readiness checks. As written before, daemon management is out of fetchmail's scope. Fetchmail is not going to turn into another systemd.

Again, fetchmail does *NOT* need new features here, and this bug tracker is not meant for advice and consultation of complex interfacing rigs with proprietary web services, public API or not.

And if you are inconvenienced by hydroxide's design, feature requests are best filed there - through its primary channels, not secondary ones such as downstream bug trackers.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.