Using Rsync on Android: Getting Syncopoli talking to the rsync daemon

Syncthing has largely taken the FOSS throne of continuous file synchronization on both servers and desktops. When it comes to my phone, however, I can still see a use for discrete, on-demand file synchronization – at least if changes only appear on one end, be it on the phone or the server. And for that purpose, there is really nothing else to turn to than good ol’ rsync.

Syncopoli seems to be the most up-to-date rsync client on Android, seeing as it’s code has at least been updated within the past year. Even though I believe I know how the basics of rsync on the command line, Syncopoli is not the most intuitive of mobile apps and presents some special problems. In the following I will detail both setting up the rsync daemon on the server and getting a Syncopoli setup that matches the server.


Let’s do Dovecot slowly and properly – Part 3: LMTP

So far I have had a pretty clear division of labour between Postfix and Dovecot. Postfix accepts mail from other MTAs and puts it into my maildir. Dovecot accepts my client’s inquiries and hands it the mail it finds in same maildir. I muddied the waters a bit when I started asking Dovecot to serve as authenticator for SMTP but those waters are about to get a fair bit murkier. Postfix will now relinquish the job of actually delivering the mail to maildirs and instead hand it over to a Dovecot service.

Why? Postfix has done a fine job of it so far, has it not? Yes, but Postfix is not a very sophisticated mailman. It shoves my mail in the mailbox/maildir that I tell it to based on virtual_mailbox_base and virtual_mailbox_maps but that’s all it can do. If I want to set up filtering rules or other intelligent processing of mail delivery, I am going to need to insert another step, namely using the Local Mail Transfer Protocol or LMTP for short. In essence, LMTP is the protocol that allows Postfix and Dovecot to actually talk to one another, rather than one just leaving messages for the other on the kitchen counter. Insert your own old-married-couple joke here.


Let’s do Postfix slowly and properly – Part 6: Relay authenticating with SASL

I have explored the default setting of Postfix to allow local machines to send without authenticating, simply based on them being on the local network (permit_mynetworks). Even if I am not always on my own local network I could make this work by installing a webmail client on the same server (or in the same docker network). Even if we are accessing the client over the internet, the client is on a local machine and part of the local network’seen from the perspective of the postfix. Therefore permit_mynetworks would give the OK and allow it to send without any further restrictions. But then there are smartphones and getting notified whenever I have mail rather than having to check manually. So I need a way to authenticate as a legitimate user who should be allowed to send when I’m not on the local network of the server. One way to do this is by piggybacking on the MDA’s authentication. In other words: If I am already authenticating with the IMAP server, why not use that to also authenticate me with Postfix for sending? This link between the two reminds me of what I said in the first post in this series: That the division into MTA and MDA probably wasn’t engineered as much as just arrived at by stops and starts.

In this post I will create such a setup with Dovecot playing the part of the MDA. Dovecot will offer up an authentication service on the machine. When I ask Postfix to send something, Postfix will approach this service and ask if I should be allowed to send. And Dovecot will say yes or no, depending on whether or not I have previously properly authenticated with it.


Powerline secrets

You know that XKCD comic where the protagonist googles a tech question and the only matching result is from a long dead thread or even forum that details the issue but provides no answers? I am wondering if other people sometimes happen on the subcategory of that where the thread originator instead of being DenverCoder9 is… yourself. Instead of “closeness to another soul”, it just engenders a slight disappointment. Right, I’ve been here before, trying the same thing and given up.

Trying to customize my powerline setup raised a number of questions that I could not find answers to in the official documentation, including the question of whether root’s bash prompt could be coloured anything other than fire engine red. Luckily I found answers to all of these this time round.


StackExchange Answers: Shells

Sometimes a Stackoverflow answer is so good that it helps me understand something I had kind of given up on. The distinctions of login and interactive shells are a good example. Some ressources had pointed me to the INVOCATION section of the bash man page. Here’s the explanation of what login and interactive shells are:

A login shell is one whose first character of argument zero is a , or one started with the –login option.
An interactive shell is one started without non-option arguments and without the -c option whose standard input and error are both connected to terminals (as determined by isatty(3)), or one started with the -i option. PS1 is set and $- includes i if bash is interactive, allowing a shell script or a startup file to test this state.

I’m sure it’s correct and proper. From the perspective of someone trying to understand when .bashrc is invoked, it’s also absurdly unhelpful. Askubuntu user terdon to the rescue.

They just provide examples of each of the four combinations (and two binary tests that will tell you if the shell you’re in is login/interactive or nor) but from those examples, the defining characteristics become so much clearer. A shell is a login shell if I changed user when entering it be that by using su, ssh or logging in on a tty. An interactive shell is basically anything with a prompt and a non-interactive one is running something scripted. The combinations are then as follows:

ExamplesInteractive shellNon-interactive shell
Login shellTTY, su -, sshPiping commands into ssh
Non-login shellA terminal emulator, starting a shell within a login shellScripts

I’m not summarizing to replace the answer, just to check that I understand. terdon’s examples do a much better job of explaining it – go have a read.

How to force Steam UI doubling on linux

In 2018 Steam on linux got the ability to autodetect HiDPI screens and resize the UI accordingly. I would guess this kicks in on 4k resolutions. I’m guessing because I don’t have one. What I do have is a laptop with a 14″ 2560×1440 screen and failing eyesight. Alas, neither one triggers the UI resize. Here’s how to consistently force the UI resizing instead of relying on Steam’s autoconfiguration.