<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Victor Lopes on Medium]]></title>
        <description><![CDATA[Stories by Victor Lopes on Medium]]></description>
        <link>https://medium.com/@victorlclopes?source=rss-cf31e5ddab06------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*Q3UVhyrfTU_wrC9dFtGdRg.png</url>
            <title>Stories by Victor Lopes on Medium</title>
            <link>https://medium.com/@victorlclopes?source=rss-cf31e5ddab06------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 05:34:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@victorlclopes/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Was the Brazilian presidency stolen?]]></title>
            <link>https://victorlclopes.medium.com/how-the-brazilian-presidency-was-stolen-b4742425d1e1?source=rss-cf31e5ddab06------2</link>
            <guid isPermaLink="false">https://medium.com/p/b4742425d1e1</guid>
            <category><![CDATA[brazil]]></category>
            <category><![CDATA[elections]]></category>
            <category><![CDATA[justice]]></category>
            <category><![CDATA[politics]]></category>
            <dc:creator><![CDATA[Victor Lopes]]></dc:creator>
            <pubDate>Fri, 25 Nov 2022 18:15:19 GMT</pubDate>
            <atom:updated>2023-03-31T22:59:17.601Z</atom:updated>
            <content:encoded><![CDATA[<h3>Was the Brazilian presidency was stolen?</h3><p>The following 11 topics are not an opinion, per se. It’s a list of information put together so anyone can begin to understand the political and judicial crisis evidenced in Brazil. If you read this in an open-minded way, even if you don’t agree with my conclusions, I’m sure you’ll understand most of what half of this country is feeling right now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ez1uljzyvK0JZPV39vKjjw.jpeg" /><figcaption>Protests in Brazil on November 15th, 2022</figcaption></figure><h4><strong>1. The first and most important thing you must know: Lula has not been acquitted, nor declared “not guilty”</strong></h4><p>Lula was never considered “innocent” or “not guilty” by the Brazilian Supreme Court (STF). Both major lawsuits involving Luiz Inácio Lula da Silva, notably the triplex apartment case and the Atibaia ranch, were nullified and restarted by one Supreme Court member, following a minor procedural issue, considered by many a very questionable technicality.</p><p>What amazing loophole made that possible? None, it was nothing special: the court member decided that these cases should have been conducted in Brasília, DF instead of Curitiba, PR as they were (despite the fact that it was conducted by the federal justice).</p><p>Therefore, Lula allegedly regained the “presumably innocent” status given by the constitution (a person is considered innocent until proven otherwise). Then, this situation has been used politically to lead people in mistakenly infer that Lula was not considered guilty.</p><p>Know fact, Lula was convicted on a first instance court, then he was unanimously considered guilty on a second instance court by <strong>03</strong> different judges, and later <strong>05</strong> superior judges denied him a habeas corpus. No, it was not just Sergio Moro, despite him being later declared “partial” on these cases (by the Supreme Court itself).</p><p>As a result of these lawsuits being cancelled, Lula was made eligible again. Also, besides being restarted, the mentioned cases expired their time allowed for prosecution.</p><h4><strong>2. As much important: how are the Supreme Court members defined?</strong></h4><p>In Brazil, Supreme Court members are defined by the president. Yes, members of an institution trusted to be the most unbiased are designated by a politician. The name of every new member suggested by the president then has to be approved by the Senate. Given the support a government may or may not have inside the Congress, a polemic nomination might or might not be approved.</p><p>The constitution has a somewhat vague requirement for this position. As a result, some ministers are accomplished and experienced judges, with master’s degrees and PhDs, while some might be lawyers or prosecutors with a dated bachelor’s and not as much to show for.</p><p>A key point here is: the Worker’s Party occupied the presidency for 14 consecutive years. By the time Lula’s lawsuits were cancelled , 7 out of 11 Supreme Court ministers had been defined by either Lula himself or by Dilma Rousseff , his successor.</p><p>I’ll be naming just two:</p><ul><li><strong>Dias Toffoli</strong>: used to be a lawyer (legal advisor) of the Worker’s Party itself. And later he was the Lead Union Lawyer (advogado-geral da união) inside Lula’s government. Regardless of his know-how, Toffoli’s academic history is just the regular Law school diploma from 1990 and he has been criticized for failing twice the oficial exam to become a judge in the past and then still being nominated to this court.</li><li><strong>Edson Fachin</strong>: nominated in 2015; has multiple academic titles; an accomplished lawyer and state attorney. Fachin is known for having publicly supported Lula da Silva and Dilma Rousseff and for interacting with entities connected to the Worker’s Party. In 2010, Fachin actively participated in Dilma’s campaign (presidential run).</li></ul><p>I’m not saying that ministers nominated by either Lula or Dilma don’t act in an isonomic and impartial way. What I’m trying to communicate is:</p><ul><li>Nomination of court members is usually advertised as a technical and pragmatic choice, but is widely seen as a political decision.</li><li>The majority of Supreme Court members today were defined by former presidents belonging to the Worker’s Party</li><li>The decisions that led to Lula da Silva being released and later being eligible were made in majority by ministers literally chosen by Lula or by Dilma.</li><li>The minister who chose to cancel Lula’s lawsuits was, by the way, Mr. Edson Fachin.</li></ul><h4>3. What is the so called Superior Electoral Court?</h4><p>The TSE (Tribunal Superior Eleitoral) is both a special court and a government agency responsible for organizing and conducting every aspect of the election process (at federal level), while also judging every lawsuit or any submitted case involving the elections.</p><p>The main takeaway is:</p><ul><li>The TSE has a generous budget, huge facilities, and the sole responsibility of taking care of elections, and still they are a target of many complaints, of a growing number of citizens that do not consider that they do a good enough job.</li><li>The president of the Supreme Court (STF) is, by definition, also the president of the Electoral Court (TSE). And two other STF ministers also make up the TSE court panel. This means that every difficulty the country may be facing regarding the Supreme Court is also transferred to the agency responsible for elections, which includes the risk of judicial politicization.</li></ul><h4>4. A very dirty campaign and a suspected court favoritism</h4><p>This 2022 presidential run in Brazil was extremely “polarized”, and the only two candidates that ever stood a chance were Lula da Silva and Jair Bolsonaro. The amount of fake news from supporters of both sides was immense, unfortunately. And the official advertisements from each campaign also had many attacks to one another.</p><p>By the end of this presidential run, Lula had pledged 300+ claims at the Electoral Court asking to either take down posts considered offenses or to request “reply rights” on alleged attacks from other candidates. The court granted 100+ of these cases and ordered the removal of at least 85 posts, videos, etc. In contrast, Bolsonaro filed less than 10 complains at TSE, targeting only cases we could consider more serious. Most of Bolsonaro’s requests were granted.</p><p>While no unbalanced ruling can be seen by comparing numbers, we can note a few things:</p><ul><li>opening judicial cases as much as possible was a clear strategy on Lula’s campaign.</li><li>The majority of web posts targeted by Lula’s complains, and granted removal by the TSE, contained obvious fake news, with many ridiculous attempts to add more scandals to Lula’s account.</li><li>But a significant number of removed content consisted on controvert subjects; some could be considered opinions; and, most importantly, many were related to the fact that Lula was convicted and considered corrupt.</li><li>A few days before the 2nd round of presidential elections, Bolsonaro’s team submitted a complaint containing serious indication that his advertisements were significantly less played on radio stations then Lula’s. He asked for an investigation and for proper measures regarding this problem. Alexandre de Morais, president of TSE, promptly rejected the case, accusing Bolsonaro of trying to create a fuzz near the election day, and even inverted the situation, registering new investigations against Bolsonaro regarding this request. The advertisement problem was not investigated, and a certain TSE employee was fired in the same day after pointing out that maybe there was indeed a problem regarding the distribution of this content.</li></ul><h4>5. Unconstitutional acts and the shadow of censorship</h4><p>To contrast with the current approach adopted by both the Supreme Court (STF) and the Electoral Court (TSE), we can mention previous understandings of two ministers that make up the judge panel of these two courts:</p><ul><li>In September this year, minister Cármen Lúcia have said (loosely translated): “the fundamental right of free speech exists not only to protect those opinions accepted as true, […] but also those considered dubious, exaggerated, reprehensible or satirical […] Wrong affirmatives are also protected by this constitutional right”. Read it <a href="https://www.tse.jus.br/comunicacao/noticias/2022/Setembro/negadas-liminares-do-pl-em-acoes-por-propaganda-eleitoral-negativa-e-antecipada-contra-luiz-inacio-lula-da-silva">here</a>. She pronounced this while denying a request made by Bolsonaro’s party (PL) asking for the removal of content where Lula da Silva offended Bolsonaro with words like genocidal and fascist.</li><li>In 2018, minister Alexandre de Morais said (loosely translated) “if you don’t want to be criticized, if you don’t want to be satirized, stay at home! Don’t be a candidate, […] don’t offer your name for a political position […] Trying to avoid this […] violating the right of free speech is absolutely unconstitutional” while voting on a Supreme Court case. Watch it <a href="https://www.youtube.com/watch?v=9BoXub7VMVE">here</a>.</li></ul><p>During this year’s election the TSE panel voted an increase on its own powers to take down news and other media items considered fake, or “known to be untrue” or “seriously out of context”. It meant that in many cases the court could quickly and promptly decide on the matter (order the removal of content) <strong>without being called</strong> on a case.</p><p>The idea behind this could have been to hold down the spread of fake news, but in practice it weighed on a few ministers’ shoulders the responsibility to decide whether an information is true or false, which might be easier most of the time, but frequently is something very subjective.</p><p>We can take a look at two cases (of many) that happened between the 1st and 2nd round of 2022’s elections, both filed by Lula’s team and accepted by the TSE:</p><ul><li>On October 18th the TSE ordered the retention of a documentary (scheduled for October 24th) produced by a known Brazilian streaming service covering the assassination attempt suffered by Jair Bolsonaro in 2018. The court didn’t request access to the material (nobody watched it) and this decision was seen as an act of clear censorship. Minister Cármen Lúcia said during her vote that she was against censorship, but this was a “very exceptional” situation, and voted in favor of the withhold. Turns out the documentary is just a journalistic investigation and it didn’t have any accusations against Lula or the Worker’s Party, for example, nor it had political propaganda in favor of Bolsonaro. But the court prohibited the video release without knowing it’s contents.</li><li>On the same week, the court prohibited the well-known TV and radio channel Jovem Pan of mentioning Lula da Silva’s situation regarding his lawsuits being cancelled, and many other statements considered supposedly untrue and offensive. Yes, remember the first topic of this article? It’s pretty much about it. Any and each reoccurance of these statements would result in a R$ 25,000 fine (around US$ 4,600).</li></ul><p>Given many similar cases, the court has been accused of disguising these acts as a “war on fake news” while bringing back censorship to this country. It’s very difficult to see these decisions as impartial when there are repeatedly clear political entities benefited by them. Free speech is guaranteed on the Brazilian constitution and censorship is unequivocally forbidden.</p><p>Earlier this year, minister Alexandre de Morais ordered the arrest of a congressman due to offenses against the Supreme Court itself and other reprehensible declarations. This is seen as an incursion “on another state power”, because the action to prosecute a deputy for any misconduct is attribution of the Congress itself, and the constitution defines that parliament members are protected and entitled to express any opinion.</p><p>After election results, “anti-democratic” behavior was an alleged reason for the same minister to order the take down of entire social media profiles of a number of parliament members, like Carla Zambelli.</p><p>Another iconic example was prof. Marcos Cintra, that had his <a href="https://twitter.com/MarcosCintra">twitter</a> account withheld after a post where he simply manifested worries about the voting system and suggested that possible problems pointed out by private audits (topic 9 bellow) should be investigated and cleared out by the TSE.</p><h4>6. Why Supreme Court members are not questioned at all?</h4><p>The only institution invested with power to promote an impeachment against any Supreme Court member is the Senate. The president of the Senate is responsible for accepting any impeachment requests.</p><p>Rodrigo Pacheco is the senator currently occupying the Senate’s presidency and, even when pressured by many of his peers to take action, he has various times denied impeachment requests opened against Alexandre de Morais, a STF minister since 2017. Morais has been a target of many popular complaints, including a manifest signed by more then 3 million citizens. Even the <a href="https://www.nytimes.com/2022/09/26/world/americas/bolsonaro-brazil-supreme-court.html">New York Times</a> has questioned this situation.</p><p>It’s important to mention that senators, alongside a number of government and parliament positions, by definition, can only be judged on the Supreme Court. Which makes many people wonder: if you have something to be afraid of, something illegal you might be accountable for, or even if you don’t, would you dare raise your voice against those entitled to convict you? Or would you hide behind a “respect for the public institutions” and leave everything as is?</p><p>And it goes both ways: if you’re a court minister with terrible popular approval, how would you treat cases targeting senators, those who can vote your impeachment? It’s something to think about.</p><p>As we can conclude, the success or failure of impeachment requests like these depend almost entirely on the relationship and support one may have on the Congress. When former president Dilma Rousseff progressively lost support on the Congress, the head of parliament at the time simply accepted an impeachment request filed against Mrs. Rousseff (one of many), and this resulted on her actual impeachment back then.</p><h4>7. The polemic involving electronic vote</h4><p>First of all, we have to make justice to the proposition president Bolsonaro and many parliament members support regarding the so called “printed vote” and everyone needs to understand this once and for all. Regardless of political preference or whether you agree with the idea or not, Bolsonaro’s request on this has always been:</p><ul><li>prepare the current electronic voting machines to print a copy of each vote, allowing the voter to check at the moment if the printed copy confirms the chosen candidate, and then this hard copy would be deposited on a traditional ballot box (automatically).</li><li>The printed copy of every vote would be held by TSE personnel, and this hard copy would act as a double check resource, a fail safe.</li></ul><p>And it never has been:</p><ul><li>go back to paper vote, as it was prior to 2000’s, or</li><li>provide any receipt, to be held by the voter, nor</li><li>end the anonymity of the vote</li></ul><p>The major problem we face is lack of inspection and the impossibility of a re-count. In other words, the current electronic voting system is incapable of undergoing a thorough audit, to either properly and ultimately attest the strength of the technology involved and the safety of software code, but specially to inspect, after every election day, if everyone actually voted on the candidate the system tell us they did.</p><p>To make it worse, the constant refusal, on part of the Electoral Court (TSE), to try and improve the system only raises more suspicion. Recently, after polemic election results on this last October 30th, the president of TSE has been declaring, paraphrasing: that everyone who chooses to question the safety of the election and anyone demanding more transparency is acting in an “anti-democratic” way.</p><p>It’s important to note that the printed vote was proposed a few times by different entities and it has been approved by the Congress, but revoked by the Supreme Court (STF). Also, the original voting device project included the printing function. More recently, at the possibility of another approval on this subject, STF minister Roberto Barroso strongly advocated against it inside the Congress and the proposal eventually failed again.</p><h4>8. Inaccurate and potentially biased election polls</h4><p>During the presidential run, election polls from most polling institutes were consistently showing Lula ahead of Bolsonaro. This let many people puzzled, because Bolsonaro’s popular support was impressive. Also, one might think that a candidate with corruption records wouldn’t get the majority of vote intentions.</p><p>But well, Lula has always been very popular too, and all the public support given to Bolsonaro wouldn’t necessarily reflect or impact the real vote intention numbers. Nonetheless, this projections helped Lula sustain a “useful vote” idea, which in summary suggested that citizens whose intention was to vote for another leftist candidate available should instead vote for Lula, because (as the polling shows) he was the only one that could defeat Bolsonaro.</p><p>Less than a week before elections, many well-known polling institutes such as Datafolha, IPEC (formerly IBOPE) and Quaest were showing Lula way ahead, indicating clearly that he would win on the first round.</p><p>Election results came for this first round on October 2nd and then we saw that most of these institutes failed their projections way above the margin of error. Datafolha, one of the most famous in the field, have said that these two candidates would be <strong>14</strong> percentiles apart, and the difference was actually around <strong>5</strong>.</p><p>It’s very unlikely that one candidate would tip the scales so greatly in the last day or two before the election. So we can conclude that one of these two possibilities must explain this scenario:</p><ul><li>these mentioned companies were incompetent, either with a poor model, the wrong strategy, or in the way each polling was conducted</li><li>the polling was biased, tempered or forced in one direction, by either choosing a specific sample, or any other dubious method</li></ul><p>In any case, this situation quickly rose the debate about whether these companies should better be made accountable for the polling results released to the public, because, I believe most people would agree, election polls can influence public opinion and vote intention.</p><h4>9. Inconsistencies discovered by private audits</h4><p>Final results came after the 2nd round on October 30th and the dispute was extremely tight. Lula da Silva won with 50.9% of valid votes against 49.1% given to Jair Bolsonaro.</p><p>Lula’s supporters were obviously happy, while most people that voted for Bolsonaro were incredibly disappointed, feeling forsaken and victim of an apparent joint effort to elect someone that shouldn’t even be a candidate if it wasn’t for polemic decisions in the Supreme Court, as we mentioned before.</p><p>A couple of days later protests started around the country. And in the same week emerged a report analyzing voting machine models and number of votes. This report pack was released by the Argentine consultant Fernando Cerimedo and it spread under the #BrazilWasStolen. There is also a website where you can find this content: <a href="https://brazilwasstolen.com/en/">https://brazilwasstolen.com/en</a>. It claims basically that:</p><ul><li>Machine models prior to 2020 had consistently more votes for Lula when compared with 2020 models in the same region, which should be more noticeable on small cities where the population is not so heterogeneous;</li><li>Many voting machines had 0 (zero) or very few votes for Bolsonaro, and this situation happened massively more times on older machines (prior to 2020 models).</li><li>It’s possible for a particular section to result in 0 votes for a candidate, but is really rare, specially on such a balanced, polarized election.</li><li>When representing total votes from new machine models (2020) and from older models (prior to 2020) side by side in a chart, is clear that uncommon characteristics discovered, specially these zero-vote machines, produce a graph on older models that’s not organic, that is, a pattern that would hardly happen naturally.</li></ul><p>Here’s what I could confirm from these allegations: I downloaded the official data from the official TSE website and I’ve chosen to analyse just the 2nd round of this presidential election on one particular state as a sample. Using Node.js with read and write streams I’ve converted many files from .csv (as the TSE makes it available) to JSON and compiled the results to check the patterns. What I can say about the state of <strong>Minas Gerais</strong> (MG):</p><ul><li>If you consider just new machine models (2020), Bolsonaro had more votes indeed (around 3.6% more). And considering just older models (prior to 2020) Lula won with 3.4% more votes.</li><li>In Minas Gerais there were 19,668 new machines (39.4%), counting 5,328,837 votes, and 30,313 older machines (60.6%), with 7,003,433 votes. Final results were Lula 50.2% and Bolsonaro 49.8%.</li><li>In the whole state there was 01 new machine with zero votes for Bolsonaro, while there were 08 older machines with zero votes for Bolsonaro. There were no machines at all with zero votes for Lula.</li><li>Generally speaking, new machine models were sent to major cities, like the capital and other bigger municipalities, while older machines were predominantly sent to smaller cities in the country side.</li><li>Unfortunately there were no cities with mixed machine models in MG to make a comparison like “new vs older”.</li></ul><p>To finish this topic I will leave some considerations:</p><ul><li>Quickly after these reports were released, the Electoral Court’s president published a note dismissing these allegations and stating that the elections occurred in a democratic and secure way.</li><li>Many press companies have published news saying that these reports are fake because the TSE had already dismissed them; and that Fernando Cerimedo openly supports Bolsonaro and rightist political views (which was already quite obvious) and these reports were based on false conclusions (I don’t know how they may have confirmed this).</li><li>Soon after the 1st election round we noticed that, in various states, some candidates that openly support Bolsonaro and his political view (rightist, conservatism, economic liberalism, etc.) received significantly more votes for positions such as governor and senator than Bolsonaro himself. How can governor candidates supporting Bolsonaro get more than 60% total votes and Bolsonaro get less than 45%, while the number of voters are exactly the same? In other words, who would vote Ron DeSantis for governor and Joe Biden for president, for example? I’m sure there is a logical explanation, but this is odd to say the least.</li><li>Another thing that could explain why Bolsonaro had more votes on new machines is the fact that new models were used in major cities and older models in smaller cities (at least in Minas Gerais), so one could interpret that Lula may have more support on the country side, which is <strong>not</strong> true for the state of São Paulo, for example, and on the other hand precisely raises the question: why were new machines sent to big cities and older sent to smaller ones?</li><li>It’s obvious that someone has to re-do all this work and analyse the data to either confirm or refute Mr. Cerimedo’s claims.</li><li>The word “inspection” is very generic, so when the TSE says that the electronic voting machines went through inspection, this can mean a great number of things. What I can confirm is: the Ministry of Defense recently published an official note saying that its analysts and technicians didn’t have proper access to the software code and other resources involved in the process and due to this fact it is impossible to guarantee the security of the voting system. Nor can we say for sure that the software code expected to run on these machines, even if it could have gone through minimal inspection, is the actual code that was in fact executed in the election day.</li><li>Nobody doubts the technology itself. TLS, certificates, hashes and all of this is very common today. When people question the system, they are usually afraid of human error and the immense political pressure involved in the process.</li></ul><h4>10. The role played by major press members</h4><p>The most dangerous choice that many media companies made on this year’s election was: <strong>to treat Lula da Silva’s candidacy as normal</strong> and as a common presidential run like any other.</p><p>While some news channels were counting on the possibility to remind people that “remember this guy? That’s the one convicted by corruption and his party is that one responsible for Brazil’s worst recession and greatest corruption scandal”, many of the biggest TV channels decided to “let’s point out qualities of Lula’s previous governments, let’s compare them with Bolsonaro’s mandate, even though they happened in very different global contexts, and let’s forget the fact that one of them was arrested the other day”.</p><p>Major press companies are known to criticize the government, which is normal. Bolsonaro lost a lot of support during the p@ndem1c, and things that he said are usually reverberated very badly. Now while recovering from such a crisis, most perspectives for the Brazilian economy are quite good, comparing to other countries. But one thing many media outlets in Brazil have been criticized for are the frequent article titles that follow the pattern “this good thing happened in the government, BUT take a look at this other negative approach to it”.</p><p>This contrast made some press members that want to report positive developments happening in the government and to discuss problems involving the superior courts, among other similar topics, to be seen as “pro Bolsonaro” and to be repressed for not following a certain model.</p><p>A good example are the protests happening on the second and third week after the elections. While some channels like Jovem Pan are constantly covering the manifests and describing them as large and pacific, some other channels like CNN Brasil have chosen to mainly ignore these movements, and the few videos they released reporting this are stamped with adjectives such as “anti-democratic” and “golpistas” (pejorative way of saying “in favor of a coup”).</p><h4>11. The massive protests after election results</h4><p>Shortly after the 2nd round of this year’s elections, road blockades happened in several Brazilian states, mainly started by truck drivers and many other Bolsonaro’s supporters. After everything that’s been discussed in this article, these protesters didn’t believe that the election process was fair and they couldn’t find in their hearts a way of accepting the alleged result.</p><p>After a few days, the roadblocks gave way to a new kind of protest: pacific marches and people standing in front of military installations. So after all, are these people asking for a coup? It’s not as simple as that. Some people are asking for a militar intervention, many are asking for a federal intervention, but generally protesters are holding signs saying “S.O.S Armed forces”, or “Armed forces, please save Brazil!”.</p><p>So why are they in front of these military institutions? Simple: they don’t know where else to go. The military are the last resort in this call for help. They’ve completely lost faith in the Congress, and they know nothing will come from the judiciary, as many believe that the superior courts are in fact the pivot of this situation we’re facing.</p><p>Of course these protesters support Bolsonaro, and they don’t recognize Lula as a legitimate candidate, nor would they accept Lula’s government as legitimate, but that’s not exactly the problem or why they feel so insulted. If you ask them about this on the streets they will often say that the problem is much greater. If the election process had transparency and public trust, they would calmly accept the victory of a candidate other than Bolsonaro. What they are really contesting is the judicial activism and the way this whole election process was conducted.</p><h4>Conclusion</h4><p>The main request behind these protests is transparency for the election process and respect for the constitution. If Brazilian authorities could have given us a trustworthy voting system and a truly impartial treatment for all candidates, without such politicized decisions, we would never be facing this crisis.</p><p>It doesn’t matter that a system is secure if so many people don’t see it as such. It doesn’t matter that the technology employed is strong if so many links around it are weak.</p><p>Where is that majority that elected Lula? People ask… and many cannot see it. One could sustain that it was only possible due to a scandalous series of polemic decisions on the Supreme Court (STF), an apparent unbalanced ruling in favor of a candidate in detriment of the other, and, maybe the most cruel, a massive support from irresponsible press companies.</p><p>So was the presidency stolen? You tell me…<br>Way before the possibility of this voting system be or not be fraudulent, at the moment a restricted number of authorities decided to suspend Lula’s crimes, then millions of Brazilians already felt robbed. After that it was downhill all the way to this state of exception, whether a malicious technical interference was or not deemed necessary to make that happen.</p><p><strong>The “slow cooking” effect</strong></p><p>Looking at this trajectory I noticed how perplexed people were while watching this series of events described above. I can summarize this perplexity in the following sequence of thoughts and rhetorical “questions”:</p><ul><li>“No, they won’t end prison after 2nd instance conviction and release dozens of cons including Lula (specially)”</li><li>“Ok, but they can’t end Lula’s lawsuits, it’s not possible. He’ll continue to respond for them”</li><li>“Alright, but I can’t believe they will make him eligible again”</li><li>“I see… but he won’t win, people remember all the corruption cases and economic crisis”</li><li>“And for sure the traditional press would never treat Lula’s candidacy as normal, not after everything that happened”</li><li>“No, of course not, the Electoral Court will not favor the Worker’s Party’s claims in detriment of Bolsonaro’s requests, they wouldn’t have that poker face”</li><li>“Alright, alright! Lula’s got the presidency. But that doesn’t mean he will again distribute high seats based on political interests only, nor greatly increase the number of ministries, or even break the government spending cap and things like that”</li><li>“Ok, he’s already doing it, even before taking office. But we cannot affirm that in a couple of years Brazil would be in such terrible economic situation as Argentina, for example”</li><li>Well… I wouldn’t be surprised</li></ul><p><strong>Some references (all in portuguese):</strong></p><ul><li><a href="https://pt.wikipedia.org/wiki/Supremo_Tribunal_Federal">The STF and its judge panel</a></li><li><a href="https://www.poder360.com.br/justica/lula-se-livra-de-processos-mas-teve-so-3-absolvicoes/">Lula’s lawsuits status</a></li><li><a href="https://g1.globo.com/politica/noticia/2021/03/08/entenda-a-decisao-de-fachin-que-anulou-as-condenacoes-de-lula-e-o-que-acontece-agora.ghtml">How Lula’s lawsuits were cancelled</a></li><li><a href="https://www.tse.jus.br/comunicacao/noticias/2022/Setembro/negadas-liminares-do-pl-em-acoes-por-propaganda-eleitoral-negativa-e-antecipada-contra-luiz-inacio-lula-da-silva">Cármen Lúcia about free speech rights</a></li><li><a href="https://www.tse.jus.br/comunicacao/noticias/2022/Outubro/tse-aprova-resolucao-para-dar-mais-efetividade-ao-combate-a-desinformacao-no-processo-eleitoral">TSE increases it’s power against “fake news</a>”</li><li><a href="https://www.poder360.com.br/eleicoes/especialistas-divergem-sobre-resolucao-que-amplia-poderes-do-tse/">More about this TSE decision</a></li><li><a href="https://veja.abril.com.br/coluna/radar/campanha-de-lula-acionou-o-tse-313-vezes-e-ganhou-114-processos/">Lula’s submissions to TSE</a></li><li><a href="https://www.cnnbrasil.com.br/politica/tse-garante-226-direitos-de-resposta-a-lula-em-insercoes-de-bolsonaro-na-tv-e-radio/">226 reply rights for Lula</a></li><li><a href="https://noticias.uol.com.br/ultimas-noticias/agencia-estado/2022/10/22/tse-tem-maioria-para-liberar-direito-de-resposta-a-lula-na-campanha-do-bolsonaro.htm">TSE maintains decision regarding Lula’s reply rights</a></li><li><a href="https://www.tse.jus.br/comunicacao/noticias/2022/Outubro/plenario-suspende-direito-de-resposta-de-bolsonaro-na-campanha-de-lula">TSE suspends Bolsonaro’s reply rights</a> &amp; <a href="https://www.poder360.com.br/eleicoes/tse-suspende-direito-de-resposta-de-bolsonaro-na-televisao/">More about this</a></li><li><a href="https://revistaoeste.com/politica/tse-nao-viu-o-documentario-que-censurou/">TSE censored/prohibited documentary</a></li><li><a href="https://www.poder360.com.br/justica/moraes-rejeita-pedido-de-bolsonaro-por-suposto-corte-em-insercoes/">TSE denies request for investigating advertisements</a></li><li><a href="https://www.poder360.com.br/justica/conheca-o-conceito-de-desordem-informacional-popularizado-por-lewandowski/">The concept of “information disorder”</a></li><li><a href="https://correiodoestado.com.br/politica/saiba-quais-os-institutos-de-pesquisas-que-mais-erraram-e-acertaram-no/406324/">Polling companies and their wrong predictions</a></li><li><a href="https://revistaoeste.com/politica/marcos-cintra-tem-o-perfil-do-twitter-suspenso/">Marcos Cintra’s twitter profile withheld</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b4742425d1e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Copy pfSense acme certificate to another server]]></title>
            <link>https://victorlclopes.medium.com/copy-pfsense-acme-certificate-to-another-server-e42c611c47ec?source=rss-cf31e5ddab06------2</link>
            <guid isPermaLink="false">https://medium.com/p/e42c611c47ec</guid>
            <category><![CDATA[pfsense]]></category>
            <category><![CDATA[lets-encrypt]]></category>
            <category><![CDATA[certificate]]></category>
            <category><![CDATA[scp]]></category>
            <category><![CDATA[copy]]></category>
            <dc:creator><![CDATA[Victor Lopes]]></dc:creator>
            <pubDate>Sun, 24 May 2020 17:56:36 GMT</pubDate>
            <atom:updated>2020-05-25T10:20:33.839Z</atom:updated>
            <content:encoded><![CDATA[<p>If you landed here you have a <strong>pfSense</strong> firewall with the <strong>acme</strong> package installed and you know how great it is.</p><p>I assume that you already know how to issue<strong> Let’s Encrypt</strong> certificates using this module, and you happen to need the certificate files in another server on your network, to be used with a dedicated service somewhere (for TLS/SSL).</p><p>This can be done using <strong>scp</strong>, plus a SSH key and a “Action” hook in the certificate configuration to make this happen every time the certificate is renewed.</p><h4>Here’s a really simple way to copy an acme certificate to another Unix/Linux server, from pfSense:</h4><p><strong>1. </strong>First of all, make sure you have the the “<em>Write ACME certificates…</em>” option enabled in Services &gt; Acme Certificates &gt; General settings:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Pcb65Pws5eg6ArW0rvIcA.png" /></figure><p><strong>2. </strong>Login to your pfSense box using SSH and enter the option <strong>8</strong> (shell). Then issue the following command to generate a private/public key pair:</p><pre>ssh-keygen</pre><p>Press enter to accept the default path and, most important, <strong>do not enter a passphrase</strong>, otherwise we won’t be able to automate the file transfer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/696/1*X_GT0RIsGRvVVwGrrn-WcA.png" /></figure><p><strong>3.</strong> Copy your public key to your destination server, using the following command:</p><pre>ssh-copy-id -i ~/.ssh/id_rsa.pub user@your_destination_server</pre><p>Where “user” is a valid user in your destination server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/1*OG1jfvNEjVM--ipsABT1OQ.png" /></figure><p><strong>4.</strong> Limit permissions on your private key, otherwise scp won’t let you use it:</p><pre>chmod 600 ~/.ssh/id_rsa</pre><p><strong>5. </strong>Test the file transfer:</p><pre>scp -i /root/.ssh/id_rsa /conf/acme/<em>your_cert</em>.crt /conf/acme/<em>your_cert</em>.key /conf/acme/<em>your_cert</em>.fullchain user@destination_server:/<em>path</em>/<em>to</em>/<em>save</em>/<em>cert</em></pre><p>Acme saves every certificate in <strong>/conf/acme</strong>, including various formats, using (as a file name pattern) the certificate subject name you’ve specified in the configurations. Include every file you need in the scp command line, separated by space:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/818/1*J0yZH2iuoujz0kpBr0NZCA.png" /></figure><p><strong>6.</strong> Finally, edit your certificate configuration in Services &gt; Acme Certificates &gt; Certificates and add the exactly same command line (that you just tested above) as an “Action”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G0Zf6SCt1Lj_jJpLqhqrWg.png" /></figure><p>Then renew the certificate in order to test it and check if the certificate files have been correctly replaced in your destination server.</p><p><strong>Off you go!</strong></p><p>Now you can use the certificate files in you internal server. You’ll probably need a scheduled command in that server to apply the certificate to whatever service you’re trying to use it with.</p><p>If all you need on the destination server is a service restart, for example, you could add another “Action” and use an ssh command, like:</p><pre>ssh -i /root/.ssh/id_rsa user@destination_server “service x restart”</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e42c611c47ec" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to manage and customize MailCleaner 2020.01]]></title>
            <link>https://victorlclopes.medium.com/how-to-manage-and-customize-mailcleaner-2020-01-c13bbae12745?source=rss-cf31e5ddab06------2</link>
            <guid isPermaLink="false">https://medium.com/p/c13bbae12745</guid>
            <category><![CDATA[mailcleaner]]></category>
            <category><![CDATA[dkim]]></category>
            <category><![CDATA[logs]]></category>
            <category><![CDATA[spamassassin]]></category>
            <category><![CDATA[mysqldump]]></category>
            <dc:creator><![CDATA[Victor Lopes]]></dc:creator>
            <pubDate>Wed, 20 May 2020 18:42:42 GMT</pubDate>
            <atom:updated>2021-04-14T13:31:36.537Z</atom:updated>
            <content:encoded><![CDATA[<p>This is the third part of a guide on how to install, configure and manage the MailCleaner antispam server.</p><p>In case you missed the other two parts:</p><ul><li><a href="https://medium.com/@victorlclopes/how-to-install-mailcleaner-2020-01-8319c83e11ee">How to install MailCleaner 2020.01</a></li><li><a href="https://medium.com/@victorlclopes/how-to-configure-mailcleaner-2020-01-b916d01db95c">How to configure MailCleaner 2020.01</a></li></ul><p>Now we are going to take a look at the most common management tasks, as well as how to perform some more advanced configuration.</p><h3>Tracing messages</h3><p>The most common thing I do in MailCleaner is tracing an e-mail message to find out how it’s been processed. It’s great for just looking at the latest messages arrived and also excellent for finding a specific delivery that should’ve gotten through, but didn’t, for example.</p><p>If you go to “<strong>Management &gt; Tracing</strong>”, select your domain and just hit “Refresh”, you will see something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z_nI4XzkR7_Utg64QCZlkA.png" /></figure><p>Values in status fields vary between:</p><ul><li><strong>Arrival status</strong>: <em>Accepted </em>or <em>Rejected </em>(and <em>Relayed</em>, if you use outbound)</li><li><strong>Spam status</strong>: <em>spam</em> or “ - ” (not spam)</li><li><strong>Content status </strong>(virus): <em>Detected</em>, <em>Cleaned</em> or “ - ” (nothing detected)</li><li><strong>Deliver status</strong>: <em>Completed,</em> <em>Quarantined</em> or <em>Whitelisted</em></li></ul><p>You can search by date, recipient and sender address.</p><p>If you hover over one “<strong>Rejected</strong>” status, you can see why it was refused:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/1*Ta0cZE1WUFPMX3FT1rf3IQ.png" /></figure><p>And If you hover over the “<strong>Spam status</strong>” field (of any message, not just spam) you can see the <strong>Spamc</strong> (SpamAssassin) <strong>score</strong> for that particular message, as well as which rules had a match:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/532/1*7ZMWEo7aUTUCkVo9e0-qzA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/1*ZKZkhugIQJcTG76Ckb7Y0Q.png" /></figure><p>You can expand any message to see the trace info, containing the result of every stage the message went through:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0lVxF0N55mqO84i9EJlkzA.png" /></figure><h4>Newsletter</h4><p>Since version 2017, MailCleaner has a complementary spam filter tailored to detect newsletters, bulletins, journals, weekly reports, etc. That’s why you see “<strong>Newsl</strong>” in addition to “<strong>Spamc</strong>” when looking at the Spam analysis score for a particular message.</p><p>E-mail messages identified as Newsletter are by default <strong>quarantined</strong> as well. Each user has the ability to “accept” a particular newsletter, which will automatically allow its future occurrences. This is done by logging to the quarantine web interface at <a href="https://your_mailcleaner_name./">https://your_mailcleaner_name.</a></p><h3>Quarantines</h3><h4>Spam quarantine</h4><p>As admin you can see every e-mail that’s been retained as spam. Go to “<strong>Management &gt; Spam quarantines</strong>”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f9TAYDgqgTtKiU0FBkNtiQ.png" /></figure><p>You (or the respective user) can <strong>release</strong> any message to be delivered to its intended mailbox. There’s also a “filter” icon to “Request a filter adjustment”, but all that does is send an e-mail to the admin, indicating that the message is a false positive.</p><p>The quarantine is interesting, because you get to search by <strong>subject </strong>too (in addition to recipient and sender), and you can click a particular message to get a <strong>preview</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*yPG7DMM3Iv3caLPSCzRpJA.png" /></figure><p>The html content is stripped from the original body, so it looks fuzzy, but you get the idea.</p><p>And, better yet, you can expand the respective tab to see the full “<strong>Header</strong>” or a detailed “<strong>Rule score</strong>”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/1*fU1I1YrVQOWqHKALDQG_zw.png" /></figure><h4>Content quarantine</h4><p>The content quarantine follows the same idea, but there you will find messages that were blocked because they contain virus or other known malicious code. You can find it in “<strong>Management &gt; Content quarantine</strong>”.</p><h4>End user quarantine</h4><p>The quarantine web interface available to end users is similar to the Spam quarantine GUI from the /admin interface we just saw, but even more friendly and simple.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*Ian_e46MrCv2wK91OxIRZw.png" /></figure><p>And it has a “<strong>Configuration</strong>” tab where users can define their preferences, including the ability to add an address to his/her own individual whitelist:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/953/1*QbhIWcHDp5J5NaXUc9QBvA.png" /></figure><p><strong>Note:</strong> users can only see quarantined mail and change settings for his own account (e-mail address), as previously explained. If someone has multiple SMTP addresses or needs to control the quarantine of mail-enabled groups, for example, you would have to create a MailCleaner user with the “<strong>hotline</strong>” role for such person (more bellow, on Delegating).</p><h3>Logs!</h3><p>You will find every log you need in “<strong>Monitoring &gt; Logs</strong>”. The nice thing is that you don’t have to access a shell prompt and start hunting log files. You can view them in the web interface or download them. And the web log preview is functional enough, with paging and search.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*ip8BLjz4MNETYKRgLmtrUA.png" /></figure><p>The most useful is the <strong>Incoming MTA</strong> log, where you can spot most of reception issues or check if there is someone trying to brute-force a SMTP password, or another funny business:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nFArGFh5j3vsTMkEJKChOQ.png" /></figure><h3>Delegating administrative access</h3><p>You can create other MailCleaner users in addition to the default <strong>admin</strong>. Access “<strong>Configuration &gt; Accesses</strong>” and click “<strong>New administrator </strong>+”.</p><p>There are three roles:</p><ul><li><strong>hotline</strong><br>Can manage quarantines (release e-mail, etc.) and tracing.</li><li><strong>manager</strong><br>hotline + change configuration of domains (that you specify).</li><li><strong>administrator</strong><br>Just like the admin user, all privileges.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*VdvfhqUXIPssQhyTfixPLA.png" /></figure><h3>Creating your own rules</h3><p>You can change the behavior of <strong>Spamc</strong> by creating a custom configuration file in <strong>/usr/mailcleaner/share/spamassassin</strong> on you MailCleaner server. This will allow you to:</p><ul><li>Write your <strong>own rules</strong> to detect and block e-mail messages that contain some specific characteristics;</li><li>Change the applied <strong>score</strong> for default (already existing) rules;</li><li>Alter configuration <strong>options</strong>, like the “required score” limit, after which a message is considered spam.</li></ul><p>You have to create a file with the <strong>.cf</strong> extension in the provided path. E.g.: /usr/mailcleaner/share/spamassassin/Custom.cf</p><p>I recommend that you use a <strong>SCP</strong> or <strong>SFTP</strong> file explorer such as WinSCP, FileZilla or even Nautilus (that’s the native file manager on Ubuntu) to create and edit this file:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*BZyUR3O8GYvcqu8wDOaPBQ.png" /></figure><p>After you create/edit this file, you have to restart the “<strong>Filtering service</strong>” in “<strong>Monitoring &gt; Status</strong>”.</p><p>I also recommend running spamassassin --lint before restarting the service, to make sure your syntax is OK.</p><p><strong>Syntax</strong></p><p>SpamAssassin rules are written using basically three statements:</p><ul><li>rule type, the most common: header, body and rawbody</li><li>score : to define how many points a message gets if the rule matches</li><li>describe : to briefly explain what the rule means</li></ul><p>And there is the meta statement, to combine rules.</p><p>The header command needs a parameter to define which header <strong>field</strong> we are trying to evaluate, like <strong>From</strong>, <strong>Subject</strong>, etc.<br>What differentiates body from rawbody is that “body” does not include the html code and “rawbody” does. So if you want to search the message body for a specific &lt;a&gt; tag, for example, you have to specify rawbody.</p><p>Then, the evaluation is usually done using <strong>regex</strong>. I recommend Regex 101 <a href="https://regex101.com/">https://regex101.com</a> to write and test your regex syntax.</p><p>So here are a few examples:</p><pre>rawbody   GOOGLE_APIS   /https?:\/\/storage\.googleapis\.com/i<br>score     GOOGLE_APIS   1.5<br>describe  GOOGLE_APIS   Has a hyperlink that points to Google APIs</pre><pre>header    DOMAIN_NUM    From =~ /\@[\w-+=\.]*\d{2,}[\w-+=\.]*/<br>score     DOMAIN_NUM    1.0<br>describe  DOMAIN_NUM    Domain name has 2 or more numbers</pre><pre>header    LONG_SUBJECT  Subject =~ /.{120,}/<br>score     LONG_SUBJECT  0.8<br>describe  LONG_SUBJECT  Subject line is very long</pre><p><strong>Note:</strong> your regex must be enclosed in slashes to be treated as regex.</p><p><strong>Required score</strong></p><p>You might want to change the score limit after which a message is treated as Spam. This can be done by adding the following option to your custom.cf file:</p><pre>required_score 4.0</pre><p>The default is <strong>5.0</strong>. But I usually find it a little high and many spam messages get through with a score between 4.0 and 5.0. Another approach is to increase or decrease the score on default SpamAssassin rules to improve chances of catching spam and reducing false positives, considering your scenario.</p><p>A good strategy is to monitor your messages in Tracing and try to see which rules match more often in the spam messages you usually get, and then declare these rules in your custom.cf file with a higher score, like this: <br>score NAME_OF_RULE 2.0 (just the score statement is enough)</p><p><strong>Sample Custom.cf</strong></p><p>Here I leave a sample for you, already with some goodies in it:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3d375e2ecf31873c39923b5fb6ac54b5/href">https://medium.com/media/3d375e2ecf31873c39923b5fb6ac54b5/href</a></iframe><p>And some references:</p><ul><li><a href="https://support.mailcleaner.net/boards/3/topics/51-how-to-create-custom-spamc-rules">MailCleaner Support</a></li><li><a href="https://cwiki.apache.org/confluence/display/SPAMASSASSIN/WritingRules">Apache Software Foundation</a></li></ul><h3>Use MailCleaner for outbound e-mail</h3><p>There are a few reasons why you might want to relay your outbound mail through MailCleaner. In a common scenario, this is not needed, because your mail server can perfectly send your mail to it’s destination, either directly, using MX records, or by an external relay (if you have or subscribe to one).</p><p>But you may find use for this if you want to:</p><ul><li><strong>Sign your e-mail with DKIM</strong> (if your mail server doesn’t natively support it, like Microsoft Exchange);</li><li><strong>Have your traffic logs in one place </strong>(e.g.: see everything in MailCleaner’s Tracing)</li><li><strong>Scan your outgoing mail for viruses</strong></li></ul><h4>Authorizing relay</h4><p>All you need to do is: go to “<strong>Configuration &gt; SMTP &gt; Connection control</strong>” and add the IP address(es) of your internal mail server to “<strong>Allow external relaying for these hosts</strong>”. Then click “Submit” and restart the MTA service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*ynjcUKG9Quz0AFKe-iXzhQ.png" /></figure><h4>Public DNS records and EHLO/HELO name</h4><p>If you’re sending e-mail messages from MailCleaner directly to their destinations, you sure need to take care of <strong>SPF</strong> records for your domains. And you need to ask your ISP to configure the right <strong>PTR</strong> record for the public IP you’re using for your MailCleaner, so a reverse DNS lookup on that IP would resolve to the hostname you’ve chosen to use with your MailCleaner server.</p><p>Also, you probably want to define the exact name (your hostname) that you want MailCleaner to use while talking to other mail servers, I mean, the name presented when sending a EHLO smtp command. This hostname is included in the “SMTP banner” and must match the reverse DNS value (PTR) of your public IP. This is done on <strong>Configuration &gt; Base system &gt; DNS settings</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*yZ2s1Xe_Q9-FqYBuEmXAYQ.png" /></figure><h4>Send mail to an external relay</h4><p>If you already use an external relay (<strong>smarthost</strong>), either for IP reputation or other reasons, you can tell MailCleaner to also relay through it (mail server -&gt; MailCleaner -&gt; external relay).</p><p>However, <strong>MailCleaner doesn’t support authenticating</strong> against the relay (smarthost), which can be a deal breaker for you. Your relay service would need to have the flexibility of allowing an IP address (your IP) as a trusted source, for example.</p><p>If you need this feature, it’s available in the domain properties, on the “<strong>Outgoing relay</strong>” section. You have to check “<strong>Use a smarthost to relay to</strong>”, save your settings, then fill in the smarthost server and port and save again.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/880/1*pMudEzDlkJ-ONDgtdMaEHQ.png" /></figure><p>E-mail messages sent by MailCleaner will appear in Tracing too, with a status “<strong>Relayed</strong>”. You can expand the trace info to make sure the message is being treated the way you expect.</p><h4>DKIM</h4><p>DKIM signatures are a nice feature and, if you don’t have it in your domain yet, you should consider configuring it right away. Coupled with SPF, it helps people know that the e-mail messages they’re getting are really coming from you. If you want MailCleaner to sign your outbound messages using DKIM, <strong>it’s quite simple</strong>.</p><p>To implement DKIM you need:</p><ul><li>A DKIM compatible service in your mail infrastructure that can sign the header of e-mail messages;</li><li>A simple and friendly name to use as “Selector”;</li><li>A public-private RSA key pair;</li><li>A new TXT record in your public DNS zone;</li></ul><p>But MailCleaner takes care of almost all of that for you. In “<strong>Configuration &gt; Domains</strong>”, select your domain and change the section to “<strong>Outgoing relay</strong>”. Then:</p><ol><li>Change “<strong>DKIM signing</strong>” to: <em>This domain (yourdomain.com)</em></li><li>Fill in a “<strong>Selector</strong>” name of your choice (lower case letters, no special characters, please). Suggested name: <strong><em>default</em></strong></li><li>Click in “<strong>Generate new private key</strong>”</li><li>Click “Submit” to save it</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*6dfTDYQ36x9JBqLL1gg0xQ.png" /></figure><p>After you save, this nice box appears with your <strong>public key </strong>and the correct syntax for creating the proper <strong>DNS record</strong> in your domain:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*tc1Gkv_zoB41UbEDLdotxw.png" /></figure><p>Now you have to access your public <strong>DNS </strong>service, and in your domain/zone:</p><ol><li>Add a new record of type <strong>TXT</strong></li><li>Type the name of the record, that should be: <strong><em>yourselector</em>._domainkey<br></strong>(e.g.: default._domainkey)</li><li>In the value of this record, paste the DKIM record contents that MailCleaner has generated for you (that starts with v=DKIM;). Do not copy the quotes. In our example above, the value would be:</li></ol><pre>v=DKIM1;k=rsa;p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC3ehTi2ePCRPCsD9mH8+WUqHJCwZEyHnHjA+eJy7dOS/xLSE8JFbYk+hGjzQCxwJnTC8SCA88vqiiBcRtAG+x5YHvHRDka7NibLwjvI+Qd2sK1Gu3u5dK2rproN3YLG3MHTrqJ6uuw7G12d5+ltHBpnAZeq4wEErnjL7gjFVjUVwIDAQAB</pre><p>Be careful not to include any line breaks or quotes. Save it and let the DNS record propagate. All set!</p><p>You can test the DKIM record using these online tools:</p><ul><li><a href="https://mxtoolbox.com/dkim.aspx">https://mxtoolbox.com/dkim.aspx</a></li><li><a href="https://www.mail-tester.com/spf-dkim-check">https://www.mail-tester.com/spf-dkim-check</a></li></ul><p>And you can test the whole singing and validation process using this great tool:</p><p><a href="https://dkimvalidator.com/">https://dkimvalidator.com</a></p><h4>Altering the SMTP banner</h4><p>You might want to change the welcome message that the incoming MTA presents to connecting servers. This could be a good idea, because the less information about your infrastructure you offer publicly, the better (like your antispam software and version).</p><p>The default banner is: 220 <em>&lt;yourdomain.com&gt;</em> ESMTP MailCleaner (Community Edition <em>&lt;current version&gt;</em>) <em>&lt;the current date and time zone&gt;</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/1*Pwmej9egblnoynTCOb3mjg.png" /></figure><p>In reality, the exact banner value on <strong>Exim</strong> configuration in MailCleaner is (edition and version is resolved during service startup):</p><pre>$smtp_active_hostname ESMTP MailCleaner (Community Edition 2020.01) $tod_full</pre><p>If you want to change that, modify the file <strong>/usr/mailcleaner/etc/exim/exim_stage1.conf_template</strong> and replace the string __SMTP_BANNER__ , but make sure to keep the variables <em>$smtp_active_hostname</em> and <em>$tod_full</em> (and their respective positions):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/542/1*EFN0iGekAZb8pJPHIvN7qQ.png" /></figure><p>Your <strong>smtp_banner </strong>option could look like this, for example:</p><pre>smtp_banner = $smtp_active_hostname ESMTP <em>Your_Company</em> $tod_full</pre><p>After saving this file, restart the “<strong>Incoming MTA</strong>” service. Keep in mind that this value can be replaced (back to default) during product updates. There is also a value for this in MailCleaner’s database, but it seems to be left out (it’s not taken into consideration and doesn’t define anything). Let’s hope the developers create an option for this in the GUI.</p><h3>Prevent virus-detected messages from being delivered</h3><p>For some reason, the virus scan engine gives you only the option “<strong>Drop known viruses silently</strong>”. Then when a messages has a virus in the attachments, for example, MailCleaner deletes the virus and delivers the message to its intended recipient with a prepended “Attention Virus” in the subject.</p><p>If you also think this is not desirable, because these are likely scam messages and users should not get such e-mail in any way, here’s how to change this behavior:</p><ol><li>Access your MailCleaner server using SSH, or through the console</li><li>Edit the file <strong>MailScanner.conf_template</strong>:<br>nano /usr/mailcleaner/etc/mailscanner/MailScanner.conf_template</li><li>Then locate <strong>Deliver Cleaned Messages</strong> and change it to <strong>no</strong>.<br>The file it’s quite big, so you might want to use Ctrl + W to search.</li><li>Save it (Ctrl + X) and restart the MailScanner service:<br>/usr/mailcleaner/etc/init.d/mailscanner restart</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*2Pj8aTb_EkZv7CnwmYuzxA.png" /></figure><p>Reference: <a href="https://forum.mailcleaner.org/viewtopic.php?f=12&amp;t=2296&amp;p=9965#p10116">https://forum.mailcleaner.org/viewtopic.php?f=12&amp;t=2296&amp;p=9965#p10116</a></p><h3>Loading Whitelist entries in the DB</h3><p>This is just a quick tip. You may already have a list of trusted domains somewhere that you want to add to your whitelist. This could be tedious because MailCleaner doesn’t have a import/export feature for whitelist entries yet.</p><p>The table that holds these records is called <strong>wwlists</strong>. You can access the MySQL database, like we’ve seen before, using:</p><pre>/usr/mailcleaner/bin/mc_mysql -m</pre><pre>use mc_config;</pre><p>The syntax for inserting into this table is:</p><pre>INSERT INTO wwlists (sender, recipient, type, expiracy, status, comments)</pre><pre>values</pre><pre>(&#39;*@trusted.com&#39;, &#39;@yourdomain.com&#39;, &#39;white&#39;, &#39;0000–00–00&#39;, 1, &#39;-&#39;),<br>(&#39;*@another.net&#39;, &#39;@yourdomain.com&#39;, &#39;white&#39;, &#39;0000–00–00&#39;, 1, &#39;-&#39;),<br>(&#39;*@keepgoin.ca&#39;, &#39;@yourdomain.com&#39;, &#39;white&#39;, &#39;0000–00–00&#39;, 1, &#39;-&#39;);</pre><p>Remember that the whitelist is per domain configuration. I recommend that you first add a few addresses manually using the admin web interface, and run a SELECT * FROM wwlists limit 5; for example, to have an idea of how this works.</p><p><strong>Note:</strong> there’s also a script in /usr/mailcleaner/tools/insert_bulk_wwlists.sh if you want to take a look.</p><p><strong>Using mysqldump</strong></p><p>If you want to use mysqldump for some of this, here is a sample of how to use it with MailCleaner (maybe you’re migrating from another server, or want a backup):</p><pre>/opt/mysql5/bin/mysqldump -S /var/mailcleaner/run/mysql_master/mysqld.sock -umailcleaner -p<em>YourMCdbPassword</em> mc_config wwlists &gt; /root/dump_wwlists.txt</pre><p><strong>Note</strong> that mysqldump includes “DROP table” statements in the dump file, so it’s dangerous to just use this file later without verifying/modifying the code.</p><h3>Clustering</h3><p>MailCleaner has the ability to form clusters, with a master-slave approach. It’s not a cluster in a sense that two servers will share the same IP address for high availability or something like this. It’s more like a synchronization of files and database content to provide a central place for management, plus extend the number of MX servers you can have for mail reception, which provides redundancy. And you can have your servers in different locations (given that you take care of the necessary traffic between them).</p><p>You can have one <strong>master server</strong> and a number of <strong>slave servers</strong>. After you form a cluster, the configuration <strong>can only</strong> be changed in the master server. And the end user interface for accessing the <strong>spam quarantines</strong> will only be available at the master server too.</p><p><strong>We’re not going to cover clustering here</strong>. I’ll just point you in the right direction. You need to have a significant mail income, different sites, or a tight availability requirement in order to demand a cluster.</p><p>The setup of a MailCleaner cluster is done using the following script in you MailCleaner server:</p><pre>/usr/mailcleaner/scripts/configuration/slaves.pl</pre><p>Here are some references:</p><p><a href="https://support.mailcleaner.net/boards/3/topics/15-configure-a-loadbalancing-cluster">MailCleaner Support</a></p><p>Topic about cluster nodes in different locations: <a href="https://forum.mailcleaner.org/viewtopic.php?f=2&amp;t=2927&amp;p=12243#p12229">https://forum.mailcleaner.org/viewtopic.php?f=2&amp;t=2927&amp;p=12243#p12229</a></p><h3>Security concerns</h3><p>Servers connected to the Internet are never safe, as you know. Hacker groups are always trying their luck exploiting vulnerabilities on web servers, mail servers and alike.</p><p>Recently a security flaw was found on Exim, that could allow an attacker to execute code remotely and take control of the target server (or at least take it down). The breach has already been patched and you can find out more <a href="https://nvd.nist.gov/vuln/detail/CVE-2019-16928">here</a> and check the bulletin here: <a href="https://www.exim.org/static/doc/security/CVE-2019-16928.txt">CVE-2019–16928</a>. What draws attention in this type of case is how specific and obscure the code fault is, in despite of how careful the development team might be, and how helpless your server is when exploited this way.</p><p>So you need to make sure you:</p><ol><li><strong>Keep you server up to date</strong>, <strong>fully patched</strong>. MailCleaner does that automatically, but is a good idea to check from time to time. The admin home page shows latest news on updates and in the “Monitoring &gt; Status” you can see the patch level.</li><li><strong>Couple your MailCleaner installation (and any other published server) with a good firewall solution</strong>, that can block connections based on “GeoIP” and “whois” (ASNs), for example, among other things.</li><li><strong>Monitor the Incoming MTA log</strong> and search for things like “incorrect authentication” or simply “error” to spot problems and malicious connections. Run offending IPs against tools like:<br>- <a href="https://mxtoolbox.com/asn.aspx">MXToolBox</a> (IP to ASN and subnet list)<br>- <a href="https://dnschecker.org/ip-location.php">DNS Checker</a> (IP location) <br>- <a href="https://dnschecker.org/asn-whois-lookup.php">DNS Checker</a> (ASN Whois)<br>- <a href="https://www.ultratools.com/tools/asnInfo">UltraTools</a> (ASN quick info, including country)<br>and then block connections originated from that whole country, if you’re not expecting to receive e-mail from it, or at least block that particular AS number, for example. It’s a good idea to block connections from <a href="https://www.spamhaus.org/statistics/countries/">top spammer countries</a> (or some of them, depending on your needs, of course).</li></ol><h3>Conclusion</h3><p>We’ve reached the end! As you can see, MailCleaner is a complete antispam solution and I’m happy to share all this information with you. The VMs available are a bit outdated right now and Debian 8 Jessie is in “End of life”, so we’re waiting for new versions and when they release something I’ll try to update this content. We have news that a new release is on its way, as per <a href="https://forum.mailcleaner.org/viewtopic.php?f=2&amp;t=3043&amp;p=12673">this post</a>, but it’ll take some time due to the complexity of the product and the fact that this is a Community edition. Also, if you like the software, please <a href="https://www.mailcleaner.org/donate/">consider donating</a>, or trying the Enterprise edition, and post your opinion on some websites like <a href="https://www.capterra.com/p/93208/MailCleaner/reviews/">Capterra</a>, <a href="https://sourceforge.net/projects/osmailcleaner/reviews">Source Forge</a> and <a href="https://community.spiceworks.com/products/14377-mailcleaner-spam-gateway">SpiceWorks</a>. If you have any doubt or suggestion, please leave a comment. Let me know if I forgot something.</p><p>Cheers,</p><p>Victor.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c13bbae12745" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to configure MailCleaner 2020.01]]></title>
            <link>https://victorlclopes.medium.com/how-to-configure-mailcleaner-2020-01-b916d01db95c?source=rss-cf31e5ddab06------2</link>
            <guid isPermaLink="false">https://medium.com/p/b916d01db95c</guid>
            <category><![CDATA[rbl]]></category>
            <category><![CDATA[mailcleaner]]></category>
            <category><![CDATA[blacklist]]></category>
            <category><![CDATA[antivirus]]></category>
            <category><![CDATA[quarantine]]></category>
            <dc:creator><![CDATA[Victor Lopes]]></dc:creator>
            <pubDate>Wed, 20 May 2020 18:39:39 GMT</pubDate>
            <atom:updated>2020-09-30T10:09:32.909Z</atom:updated>
            <content:encoded><![CDATA[<p>This is the second part of a guide on how to install and manage a MailCleaner antispam server. In the first part we covered installation and initial setup.</p><p>If you didn’t see it yet, check it out:</p><p><a href="https://medium.com/@victorlclopes/how-to-install-mailcleaner-2020-01-8319c83e11ee">How to install MailCleaner 2020.01</a></p><p>I’ll lead you through the most typical options that you need to get started. We’ll cover some other advanced features later.</p><h3>Basic server configuration</h3><p>Now that you have your MailCleaner box up and running, login to your <a href="https://your_mailcleaner_name/admin">https://your_mailcleaner_name/admin</a> web interface to start configuring it.</p><h4><strong>1. Registration</strong></h4><p>When you login you will see a warning saying your installation is not registered. “Click here to resolve” and go through the registration. It’s free and simple.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*udS4ZbolQWNEfZUoLlmqJw.png" /></figure><p>This will lead you to “<strong>Configuration &gt; Base system &gt; Registration</strong>”. Unless you have an Enterprise Edition, scroll all the way down and you’ll see the Community registration:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/1*3ocXQT5MBCLacbtbtgO16A.png" /></figure><h4>2. <strong>Network and region</strong></h4><p>In the same section, define these other settings according to your scenario (navigate through the left menu):</p><ul><li>Network</li><li>DNS settings</li><li>Localization (time zone)</li><li>Date and time</li></ul><p><strong>Note: </strong>Don’t use public DNS servers like Google DNS (8.8.8.8), otherwise you will have problems querying blacklists (RBLs).</p><p>And don’t forget to <strong>disable</strong> the “configurator interface” (192.168.1.42). If you need to change your IP address, do it first and save it. After you have successfully defined the main IP, then disable the configurator IP:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*3LUb9Y3uk5yQkg_Y7oYQVg.png" /></figure><h3>SMTP settings</h3><h4>1. <strong>Configuration &gt; SMTP &gt; SMTP checks</strong></h4><p>In this section you can set which basic verifications you want performed against other mail servers trying to deliver to you, such as SPF, reverse DNS, Blacklists (RBLs), etc. Here’s a suggestion of how to set these options:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*bdyG26F90bdwIuDiOreC_A.png" /></figure><p>There are other stages where you can set <strong>Blacklist</strong> checking, as you will see later. At this point I recommend just Barracuda Central and Spam Haus, because those are the the ones I usually never have false positives.</p><p>TLS/SSL settings have already been done in the first part of this guide. You can take a look at other options available using the left menu, but we are not going to discuss them for now.</p><h4>2. <strong>Restarting services</strong></h4><p>You will soon find out that most changes need one or more services to be restarted:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*kV3KGXXzEY-rrHLcqmsZyg.png" /></figure><p>If you “Click here to resolve” you will be sent to the “<strong>Monitoring &gt; Status</strong>” page. You can make a number of changes and wait to restart the services at once in the end.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VaLe01m0KEYZz328s4yySQ.png" /></figure><h3>Anti-Spam features</h3><h4>1. <strong>Configuration &gt; Anti-Spam &gt; Global settings</strong></h4><p>MailCleaner has a number of antispam software and techniques available. They are processed in order and you can change which one will come first or later and if they will have a decisive role in stopping an e-mail message. I usually leave the default order.</p><p>Here I only recommend that you “<strong>Enable access to whitelists</strong>”. But don’t add any addresses to it yet:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*iNkiLTQvXmadJiSOhRYIMQ.png" /></figure><h4>2. <strong>Configuration &gt; Anti-Spam &gt; 4 - PreRBLs</strong></h4><p>Here you have another level of blacklist checking. Deselect <em>b.barracudacentral.org</em> and <em>zen.spamhaus.org</em>, because we’ve already have them enabled at the “SMTP checks”. Here’s my suggested configuration:</p><p>I had some false positives with Sorbs and UceProtect level 3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*WqXMhwpM3BgoXpl97F8egQ.png" /></figure><p><strong>“SMTP checks” blacklists vs “Anti-Spam &gt; PreRBL” blacklists</strong></p><p>When a host connects to your MailCleaner server trying to deliver, and said host is listed in one of the RBLs defined in “<strong>SMTP checks</strong>”, this connection will be refused and the message delivery attempt will show as “<strong>Rejected</strong>” in your lists.</p><p>That’s why only the most trustworthy RBLs should be checked during that stage.</p><p>If that host passes the RBLs set in SMTP checks (plus the other basic checks, of course), the message will be “<strong>Accepted</strong>” and then the list of evaluations defined in this “Anti-Spam” section begins.</p><p>When the host that delivered a message is found in a RBL that’s configured inside this “<strong>Anti-Spam &gt; PreRBL</strong>” section, such message will be marked as “<strong>spam</strong>” and will (by default) be quarantined.</p><h4>3. <strong>Configuration &gt; Anti-Spam &gt; 5 - UriRBLs</strong></h4><p>URI blacklists are great, you should let them all enabled:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*nYQ5AijHAfLO0GaJMGKY0A.png" /></figure><h4>4. <strong>Configuration &gt; Anti-Spam &gt; 6 - Spamc</strong></h4><p>By <strong>Spamc</strong>, read <strong>SpamAssassin</strong> (by Apache). Here we have to basically <strong>deselect</strong> every Uri RBL and almost every DNS RBL, because we have them enabled in previous modules:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*DWy94TZe6tthF0woHkkBng.png" /></figure><p>The most great contribution SpamAssassin has to give us in MailCleaner is the heuristic analysis, which we will see in a more advanced topic.</p><h3>Content protection</h3><h4>1. <strong>Configuration &gt; Content protection</strong></h4><p>In this section we have mostly attachment inspection options, including <strong>virus</strong> scan. Anti-virus protection is provided by ClamAV. There is no much to be changed here. Just familiarize yourself with the features, in case you want to block a file extension in the future, for example.</p><h3>Domains</h3><p>To start receiving and filtering e-mail you must create a domain. This will define your accepted domain names, as well as how e-mails should be treated when belonging to it, including whitelists, quarantine authentication, etc.</p><p>You should create a “domain” for each e-mail domain name you have that needs a <strong>different</strong> configuration. Domain names that you treat as one should be set as “alias” (e.g. yourdomain.com and yourdomain.net).</p><h4><strong>1. Create your domain</strong></h4><p>Just click “New domain +”, type your domain name (the main one, if you have more than one) and click “Submit”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*4ao7inJ141laMQPyM99kiw.png" /></figure><p>Then type your other domain names in “Aliases” (if they just represent the same domain), and provide some contact information if you want. Click “<strong>Submit</strong>” before going to the next step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/675/1*1aiaZbWwqF7EtLnHlOVnyA.png" /></figure><p>Then click “<strong><em>Next step &gt;&gt;</em></strong>” in the upper right corner and define your <strong>mail server</strong>, where messages should be delivered after inspection:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/695/1*YqVrCVfuUecDveTbOag0EA.png" /></figure><p>If you have more then one mail server (or more then one Transport server role in an Exchange organization, for example), add each one in a new line. If that’s the case you can choose if e-mails will be delivered to all mail servers (round robin style) or if the first will be used by default and the other one(s) as a failover only.</p><p>Submit settings before testing destinations.</p><p>If you click “Next step &gt;&gt;” again, you see about “<strong>Address verification</strong>”. You can use LDAP (query the mail field of users) or SMTP (try to deliver to your mail server and check if the <em>rcpt to</em> really exists).</p><p>I usually leave it as “<strong>none</strong>”, to avoid delaying mail reception, as I don’t see so much value in testing the addresses beforehand. If a spammer is trying to deliver e-mail to random users that don’t exist in your domain, such attempt will probably be caught in another inspection method.</p><h4>2. <strong>Default preferences</strong></h4><p>Click “Next step &gt;&gt;” again and you will land on “Preferences”. Select the default <strong>language</strong> for user reports (there are many languages to choose from). I recommend the “Summary frequency” to stay as “<strong>weekly</strong>” and the “Action on spams” to remain as “<strong>quarantine</strong>” (of course).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/677/1*m9rMHEqnU2VmX4FDvMZYbw.png" /></figure><p>The summary is a nice html report that MailCleaner sends to each user (if that user has e-mail messages quarantined), and it looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gvxdPh2C4y3daXSew9Z6JA.png" /></figure><p>You can click on each “arrow” icon on the left of a respective message to release it (it will be delivered to you right away).</p><h4>3. <strong>Quarantine user authentication</strong></h4><p>Here is a nice little thing. Since MailCleaner has a web interface available to end users, you can set how they are going to be authenticated to access it.</p><p>By the way, the <strong>quarantine address (end user interface)</strong> is MailCleaner’s root web path. Users should go to <a href="https://your_mailcleaner_name/"><strong>https://your_mailcleaner_name</strong></a> and they will land on the login page.</p><p>Some of the authentication protocols available are: LDAP/Active Directory, IMAP, SMTP, RADIUS and more.</p><p>Authentication against a Microsoft Active Directory domain controller will be something like the following configuration. Note the “Bind user” has to be a distinguished name.</p><p>You can use SSL if you had that set up or if you have an Enterprise Root CA.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*0XSm5RK42sQ2vNDp6_FJ1g.png" /></figure><p>Remember: submit your settings before testing.</p><p><strong>Note about user alias, authentication and access to quarantined mail</strong></p><p>A user can only access quarantined e-mail or configurations for an account that <strong>matches his user <em>alias</em></strong> exactly. I mean, if you have a user whose account is “john.smith” and he authenticates on MailCleaner (against AD, for example), he can only see quarantined messages that were to be sent to “john.smith@yourdomain.com”.</p><p>MailCleaner has no way of knowing if such user has more than one SMTP address or that his account name is different from his e-mail alias. But if you do have <strong>aliases</strong> set up in your domain configuration (e.g. domain.com / domain.net) the user <strong>can switch</strong> between those after authenticating.</p><p>If you have a situation like this, you can try to workaround it by using a different field as “User attribute” (instead of samAccountName) or by creating a local account in the MailCleaner with the privilege of managing SPAM quarantines for specific domains.</p><p>However, if a user owns a specific SMTP address, or belong to a mail-enabled group, and there are quarantined e-mail destined to those addresses, that user <strong>will</strong> receive the html summary report by e-mail and he/she can click to release a message, for example.</p><h4>4. <strong>Filtering options</strong></h4><p>Clicking “Next step &gt;&gt;” once more will get you to “Filtering”, where you can, among other things, enter trusted domains and addresses to the <strong>whitelist</strong>.</p><p>“Reject unauthorized messages from this domain” is important to prevent spoofing.</p><p>“Reject unencrypted SMTP sessions to this domain” is dangerous, because there are still some crazy e-mail providers that still don’t send messages using an encrypted connection by default.</p><p>You have to mark “Enable whitelists” and submit your settings first for the whitelist controls to show up. Addresses added to this list will<strong> not be quarantined</strong>, even if it’s considered spam. But keep in mind that the sender server needs to pass the <strong>basic SMTP checks</strong> nonetheless (SPF, etc.).</p><p>Note that the correct syntax for adding an entire domain is <strong>*@domain.com </strong>You can add a complete address too (someguy@trusted.com).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*K-QamVc-UBepSorVZ9iTnQ.png" /></figure><p><strong>About greylisting</strong></p><p>I used greylisting for a while, but now I don’t recommend it.</p><p>Although it is a fabulous method for preventing SPAM, nowadays we have some giant e-mail providers like Microsoft (Office 365/Exchange Online) that every time they try to send you an e-mail and you don’t accept it straight away, it will try to send the same message using another server, and then another server and so on.</p><p>This means that most of their mail servers (trying to deliver) will almost never pass the greylisting check, because it’s never the same server. And if it is the same one eventually, it will probably be outside the time window limit that the greylisting engine tolerates for re-tries.</p><p>If you do want to use it, though, because is such a great feature, keep in mind that you will have to enter a lot domains in the greylisting exception list on “Configuration &gt; SMTP &gt; Greylisting”.</p><p><strong>About whitelisting</strong></p><p>Some say whitelists are dangerous because someone could spoof a domain and a malicious message could pass through. The way I see it, this is nonsense, considering that you have SPF checks and other basic verifications. Besides, your users won’t let you live without whitelists, because false positives will occur and you will need to register a domain as trusted sender.</p><p>You also might be asking yourself why we enter whitelist addresses here in the domain configuration and not in the global control there in “Configuration &gt; Anti-Spam &gt; Global settings”. Well, the answer is simple and a bit sad: the global whitelist you see there does not work as you expect and the best way to add a trusted sender is in the domain settings. More about whitelists in a future topic.</p><h3>General settings</h3><p>Finally, the last step in this initial configuration is to set the default behavior for tasks and the web interface, plus some contact information.</p><p>Go to “<strong>Configuration &gt; General settings</strong>”.</p><p>Navigate through the left menu options. I recommend that you set:</p><ul><li>The default GUI language for end users, and your “Default domain”.</li><li>Your contact name and e-mail address</li><li>The “Spam retention”, that is defined in days (default: 60)</li><li>Periodic tasks. The day of week and the time of day will define, for example, when users will receive the quarantine html summary report</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/883/1*QHQdmabF9BHINQNhHxI-Yg.png" /></figure><h4>Looking good!</h4><p>You can now redirect your inbound SMTP traffic to your MailCleaner IP address and take a look at “<strong>Management &gt; Tracing</strong>” to see how e-mail messages are being processed.</p><p>If you find some error you want to investigate, check out “<strong>Monitoring &gt; Logs</strong>”. And of course you can take a look at the MailCleaner forum, at <a href="https://forum.mailcleaner.org/">https://forum.mailcleaner.org</a> .</p><p>Now we have the third and last part of this guide, that will cover management and customization. Keep going:</p><p><a href="https://medium.com/@victorlclopes/how-to-manage-and-customize-mailcleaner-2020-01-c13bbae12745">How to manage and customize MailCleaner 2020.01</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b916d01db95c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to install MailCleaner 2020.01]]></title>
            <link>https://victorlclopes.medium.com/how-to-install-mailcleaner-2020-01-8319c83e11ee?source=rss-cf31e5ddab06------2</link>
            <guid isPermaLink="false">https://medium.com/p/8319c83e11ee</guid>
            <category><![CDATA[mailcleaner]]></category>
            <category><![CDATA[install]]></category>
            <category><![CDATA[spam]]></category>
            <category><![CDATA[lets-encrypt]]></category>
            <category><![CDATA[antispam]]></category>
            <dc:creator><![CDATA[Victor Lopes]]></dc:creator>
            <pubDate>Wed, 20 May 2020 18:36:58 GMT</pubDate>
            <atom:updated>2020-09-30T10:09:41.411Z</atom:updated>
            <content:encoded><![CDATA[<p>Mailcleaner is an antispam system to call yours. Many companies have jumped into Office 365 or Google G-Suite, but for those brave warriors out there who still host their own mail server, here’s a good way of filtering SPAM and protecting your network from e-mail viruses and scams.</p><p><strong>Why MailCleaner?</strong></p><p>Mailcleaner is the best open source antispam solution I’ve ever found, for three main reasons:</p><ul><li>It has a nice compilation of well-known software, plenty of features;</li><li>It’s flexible, with a complete web GUI and the possibility of customizing the underlying applications;</li><li>Most important: it has a user quarantine interface, where employees can release their own retained mail, add an address to his own white list, etc.</li></ul><p>But the installation and configuration of MailCleaner has its oddities and this guide will help you keep your sanity during the process.</p><p>This is a comprehensive compilation and, after finishing this tutorial, you will have both a nice functioning antispam server and a good understanding of MailCleaner’s features.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/841/1*x7iqhp46yfh9lWRLaruq3w.png" /></figure><h3><strong>Installing MailCleaner</strong></h3><p>The current version is based on Debian 8 Jessie and is distributed as ready-to-go virtual machines. What you’ll need:</p><ul><li>A hostname by which your antispam web page will be accessed;</li><li>A valid (publicly trusted) SSL/TLS certificate. If you don’t have one, or prefer using Let’s Encrypt, this will be covered in this guide;</li><li>Proper rules in your firewall to redirect SMTP and web traffic to your antispam box. When using Let’s Encrypt, you will have to make sure the MailCleaner server can be reached by TCP port 80 using every hostname you’ve chosen. You know the drill.</li></ul><p>Here’s the download page for you to choose your flavor:</p><p><a href="https://www.mailcleaner.org/latest-downloads/">Latest downloads - MailCleaner - Open source Anti spam &amp; Antivirus gateway</a></p><p>I’ll be using Hyper-V (vhdx), but the instructions can be easily adapted to VMware or another platform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*VBtfsg1rLiqpbTzdkKBJWw.png" /></figure><ol><li><strong>Download and unzip the file</strong> (MailCleaner_VHDX_2019022601.zip);</li><li><strong>Create your new VM</strong> (Generation 1, not UEFI);<br>Recommended specs are: 4 vCPUs, 4GB of RAM.<br>As per the Hyper-V version, anything from Windows Server 2012 R2 and on will be fine.</li><li><strong>Attach the vhdx</strong> and that’s it;</li><li><strong>Power on</strong> and let it stew for a while.</li></ol><p>Seriously, I recommend that you let the VM initialize and just let it be for 30 minutes or so. Go do something else. The server will have time to start every service it wants, update anything it wants, etc.</p><h3><strong>Initial configuration</strong></h3><p>The Mailcleaner version in this VM is 2018.12. That’s OK, it will update itself to the latest available version later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*2LOJlRInmkVVLFKD2Pmzmg.png" /></figure><ol><li><strong>Login as root</strong>.<br>Every password is set to <strong>MCPassw0rd</strong> (root, mysql, web admin, etc.)</li><li><strong>There’s a initial setup script</strong> that offers you a few options.<br>You can set your keyboard layout here and the server’s IP address.<br>You can change the IP later using the web interface too. Don’t bother changing the root password now, because the deployment wizard will force you to do it later.<br>You can run this script anytime by executing: /usr/mailcleaner/scripts/installer/installer.pl</li><li><strong>Define the server’s hostname</strong> and point your main host (fqdn) to localhost to avoid name resolution problems locally (make sure you have this name valid in your DNS servers too):<br>nano /etc/hostname<em> </em>and type the server name you want (Crtl + X to save)<br>nano /etc/hosts<em> </em>and add the server names like this, for example:<br>127.0.0.1 localhost myserver myserver.mydomain.com</li><li>At the shell prompt, run:<br>touch /var/mailcleaner/run/configurator/updater<br>This will prevent the update loop that sometimes happens (usually happens, if you ask me) in the deployment wizard later, in which the updates are never recognized and you can’t proceed.</li><li>Access <a href="https://your_mailcleaner_ip:4242/"><strong>https://your_mailcleaner_ip:4242</strong></a><strong> </strong>to run the deployment wizard<br>Follow the steps, it’s quite simple.</li></ol><ul><li>Just remember: every initial password is MCPassw0rd</li><li>At the second page (updates) you may see a “Warning: touch(): Utime failed” error. Just ignore it.</li><li>For root and MySQL passwords, only letters and numbers are allowed (for some reason). You can change the root password manually later to whatever you like.</li><li>At “host ID” we usually put 1, if this is the first and/or the only box in the network.</li><li>In “Base URL” you should put the full hostname you’re going to use to access the web interface (the main host you’ve set as <em>myserver.mydomain.com </em>in step 2).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BHefu7TkItvB6LxghpWzUQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a0ZFAWVnAfe3A2C_Pl80DQ.png" /></figure><p>At the end of the wizard it tells you that all services will be restarted within 15 minutes. Click the “8. [Mandatory] Close…” button and wait before proceeding, as instructed.</p><p><strong>Note:</strong> at this point you should be able to SSH into your server. Root login is enabled by default.</p><h3>Accessing MailCleaner’s MySQL database</h3><p>This is an optional step. But if you’re keeping your antispam server in a perimeter network (DMZ), which I strongly recommend that you do, and/or if you’re using Let’s Encrypt certificate validation on this box, you are probably going to need this.</p><p>From the console or SSH shell, run:</p><pre>/usr/mailcleaner/bin/mc_mysql -m</pre><p>Then, on <strong><em>mysql&gt;</em></strong> prompt, set the MailCleaner database as current:</p><pre>use mc_config;</pre><p>You can try a show tables; if you’re curious.</p><p><strong>Adding firewall rules to the database</strong></p><p>MailCleaner keeps local firewall rules in its DB and sets the <strong><em>iptables</em></strong> config every time the server loads.</p><p>By default, SSH access is allowed from the local subnet only. To add your internal subnet as permitted (assuming it’s different from the subnet your server currently is), run:</p><pre>insert into external_access (service,port,protocol,allowed_ip) values (&#39;ssh&#39;,&#39;22&#39;,&#39;TCP&#39;,&#39;<strong>n.n.n.n/nn</strong>&#39;);</pre><p>Where “n.n.n.n/nn” is the subnet you want to add, in CIDR notation.</p><p>If you’re going to use Let’s Encrypt certificates and perform name validation in this box, please add this alternative TCP port to the local firewall rules too (you can change the port number if you want, just keep track of it):</p><pre>insert into external_access (service,port,protocol,allowed_ip) values (&#39;letsencrypt&#39;,&#39;<strong>8090</strong>&#39;,&#39;TCP&#39;,&#39;0.0.0.0/0&#39;);</pre><p>Then just run quit to exit the MySQL shell.</p><p>If your server will in fact be in another subnet, make sure you have the proper rules in your firewalls to allow traffic from MailCleaner to your mail server (TCP 25) and other necessary resources/servers (like LDAP or LDAPS ports if you are going to use Active Directory authentication, for example), etc.</p><p>Reference: <a href="https://support.mailcleaner.net/boards/3/topics/37-customizing-the-mailcleaner-firewall">https://support.mailcleaner.net/…ing-the-mailcleaner-firewall</a></p><h3><strong>SSL/TLS certificate</strong></h3><p>We need certificates for:</p><ul><li>The web page (SSL/https)</li><li>The MTA, for STARTTLS</li></ul><p>You can have two separate certs or use the same one on both services. The SSL certificate must contain your main hostname for accessing the admin web page, and the certificate for STARTTLS must have your MX name(s) in it (as subject or alternative subject name). I believe wildcard certificates should work here too.</p><p><strong>Please note</strong>: we used to get by with self-signed or private CA certificates, (that can still work for the web page SSL/https), but many e-mail providers, like Microsoft, are taking issue with self-signed certificates in your MTA (mail reception, MX servers). That’s the main reason I reinstalled my MailCleaner box recently. We were not receiving e-mails from Office 365 (Exchange Online), and Gmail servers were delivering, but returning an “unknown certificate” warning.</p><ol><li><strong>If you already have a valid certificate</strong> (or two) you want to use, you can go ahead and login to the admin web interface:</li></ol><p><strong><em>https://your_mailcleaner_hostname/admin</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*WPQ4L2Dl17rcFIg58Myn2g.png" /></figure><p>And then paste its contents in the configuration section. You will need the certificate(s) in PEM format. Usually .crt for the certificate data (public key) and .key for the private key. If you have a .pfx file, you can use openssl to convert it.</p><p>Before replacing the web interface SSL certificate you’re going to see a lot of certificate warnings in your browser (more then usual).</p><p><strong>SSL certificate: <em>Configuration &gt; Services &gt; Web Interfaces</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*mfR175O8BlCCt9smbvtKNg.png" /></figure><p>You need to supply a cert chain if your cert provider has an intermediate CA.</p><p><strong>STARTTLS certificate: <em>Configuration &gt; SMTP &gt; TLS/SSL</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/866/1*s3IrBYxprrThYd9BVTNAlw.png" /></figure><p>After changing these configurations, it will ask you to restart a few services, which is done in the page <strong><em>Monitoring &gt; Status</em></strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VaLe01m0KEYZz328s4yySQ.png" /></figure><p><strong>Note: </strong>If you go into this page, and instead of “<strong><em>Host: 1 (127.0.0.1) Up</em></strong>”, you see “<strong><em>Unresponsive</em></strong>” (and nothing else), don’t worry. Login as root again in the server console and reboot it. Wait at least 5 minutes for the services to come up again.</p><p>2. <strong>If you decided to use Let’s Encrypt </strong>certificates, here are some instructions and considerations:</p><p>The main challenge here is that you have to provide external http access to your MailCleaner server for the certificate name validation.</p><p>Maybe you use the same name for you MX record that you use for your mail server or webmail. Maybe you have a pfSense firewall with the ACME module installed, like I do. Maybe you have a reverse proxy like HAproxy. There are many possibilities and obstacles here, so see what suits you better. A few options are:</p><ul><li>Have the certificate and the name validation performed somewhere else (like in your firewall) and create a routine for copying the cert files to your MailCleaner box;</li><li>Forward Let’s Encrypt validation requests to an alternative TCP port on your MailCleaner server by using either:<br>- a reverse proxy (more secure and flexible)<br>- a simple NAT rule (if you have a dedicated public IP available)</li></ul><p>You may feel that we’re missing a simpler option here, where you could just redirect the entire TCP 80 traffic to your MailCleaner server, but apart from that being less secure, MailCleaner itself (apache) is using port 443 as default and is listening on port 80 to redirect every request to https. You would have to alter this configuration or stop/start apache’s service every time.</p><h3><strong>Let’s Encrypt validation on the MailCleaner box</strong></h3><p>Here I’m assuming you have a reverse proxy (dedicated or as a feature in your firewall solution), that can redirect HTTP traffic based on rules, so I’ll be covering the certificate request considering just the one scenario where connections from Let’s Encrypt servers will be reaching your MailCleaner box on an alternative TCP port.</p><p>If you want to explore other options, see this complete article about using Let’s Encrypt certificates with MailCleaner:</p><p><a href="https://opensource.com/article/20/6/secure-open-source-antispam">Eliminate spam using SSL with an open source certification authority</a></p><h4><strong>What kind of rules do you need on your reverse proxy?</strong></h4><ul><li>You have to redirect every request sent to port <strong>TCP 80</strong>, whose destination hostname is your MailCleaner external FQDN <strong>myserver.mydomain.com</strong> and the path starts with<strong> /.well-known/acme-challenge/</strong></li><li>This must be true for every hostname your MailCleaner will hold.</li><li>Also, you have to configure your reverse proxy to send these requests to an alternative port on MailCleaner server, since port 80 is already in use. We’re using port <strong>8090</strong> in the examples bellow.</li></ul><p><strong>Please note </strong>that, although we’re using an alternative port internally, Let’s Encrypt servers will <strong>only</strong> connect to your public IP using TCP port 80.</p><h4>Prepare for requesting the certificate</h4><p>Having your redirect rules in place, login as <strong>root</strong> in your MailCleaner server and run the following commands.</p><p>MailCleaner uses iptables, as explained before. If you didn’t add this port to the firewall rules (in the DB), or if you did, but the server has not been rebooted yet, we must open the alternative port 8090 manually:</p><pre>iptables -A INPUT -p tcp -m tcp --dport 8090 -j ACCEPT</pre><p>Then install <strong>Certbot</strong>:</p><pre>wget https://dl.eff.org/certbot-auto</pre><pre>mv certbot-auto /usr/local/bin/certbot-auto</pre><pre>chown root /usr/local/bin/certbot-auto</pre><pre>chmod 0755 /usr/local/bin/certbot-auto</pre><p>Lets try to issue our certificate using Let’s Encrypt staging (testing) server:</p><pre>certbot-auto certonly --standalone --preferred-challenges http --http-01-port 8090 --email myemail@domain.com --no-eff-email --agree-tos --staging -d myserver.mydomain.com</pre><p>If you have more than one name, just add them with “-d” at the end. E.g.:<br>-d mx1.mydomain.com -d mx2.mydomain.com -d spam.mydomain.com</p><p><strong>Note:</strong> after issuing this command it will hit a bootstrapping routine identifying missing dependencies, mostly python packages. Let it install the necessary software.</p><p>If everything went fine, you should see a result like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*YGiDGCHVX8ynxpqYT5-Z2Q.png" /></figure><p>If it didn’t go well, keep in mind that most errors with this process are caused by the Let’s Encrypt servers not being able to reach your server. Check if your firewall configuration is really OK.</p><h4>Request your certificate</h4><p>When the certificate issuing process is working correctly with the staging server, go ahead and <strong>request your certificate</strong> for production:</p><pre>certbot-auto certonly --standalone --preferred-challenges http --http-01-port 8090 --email myemail@domain.com --no-eff-email --agree-tos --force-renewal -d myserver.mydomain.com</pre><p>The result screen is pretty similar. You will now have a valid certificate at the following path:</p><p>/etc/letsencrypt/live/myserver.yourdomain.com/</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/559/1*Se0CLw_ZQ1R4xEDLaWrvbg.png" /></figure><h3><strong>Automate the certificate assignment and renewal</strong></h3><p>The last piece of this puzzle is this great script provided by <strong><em>GRahamJB</em></strong> in the following MailCleaner forum topic:</p><p><a href="https://forum.mailcleaner.org/viewtopic.php?f=5&amp;t=3035&amp;p=12532&amp;hilit=set+certificates#p12532">https://forum.mailcleaner.org/viewtopic.php?f=5&amp;t=3035&amp;p=12532&amp;hilit=set+certificates#p12532</a></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/90fcc44904c86f0290b4c9bb301f109e/href">https://medium.com/media/90fcc44904c86f0290b4c9bb301f109e/href</a></iframe><p>Let’s save this script in our server:</p><pre>nano /usr/local/bin/set-certificates.pl</pre><p>Paste the contents of the script and save it (Ctrl + X). Then give the script permission to run:</p><pre>chmod +x /usr/local/bin/set-certificates.pl</pre><p>Now run the script to <strong>assign your certificates</strong> to the Web interface and the MTA service:</p><pre>set-certificates.pl --set_web --set_mta_in --set_mta_out --key /etc/letsencrypt/live/myserver.mydomain.com/privkey.pem --data /etc/letsencrypt/live/myserver.mydomain.com/cert.pem --chain /etc/letsencrypt/live/myserver.mydomain.com/chain.pem</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/1*KDnbeJkuzD9a3uOGzO_PQA.png" /></figure><p>Now that we know it works, schedule these commands to run weekly, using cron and the certbot’s built-in renewal routine:</p><pre>nano /etc/letsencrypt/renewal/myserver.mydomain.com.conf</pre><p>Check if everything looks good and add the following line at the end (the same set-certificates.pl you just ran, preceded by “renew_hook =”)</p><pre>.<br>.</pre><pre># Options used in the renewal process<br>[renewalparams]<br>authenticator = standalone<br>account = 9d670ed7c63c6238f90f042f852fc33e<br>pref_challs = http-01,<br>http01_port = 8090<br>server = https://acme-v02.api.letsencrypt.org/directory</pre><pre># Set MailCleaner certs<br><strong>renew_hook = set-certificates.pl --set_web --set_mta_in --set_mta_out --key /etc/letsencrypt/live/myserver.mydomain.com/privkey.pem --data /etc/letsencrypt/live/myserver.mydomain.com/cert.pem --chain /etc/letsencrypt/live/myserver.mydomain.com/chain.pem</strong></pre><p>Note that the “renew_hook = set-cert…” command must be one single line. Save the file (Ctrl + X) and run the following command to test it:</p><pre>certbot-auto renew --force-renewal</pre><p>If the renewal succeeds you shall see a result similar to the one bellow. Note how our renew_hook command was called. The certificate has been updated in MailCleaner and the necessary services restarted.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/691/1*YGhxoZGwj1GPTb7iqKJT-w.png" /></figure><p>Now let’s add that renew command to cron:</p><pre>crontab -e</pre><p>Add the following line and save the file. This will make certbot run every Sunday, 2am:</p><pre>0 2 * * 7 /usr/local/bin/certbot-auto renew</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/663/1*himVXXtIsy3dN4T-zu6FMA.png" /></figure><p>If crontab doesn’t open the way you expect, run select-editor to choose the editor you like (nano, for example). Save the file. If you want to check the result, run crontab -l .</p><p>By default, certbot will only renew the certificate if it has less than 30 days left in its expiry date. If the cert is not due to expire, certbot will not renew it.</p><p>Done!</p><p>If you access <a href="https://your_mailcleaner_hostname/admin"><strong>https://your_mailcleaner_hostname/admin</strong></a> you’ll see that the SSL certificate is valid. And if you run the following command in your server, you can see that the certificate being presented on STARTTLS is the new Let’s Encrypt cert you just set:</p><pre>openssl s_client -connect localhost:25 -starttls smtp</pre><h4><strong>That’s the first part of the implementation</strong></h4><p>Now your have the server up and running, ready to start configuring your domains, e-mail routing and antispam features.</p><p>Move on to the next part of this guide:</p><p><a href="https://medium.com/@victorlclopes/how-to-configure-mailcleaner-2020-01-b916d01db95c">How to configure MailCleaner 2020.01</a></p><p>If you have doubts or suggestions, please let me know in the comments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8319c83e11ee" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>