
<rss version="2.0">
	<channel>
	  <title>Tills Blog</title>
	  <link>https://dieminger.ch/blog/feed.xml</link>
          <description>Obscure and dubious content</description>
	  <language>en_uk</language>



	<item>
	<title>Cross-platform ToDo-Lists</title>
	<pubDate>25 Dec 2021</pubDate>
	<link>https://dieminger.ch/blog/Data/20220102/ToDoLists.html</link>
		<description>
		<![CDATA[ <body> <br> <br> <div class="mainpart"> <a href="../../index.html" style="text-decoration:none; color:black"><h2> Cross-platform ToDo-Lists </h2></a> <h2 id="idea">Idea</h2> <p>I want to have ToDo lists that I can use from all of my devices and that are able to sync using my own server. The goal is to have a infrastructure that uses markdown to write ToDo lists, notes and is able to attach notes to ToDo items. It should also be sync-able with something like git, to be able to have the same state on several devices. There are probably quite some services, maybe even some free software solutions to that, but I did this using git, vimwiki, Markor and MGit, since I did not find anything that really did what I wanted. If anyone has a better idea how to achieve the same, I am happy to take some recommendations.</p> <h3 id="setup">Setup</h3> <p>I use a central git-repo that I host on my server. Then I clone this repo to my machine and phone using git and <code>MGit</code> respectively.</p> <h4 id="linux">Linux</h4> <p>Here I organize and update the files using <code>vimwiki</code>. For this I added an alias that automatically pulls the new repo when entering my ToDo lists</p> <div class="sourceCode" id="cb1"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb1-1"><a href="#cb1-1" aria-hidden="true" tabindex="-1"></a><span class="bu">alias</span> list=<span class="st">&#39;cd /PATH/To/REPO/Notes/; git pull origin master; nvim /PATH/To/Repo/Notes/index.md&#39;</span></span></code></pre></div> <p>This solution is not optimal since it can take quite some time to get the server to respond. Also if you dont have your ssh-key password in the keychain, this may be quite annoying. An other idea would be to sync every time you log in to your device, assuming that you do not add any changes to the repo while you are logged in. In my <code>init.vim</code> I added the autocommand</p> <div class="sourceCode" id="cb2"><pre class="sourceCode sh"><code class="sourceCode bash"><span id="cb2-1"><a href="#cb2-1" aria-hidden="true" tabindex="-1"></a><span class="ex">autocmd</span> VimLeave /PATH/To/REPO/Notes/<span class="pp">*</span> !git commit <span class="at">-am</span> <span class="st">&quot;UpdateFromVim&quot;</span><span class="kw">;</span> <span class="fu">git</span> push origin master<span class="kw">;</span></span></code></pre></div> <p>This updates the repo every time I close a file in the local repository.</p> <h4 id="android">Android</h4> <p>Here I use MGit to sync the repo to my phone. I then use <code>Markor</code> to edit and view the markdown files. The sync method on the phone is quite tedious since you have to start MGit and add, commit and push manually each time. I am not sure how to do this better, but for now this is an okay inconvenience. But in the long run this needs a better solution.</p> <h2 id="conclusion">Conclusion</h2> <p>This is a first version of this. It would be great if I could use calcurse locally to edit the todo lists and to find a better way of syncing, especially on Android.</p> </div> </html> ]]></description></item>
	


	<item>
	<title>mykb</title>
	<pubDate>25 Dec 2021</pubDate>
	<link>https://dieminger.ch/blog/Data/20211225/mykb.html</link>
		<description>
		<![CDATA[ <body> <br> <br> <div class="mainpart"> <a href="../../index.html" style="text-decoration:none; color:black"><h2> mykb </h2></a> <h2 id="idea">Idea</h2> <p>The goal of most Linux users is to configure their systems to adapt to their workflow and not vice versa. This includes quite some configurations of different programs, scripts and services. Doing so requires a lot of trial and error and researching online how to form software to you liking. But most of the times you forget how you configured a certain tool that you want to reconfigure again. Or you fixed a problem that accrued on you way, which a friend is facing now, but you forgot how to do it. This happened quite often, so I wanted to have a place where I take quick notes when configuring a tool or fixing small bugs in them. So a friend and I decided to build this kind of knowledge base using vimwiki, since it uses easy to handle markdown files locally and allows for a (kind of) easy way to export everything to html. The goal here is to have (more or less detailed) instructions to set up and configure the different tools we use to our liking. Some entries will include more detailed step by step explanations, others probably wont be more than a few lines of code to copy paste. We dont want to have a copy-paste of page long documentations, but a short summary on how to get things working in a nice and convenient way.</p> <h2 id="where-to-find-it">Where to find it</h2> <p>We host a git repository of markdown files on <a href="https://github.com/alexbocken/mykb">github</a>. To use vimwiki with this repo, just follow the <a href="https://github.com/AlexBocken/mykb/blob/master/docs/vimwiki.md">instructions</a> on vimwiki and clone the repo. But we also host a version of this on <a href="https://mykb.dieminger.ch">mykb.dieminger.ch</a> for easier access on the go. Using Markor and MGit this project can also be used on Android phones if someone requires this.</p> <h2 id="participate">Participate</h2> <p>If anyone wants to add something, we are happy to accept pull requests, when the style fits the project.</p> </div> </html> ]]></description></item>
	


	<item>
	<title>Latches</title>
	<pubDate>19 Dec 2021</pubDate>
	<link>https://dieminger.ch/blog/Data/20211221/Latches.html</link>
		<description>
		<![CDATA[ <body> <br> <br> <div class="mainpart"> <a href="../../index.html" style="text-decoration:none; color:black"><h2> Latches </h2></a> <p>Today we are looking at Latches. They are basic storage circuits, that enable us to store information in bit form. The goal is to have a circuit that has two main inputs. Once the enabling switch, that allows us to write/change the bit, and once the input that determines the state of the bit. Only if the enable switch is pressed, we can use the input switch to set the output bit. While the information we have the enable-switch is not active and try to press the input switch, nothing should happen. For this, we will start with a simple Set-Reset Latch and work ourselves to the more elaborate D-Flip-Flop in the further posts.</p> <h3 id="set-latch">Set Latch</h3> <p>Last time we looked at different logic gates. Now we want to use the OR gate that we build to build our first version of a latch. <embed src="OR.svg" type="image/svg+xml" hspace=10 align="left" width=30% height=auto /> This circuit is interesting since we can not describe it simply with a logic gate, as we could for the logic gates. If we first turn the circuit on, we have <span class="math inline"><em>A</em> = 0</span>. Assuming that the Output is also at 0, we have <span class="math inline"><em>B</em> = 0</span> and therefore again the output at 0. So this seems to be a stable state. What happens if we now change the input <span class="math inline"><em>A</em> = 1</span> for a short time? The inputs to the OR gate will be (1 OR 0) = 1. This will set the output to 1, which then in turn will set <span class="math inline"><em>B</em> = 1</span>. We now have (1 OR 1) = 1, the output still being 1. If we now release <span class="math inline"><em>A</em></span> we get (0 OR 1)=1 and we still see the output 1. If we again press the input <span class="math inline"><em>A</em></span>, we are again in the state (1 OR 1)=1 and nothing changes, the output stays 1. With this, we have a latch, that is only once writable. As soon as we pressed <span class="math inline"><em>A</em></span> once, the latch will remain in its activated state, even if we stop pressing <span class="math inline"><em>A</em></span>. But we can never reset this latch.</p> <h3 id="set-reset-latch-sr-latch">Set-Reset Latch (SR Latch)</h3> <table> <tr> <th> A </th> <th> B </th> <th> A NOR B </th> </tr> <tr> <td> 1 </td> <td> 1 </td> <td> 0 </td> </tr> <tr> <td> 1 </td> <td> 0 </td> <td> 0 </td> </tr> <tr> <td> 0 </td> <td> 1 </td> <td> 0 </td> </tr> <tr> <td> 0 </td> <td> 0 </td> <td> 1 </td> </tr> </table> <p>We now want a similar circuit, that latches on to one output, but that can be reset. <img class="increase2" src="norloop.png" align="left" width=30% height=auto> For this circuit, we use an inverted OR gate, or NOR gate. When we build the same circuit as we build with the or gate we see that the output seems to be high and when we press the input button, the output turns low. Let’s first understand the second case. Having a look at the inverted OR table we see, that whenever <span class="math inline"><em>A</em></span> is high, the output is low. So this lines up with what we see. In the first case, where <span class="math inline"><em>A</em></span> is low, we have two possible states for <span class="math inline"><em>B</em></span>. If <span class="math inline"><em>B</em></span> is also low, the output is high, the LED is bright. But since we coupled the output to the input of <span class="math inline"><em>B</em></span>, this means that now we are in the state (0 NOR 1) which reads 0. Therefore, the output is low, and the LED is off. Again, since the output is the input of <span class="math inline"><em>B</em></span>, we turn to the (0 NOR 0)=1 case, and the output turns high. What we actually see here is a very quick flickering of the LED. This we can check using an oscilloscope and measure the output voltage of this ciruit.</p> So this can not be the circuit we want. We have to find a way to stabilize this circuit. The solution to this is to use two NOR gates and couple the outputs. Here we have two outputs, one called <span class="math inline"><em>Q</em></span>, the other one we leave unlabeled. <figure> <img src="SR1.jpg" class="increase2" alt="SR Latch" hspace=5 width=25% height=auto style="margin-left: auto; margin-right: auto; display: block;"/> <figcaption style="text-align:center"> The circuit diagram of the SR Latch </figcaption> </figure> <p>We will later see that this is always the inverse of <span class="math inline"><em>Q</em></span>, usually labeled with <span class="math inline"><em>Q̄</em></span>. Powering the circuit, we see that the output <span class="math inline"><em>Q</em></span> is on. We will color the runs that are “low”, where we have no current, in blue, and the “high” run as red. Let’s try to understand the single outputs.</p> <p>The inputs <span class="math inline"><em>A</em></span> and <span class="math inline"><em>B</em></span> are low. We see that <span class="math inline"><em>Q</em></span> is high, so the second input for the lower NOR gate is 1. <img src="SR2.jpg" hspace=5 align="left" width=25% height=auto/> It therefore outputs (1 NOR 0 ) = 0. This output is used as the second input for the upper NOR gate. Its inputs are ( 0 NOR 0 ) = 1. So it seems that this state is actually stable - even though it is not clear why the first output is set topic high. But, assuming that it is, the state is stable.</p> What happens if we now press the input <span class="math inline"><em>B</em></span>, the output of the lower gate will be (1 NOR 1) = 0, so the state will be the same. But when we push the top button, we change the output of the first gate from ( 0 NOR 0 ) = 1 to (1 NOR 0) = 0. This then changes the inputs of the lower gate to (0 NOR 0) and with this the output of the lower gate to 1. The input to the first gates are now 1 and 1, so when stay with the output 0. When we now let go of the button, the inputs are (0 NOR 1)=0. So we arrived in the second stable state, but now with the upper output Q being low, while the lower output is high. <br> <br> <div class="row"> <div class="column"> <span> <img class="increase3" src="SR3.jpg" width=100% height=auto/> </span> </div> <div class="column"> <span> <img class="increase3" src="SR4.jpg" width=100% height=auto/> </span> </div> <div class="column"> <span> <img class="increase3" src="SR5.jpg" width=100% height=auto/> </span> </div> <div class="column"> <span> <img class="increase3" src="SR6.jpg" width=100% height=auto/> </span> </div> </div> <br> To check if this is really what we see, we can use our oscilloscope again. Here in blue we see measure the upper output <span class="math inline"><em>Q</em></span>, while in orange we plot the lower output. In the beginning, we see that the upper output is high, while the lower output is low. <img class="increase2" src="Osci.png" align="left" width=30% height=auto> We then press the button, <span class="math inline"><em>Q</em></span> goes low while <span class="math inline"><em>Q̄</em></span> stays low as well. Roughly 0.25 ns later, the output <span class="math inline"><em>Q̄</em></span> changes to go high, while <span class="math inline"><em>Q</em></span> stays low. We, therefore, see, that the NOR gate needs around 0.25 ns to switch its state. We also see that the gate is not flawless, especially the large fluctuations in the <span class="math inline"><em>Q̄</em></span>. <p> <p>The circuit is now in the opposite position compared to the stable state before. When we now press the input <span class="math inline"><em>B</em></span>, nothing happens, while pressing <span class="math inline"><em>A</em></span> would result in a similar chain, changing <span class="math inline"><em>Q</em></span> and <span class="math inline"><em>Q̄</em></span> again. With these two buttons, we now can flip the output, while pressing the same button multiple times does not change anything anymore. One button is called the Set <span class="math inline"><em>S</em></span>, the other the Reset <span class="math inline"><em>R</em></span>. Setting the latch using <span class="math inline"><em>S</em></span> the output <span class="math inline"><em>Q</em></span> goes high. We then can reset the latch using <span class="math inline"><em>R</em></span>, changing the output <span class="math inline"><em>Q</em></span> to low. When the latch is already set, setting it again does not change its state.</p> <p>The last mystery we have to address is why the gate started in the configuration that we saw it in. This is because one of our gates was activated quicker than the other one. So this is quite arbitrary.</p> <h4 id="summary">Summary</h4> <p>We build an SR-Latch that can store one bit of information. It can be reset to be returned in to the original state. This is in contrast to the Set-Latch that can only be set once.</p> </div> </html> ]]></description></item>
	


	<item>
	<title>Logic Gates</title>
	<pubDate>12 Dec 2021</pubDate>
	<link>https://dieminger.ch/blog/Data/20211212/Logic_Gates.html</link>
		<description>
		<![CDATA[ <body> <br> <br> <div class="mainpart"> <a href="../../index.html" style="text-decoration:none; color:black"><h2> Logic Gates </h2></a> <h2 id="motivation">Motivation</h2> <p>Since having an amazing, when sometimes troubling physics teacher in high school, I wanted to build a small computer from the ground up. Understanding how these machines we use daily work, and not only on an abstract level but on the hands on, is one of the obligations I set myself back then. Here I could now write some more about how a curious mind should try to understand the tools he uses on a daily basis from the ground up, but this would end up too much as a moral lecture and not a fun blog article, so I push this to another time. So the goal of this series of blogs is to build a computer, starting with the basic components like resistors, capacitors, transistors etc. I want to build every thing I later use as an integrated circuit before with these simple components. If I want to use a 555 IC later, I should build it myself on a breadboard before. With this, I would like to work myself up to a full functioning small computer with a CPU, memory and maybe even a graphical output. Later I may be looking in to ways of building my own transistor, I found some interesting ways to do so using a diode, but for now, I will assume that transistors are of the same basic-ness as resistors, capacitors and wires.</p> <p>Right now I heavily rely on the amazing work that <a href="https://eater.net/8bit">Ben Eater</a> did over the course of the years, to get in to the topic. He has an outstanding teaching style and will be the basis at least for the first few sections of this blog.</p> <h2 id="logic-gates">Logic Gates</h2> <p>The basic building blocks of any computational device we use today are the so-called logic gates. They implement the logical operators we know from math or spoken language (with some imprecision) like <code>AND</code>, <code>OR</code> or <code>XOR</code>.</p> <p>The goal here is to implement them in an electronic circuit, where the inputs are switches and the output is an LED. For this we use transistors. Their working mechanism is explained in a different blog post.</p> <h3 id="inverter">Inverter</h3> <embed src="Inverter.svg" type="image/svg+xml" hspace=10 align="left" width=30% height=auto /> <p>We start with the most simple gates, the inversion. This turns a 1 in to a 0 and vice verca. When the switch is open, there is a voltage between points A and B. The LED is on and the output is therefore 1. Closing the switch we connect the points A and B via the transistor. Therefore there is no voltage over the LED and it stays of. The output is 0. With this we build an inverter.</p> <p><br> <br></p> <h3 id="and-gate">AND Gate</h3> <embed src="And.svg" type="image/svg+xml" hspace=10 align="left" width=30% height=auto /> <p>We want a gate that has two inputs and one output. If both inputs are 1, we want the output to be 1 and in all other cases, we want the output to be zero. When we have a positive input on A and B, the current can flow from the 5V rail down to ground, lighting up the LED. If only one of the inputs are on, there is no current flowing, since the second transistor is acting as a blockage. Therefore the LED stays of. The same happens when both inputs are low. <br> <br> <br> <br> <br></p> <h3 id="or-gate">OR Gate</h3> <embed src="OR.svg" type="image/svg+xml" hspace=10 align="left" width=30% height=auto /> <p>We want a gate that has two inputs and one output. If either A or B, or both A and B are high, we want the output to be high. Only if both inputs are low, we want the output also to be low. The idea is to have a parallel circuit, where opening one arm, lights up the LED. Pressing either of the switches, we open the corresponding transistor, letting current flow from the 5V rail to the ground. If we press both buttons, more current can flow, but since we anyway just have to trigger a certain level to light up the LED, this does not bother us. The LED is on, and the task fulfilled. If both switches are open, no current flows through the transistors and the LED stays off.</p> <p><br> <br> <br></p> <h3 id="xor-gate">XOR Gate</h3> <embed src="XOR.svg" type="image/svg+xml" hspace=10 align="left" width=40% height=auto/> <p>This circuit is a little more complicated. We want to have an output only if either A or B are pressed, but not if both. For this we basically build an OR gate, but have to disable it, in the case both are pressed. We therefore have to combine this with an AND gate. The main idea is to set the lower part of the OR gate to 5V when both inputs are pressed and otherwise to ground. For this we have to invert the output of the and gate and connect this today the lower part of the OR gate.</p> <p>When we only press one of the buttons, the first part, the AND gate will be low. This means that the base of the transistor is connected directly to 5V and is therefore open. This connects the collector to the emitter and therefore to ground. This now grounds the lower part of the OR gate. Since one of the buttons is pressed, the LED inputs connected from the 5V rail to ground through one of the open transistors and lights up.</p> <p>When we press both inputs, the first AND gate connects thee collector of the upper transistor to ground, grounding the base of the transistor in the second part. This then means that the collector of this transistor is directly connected to the 5V rail, without connection to ground, putting the lower part of the OR gate to 5V. Therefore the two open transistors connect the LED from 5V to 5V, meaning no voltage difference over the LED and therefore the LED stays off. When we press no of the inputs, the LED is not connected to ground since the OR gate is closed, and it also will stay off. Therefore we achieved the building of an XOR gate.</p> <h3 id="nand-gates-and-all-other-gates">NAND Gates and all other gates</h3> <p>In theory you can build all gates from a NAND gate, which would be simply the AND gates output after an inverter. We therefore could build a NAND gate and all other gates from it. This is a fun exercise which will be done in a later post.</p> <h3 id="extra-how-to-wire-up-a-button">Extra: How to wire up a button</h3> <embed src="Button_Correct.svg" type="image/svg+xml" hspace=10 align="left" width=30% height=auto /> <p>For the correct operation of logic gates or transistors, it is important that you define two states: On and Off or High and Low. This means one state where the circuitry will act and one where it doesnt. This requires the off state of the input to be connected to the same ground as the circuits are. Therefore we have to connect the output of the button to ground. Since when we would do this without any resistors, this would just cause a short-circuit as soon as we close the switch. Therefore we have the connect the output of the switch to ground using a resistor. This way the voltage drops over the resistor and we avoid a short circuit. <embed src="ButtonWrong.svg" type="image/svg+xml" hspace=10 align="left" width=30% height=auto /> Non the less, when the switch is open, the output is connected to ground and therefore in a well defined state. If we would not do this, the voltage on the output in the open state could be influenced by fluctuations or by other currents induced in the breadboard. This could lead to unsuspected behavior and some endless troubleshooting that will lead nowhere.</p> </div> </html> ]]></description></item>
	


	<item>
	<title>Measuring a Capacitor</title>
	<pubDate>27 Oct 2021</pubDate>
	<link>https://dieminger.ch/blog/Data/20211030/Osci.html</link>
		<description>
		<![CDATA[ <body> <br> <br> <div class="mainpart"> <a href="../../index.html" style="text-decoration:none; color:black"><h2> Measuring a Capacitor </h2></a> <h3 id="buying-stuff-from-aliexpress">Buying stuff from AliExpress</h3> <p>As always, buying stuff from your local dealer at least grants you some sort of quality. But the cheap prices on something like AliExpress are sometimes too good, so I bought a bunch of capacitors there. Before using them, I wanted to make sure, that they work and are correct. Since no oscilloscope was present, I had to build my own small “oscilloscope” out of an Arduino Uno which I had sitting around. This is a small explanation of how to build one and how it works.</p> <h3 id="the-circuit">The Circuit</h3> <p>The idea behind the circuit is to charge the capacitor and monitor the charging process using the analog readout pins of the Arduino. The voltage over the capacitor is simply given by <span class="math inline"><em>V</em>(<em>t</em>) = <em>I</em><em>R</em>(1−<em>e</em><sup>−<em>t</em>/<em>τ</em></sup>)</span>. Here R is the resistor over which we charge the capacitor and I is the current. In our case, we use the 5V rail of the Arduino, we simply have <span class="math inline"><em>I</em><em>R</em> = <em>U</em><sub>0</sub> = 5<em>V</em></span>. The time constant <span class="math inline"><em>τ</em> = <em>R</em><em>C</em></span> is the product of the capacitance and the resistor over which we charge the capacitor. This means, when we can measure the time <span class="math inline"><em>t</em><sub>0</sub></span> that the capacitor needs to build up a voltage of <span class="math inline"><em>U</em><sub>0</sub>(1−<em>e</em><sup>−1</sup>)</span>, we can calculate <span class="math inline"><em>C</em> = <em>t</em><sub>0</sub>/<em>R</em></span>. Since a longer charging time will minimize our relative error in the time measurement, we should choose a large resistor. This also allows us to measure smaller capacitors. I choose a 1 M<span class="math inline"><em>Ω</em></span> resistor. The minimal size of capacitors that we can measure with this setup depends on the granularity and readout frequency of the analog pin. Since the readout frequency is relatively small and the granularity is quite limited for the Uno model, we can not measure in the pF region.</p> <p><img src="ARD.png" /> After the Arduino measured the charging time, we want to discharge the capacitor to retake the measurement. This could either be used as a second measurement of the capacitance since the discharge process follows the same law as the charging, but it turns out, that the Arduino has problems measuring lower voltages. This could be a defect on my device or a general problem. Therefore I choose a second resistor, this time with a smaller resistance, to quickly discharge the capacitor and start a new measurement. The A0 pin measures the voltage over the capacitor and therefore determines the time constant. The pin 13 we use as charge pin (CP). When it is set to <code>high</code>, the capacitor charges using 5V. As soon as the A0 pin measures a voltage of <span class="math inline">0.632 * 5<em>V</em></span>, the charging process stops, pin 13 is set to <code>low</code> and pin 11, the discharge pin (DP) is activated. This allows the capacitor to quickly discharge over the 220<span class="math inline"><em>Ω</em></span> resistor. After this, the pin gets deactivated, preventing the capacitor from accidentally discharging during the charging process.</p> <p>The code for the Arduino can be found <a href="CapacitorMeasurement.ino">here</a>. It returns the measured charging time in microseconds. I do not calculate the capacitance directly, since my Arduino has only 2bit doubles, so I ran into problems regarding the storage of numbers. The output to the USB Serial Bus can then be loaded into python to determine the capacitance or the times divided by 1.000.000, which results in the capacitance in <span class="math inline"><em>μ</em><em>F</em></span>.</p> <h3 id="links-and-sources">Links and Sources</h3> <p><a href="https://en.wikipedia.org/wiki/Capacitor">Wikipedia: Capacitor</a></p> </div> </html> ]]></description></item>
	


	<item>
	<title>Dovecot Certificates</title>
	<pubDate>23 Sep 2021</pubDate>
	<link>https://dieminger.ch/blog/Data/20210723/Dovecot.html</link>
		<description>
		<![CDATA[ <body> <br> <br> <div class="mainpart"> <a href="../../index.html" style="text-decoration:none; color:black"><h2> Dovecot Certificates </h2></a> <h2 id="problem-with-certificates-and-mail-servers">Problem with certificates and mail servers</h2> <h3 id="setup">Setup</h3> <p>A mail server using <code>dovecot</code> and SSL certificates from <code>certbot</code> (Let’s Encrypt SSL)</p> <h3 id="problem-short">Problem (Short)</h3> <p>The certificate from <code>certbot</code> is flagged as invalid by email clients and other mail servers after it expired and got renewed.</p> <h3 id="solution-short">Solution (Short)</h3> <p>Restart dovecot after renewing the certificate.</p> <pre><code>systemctl restart dovecot</code></pre> <h3 id="explaination">Explaination</h3> <p>Using <code>certbot</code> for SSL certificates, the expiercy period is three months. After these three months the certificate has to be renewed. This can be done manually using</p> <pre><code>certbot renew</code></pre> <p>or using an entry in the <code>crontab</code>. The problem here is, that after this renewal, mail clients and other servers still report the certificate outdated, even if the website (mail.dieminger.ch) itself already reports the new certificate. The reason for this is, that the IMAP server dovecot reads the certificate once and then sets up a static string. This is then delivered to everyone who requests it. This means that after a renewal of the certificate, dovecot does not read in the new certificate but still serves the (now) outdated old certificate which it saved. To force dovecot to read in the new certificate, it has to be restarted using</p> <pre><code>systemctl restart dovecot</code></pre> <p>Combining both commands in a <a href="renew_dovecot_restart">wrapper script</a> and running it every month using cron solves the issue in the long term.</p> <h3 id="helpfull-stuff-about-certificates">Helpfull stuff about certificates</h3> <p>The current certificates are linked under <code>/etc/letsencrypt/live/&amp;lt;domainname&amp;gt;/</code>. This is where dovecot reads the certificates upon its start.</p> <p>The certificates are actually stored under <code>/etc/letsencrypt/archive/</code>. Here you can also find the old certificates. To read the certificates in human readable form use the <code>openssl</code> tool with <code>openssl x509 -text -noout -in &amp;lt;certificate_file&amp;gt;</code> To check the hash, use the additional flag <code>-fingerprint</code>. This hash can be comapred to the hash value that the email client recieves. Comparing both you can check which certificate is used by dovecot at the moment.</p> <h3 id="links-and-sources">Links and Sources</h3> <p><a href="https://www.eff.org/deeplinks/2019/01/encrypting-web-encrypting-net-primer-using-certbot-secure-your-mailserver">Certbot for Email</a></p> <p><a href="https://doc.dovecot.org/configuration_manual/dovecot_ssl_configuration/">Dovecot SSL config</a></p> </div> </html> ]]></description></item>
	

	</channel>
</rss>

