Wednesday, August 5, 2026

Restoring a Fatar Studio Logic 2001 MasterPiano

Recently, I decided to restore a Fatar Studio Logic 2001, a full-size weighted master keyboard from the early 2000s. Despite its age, this instrument still has a solid feel and remains a fantastic piece of hardware well worth giving a second life.

The unit I picked up looked tired but structurally intact. The chassis was straight, all the weighted keys were present, and nothing seemed broken beyond normal wear. Like many older MIDI controllers, it just needed some attention: a deep cleaning, a few key repairs.

Opening the keyboard revealed years of dust, especially around the keybed and contact boards. Fatar’s construction is surprisingly serviceable, once the top panel is removed, the internals are easy to access.


I removed all the keys, cleaned the rubber contacts, and gently vacuumed the interior. The weights and mechanics were still in excellent condition, which speaks to how well these keyboards were built.

Like many vintage keyboards, the Studio Logic 2001 relies on an internal battery to store system settings. The original battery was soldered directly onto the PCB, a common design back then, but very inconvenient for future maintenance.

Since I didn’t want to pull out the soldering iron every time the battery dies, I decided to install a proper battery holder. Removed the old soldered battery. Cleaned the pads and installed a new CR2032 battery holder. Inserted a fresh battery.


One I've installed the new battery I've notice preset where gone, so I connected the unit to my interface, sent the SysEx preset file, and within a few minutes the update was complete. 

The Fatar Studio Logic 2001 might not be a modern controller packed with sliders, pads, and lights, but it has something more important: a premium keybed and an incredibly solid build.

Notes

  • read risk disclaimer
  • excuse my bad english


Monday, July 6, 2026

D09: guitar tube amplifier from a turntable

I've found a junked turntable, it's not in good condition, plate is broken and enclosure has some crack. But the front cover is pretty, and also it's powered by tubes, so I've decide to convert it in a small practice tube guitar amplifier.

The most of the time I found something in the dumpster it works, it's just a matter of cleaning it. Sometimes, when it does not works, it's something simple to fix. Taking a look at this turntable makes me think someone threw it away cause the plate has something broken.

WARNING! - The project described in these pages utilizes POTENTIALLY FATAL HIGH VOLTAGES. Do not attempt to build circuits presented on this site if you do not have the required experience and skills to work with such voltages. I assume no responsibility whatsoever for any damage caused by the usage of my circuits.

Most important thing to notice when building tube guitar amplifier from old devices is to check that they don't use an autotransformer https://en.wikipedia.org/wiki/Autotransformer, cause you don't want to get a shock plaing your electric guitar :) And this player has a standard transfromer.

This turntable has two tubes:

  • rectifier tube: 
  • preamplifier + amplifier tube: ECL86

Checked this, I've removed the tubes and connected it to power plug. If you have a Dim-Bulb Tester it's better to use that. But I've not build it yet.

Once connected I have to test the voltage output. First I've checked the heater voltage for the two tubes pinout, and that's 6.3V AC, so right. Then I've checked the high voltage and that's good enough.

So I've started putting the rectifier tube in. It works, the high voltage DC came out without problems.4 Then I've connected the ECL86. Heater works, and tube output too. Checking a sine wave input in the input wire from the old turntable needle yield to a sound output. It means also the output transformer works. That's great! Now it's time to rebuild the circuit to make it works for guitar input.

I've take a couple of reference:

- Magnatone 411

- Radio Tone by Guilhem

Rebuild the circuit was pretty easy, I just changed a few values from the reference circuit. Also I've add a switch to change from triode to pentode mode output.

This amplifier has a single volume control, which is also the power one switch. This makes the front grid so minimal and pretty.

Back to woodworking, I cut the enclosure back, where the turnatable plate was installed, keeping just the front grid. Then I removed the original faux leather cover and do some woodwork with wood putty and grind paper.

I've tweeded it using vinylic glue and one of my grandmother nightgown.

Final enclosure looks pretty good.

Time to check the audio output. This amplifier it's really clean. The original speaker sounds good even if it was not built for guitar. It starts with a little overdrive at 5 to 10 volume, ending up in a nice tube overdrive sound at max volume.

Even if it's just a 4W amplifier it's loud enough for a quiet jam session.

Notes

  • read risk disclaimer
  • excuse my bad english


Sunday, June 7, 2026

Vorwerk VK-140 Folletto vacuum repair #2, control board capacitor failure


This is a follow-up to a previous repair I did on a Vorwerk VK 140 Folletto vacuum cleaner, which you can find https://davidegironi.blogspot.com/2023/10/vorwerk-vk-140-folletto-vacuum-repair.html. Unfortunately, after some time, the vacuum started acting up again.

This time, the issue was quite peculiar: when running at maximum speed, the motor RPM would suddenly drop for a second, then go back up, then drop again, in a repeating loop. It looked like the motor controller was struggling to maintain stable operation.

I opened up the vacuum cleaner once again, focusing this time on the main control board. Upon inspection, I noticed a capacitor with a bulged top, a clear sign of failure. It was likely a low voltage electrolytic capacitor used in the logic control circuit. When these capacitors degrade, they can cause erratic behavior in the control logic or power regulation circuits.


I replaced the faulty capacitor with one of the same value and voltage rating, making sure to use a quality component rated for high temperature and long life. After the replacement, I reassembled the vacuum and gave it a test run.

The motor now runs smoothly, even at full speed, no more RPM drops or interruptions. It seems the failing capacitor was causing unstable voltage in the control section, which in turn affected the motor regulation.

This time the repair was simple. Hopefully, this will be the last time I have to open up this Folletto.

Notes

  • read risk disclaimer
  • excuse my bad english

Sunday, May 3, 2026

Onkyo TX-NR809 no sound issue fix

The Onkyo TX-NR809 is a highly capable A/V receiver that’s been popular for home theater systems since its release. But over the years, many owners have reported a persistent problem: the unit powers on normally, displays menus, and responds to control inputs, no audio comes out of any speaker.

This problem is known as "no-sound issue" and it's associated with the DSP chip on the amplifier’s main board.

Over time, and especially when the receiver experiences repeated heat cycles during normal use the solder joints underneath the DSP IC can crack or weaken. As a result, the DSP chip loses reliable contact, leading to loss of audio signal transmission even though the receiver appears to operate normally.

The most used technique to fix it, is the the DSP reflow.

The unit is fully opened and the main board is removed. We have now to protect the components next to the main DSP IC, using thermal paper or event aluminum foils. Now we can heat the DSP IC with a hot-air tool to re-melt the solder underneath, restoring metal flow and reconnection. You should run it at a 300degree, 30% to 50% of airflow on my cheap air solder, 1 to 2 minutes should be enough. Then leave the unit cool down for at least 10 minutes.

When performed correctly, this reflow can bring the receiver back to full audio operation.

Notes

  • read risk disclaimer
  • excuse my bad english

Monday, April 13, 2026

Anycubic photon mono x 6k display fix

A friend of mine gives me a Anycubic Photon Mono X 6K. The Anycubic Photon Mono X 6K is a high-resolution resin 3D printer designed for precision and speed. It features a 9.25-inch monochrome LCD screen with a 6K resolution, delivering sharp details and smooth edges in prints


The problem with this device is that the screen sometimes is turning completely white. This inconsistency often points to a connection problem rather than a full hardware failure, which is both good and bad news, the bad news being the effort it takes to pinpoint the weak link.


The first step in diagnosing the issue is to disassemble the printer. Checking the cables is a logical first move, ensuring all connections are snug and free from obvious damage. In this case, everything appeared fine on the surface, but the issue persisted.

After thorough inspection, the problem was finally traced to the flat cable connecting the touchscreen display PCB to the LCD itself. These ribbon cables can sometimes accumulate dust, oxidation, or suffer from loose contacts leading to unpredictable behavior.


A careful cleaning of the cable contacts was enough to revive the connection. To ensure lasting stability, a small amount of glue was used to secure the cable, preventing future shifts or interruptions. And just like that the display was back in action, fully functional and reliable again.

Notes

  • read risk disclaimer
  • excuse my bad english

Tuesday, March 3, 2026

Repair an industrial Atom Mini-PC with a faulty tantalum capacitor

I’ve been using a small Chinese mini-PC as a Proxmox Backup Server for quite some time.

Nothing fancy:

  • 8 GB SO-DIMM RAM
  • M.2 SATA SSD
  • Intel Atom CPU
  • Low power consumption, always on

Until one day… I found it turned off. No LEDs, no signs of life at all. Pressing the power button did absolutely nothing.

At first, I suspected the usual suspects:

  • External power supply
  • Power button
  • RAM or SSD failure

The power supply was fine, and disconnecting all peripherals changed nothing. The board was simply dead.


After opening the case, I did a quick visual inspection. No burnt components, no obvious damage, no blown electrolytic capacitors.

I powered the board briefly and scanned it using a thermal camera, almost immediately, one component stood out: a small tantalum capacitor was getting hot very quickly.

Tantalum capacitors are known to fail short-circuit. When they do, they can pull down the entire power supply and prevent the system from starting at all.

I removed the faulty tantalum capacitor and replaced it with a new capacitor of the same value and a slightly higher voltage rating, cause I was able to find a 6.3V one.

Before reassembling everything, I powered the board again and checked it, pressed the power button and the BIOS appeared, Proxmox booted normally, and the server has been running stable ever since.

Notes

  • read risk disclaimer
  • excuse my bad english

Monday, February 9, 2026

A 230V power strip triggered by my PC 5V/USB

One of my small but very useful DIY projects was modifying a standard 230V power strip so it automatically turns on and off together with my PC. The goal was simple: power my 2.1 audio system only when the computer is actually on, without having to manually flip a switch every time.

I started with a normal 230V power strip equipped with a mechanical on/off switch. After disassembling it, I removed the original switch entirely. Instead of replacing it with a relay PCB board.

In place of the original switch, I installed a custom PCB with a 5V relay. The relay is wired so it switches the mains line exactly like the original power switch did, but now it’s controlled by a low-voltage signal.

To power the relay, I connected it to a 5V USB cable. This way, when the PC provides 5V, the relay closes and the power strip turns on. Simple and effective.

I realized a limitation of my PC, unfortunately, the USB ports on my motherboard remain powered even when the PC is turned off. This meant the power strip stayed on all the time, defeating the whole purpose. Some BIOS setups allow disabling USB power when the PC is off, but in my case, that option simply wasn’t available.

To fix this, I redesigned the activation method. Instead of relying on USB power, I created a custom adapter from an internal PC power supply connector to a 2.5mm DC power jack mounted on the back of the power strip.

Now the relay gets its 5V directly from the PC’s internal power supply, meaning it only receives power when the PC is actually on. When the PC shuts down, the relay releases and the entire power strip turns off automatically.

Notes

  • read risk disclaimer
  • excuse my bad english

Saturday, January 3, 2026

A MC2100ELS motor control board repair adventure

The MC2100ELS is a well-known motor control board used in many treadmills. This repair story started when I bought a used treadmill. It worked fine at first, but after a few months it suddenly stopped working.

After opening the treadmill and inspecting the MC2100ELS board, I focused on the switching regulation section. The root cause of the first failure turned out to be a capacitor on the output line of the switching regulator. The capacitor had degraded and was no longer doing its job properly.


While working on that section, I also noticed a ceramic capacitor on the same output line that was emitting an audible buzzing noise. Even if it was still technically working, that noise was a clear sign of stress, so I replaced it as well.

Using a thermal camera during testing, I found another weak point: a resistor on that same line was running extremely hot. The original resistor was rated at 15k/2W, which seemed undersized for the actual power dissipation. To improve reliability, I replaced it with a 15k/5W resistor.


After these fixes, the board was reinstalled and the treadmill worked perfectly for several months.

After some time, the treadmill stopped working again. This time the symptoms were different and much more frustrating. The LED on the MC2100ELS board, which normally blinks to indicate the operating frequency, was now solid on instead of flashing.

The worst part was that the problem was intermittent. Sometimes the treadmill would start, sometimes it wouldn’t. I ran many tests, checked solder joints, remeasured voltages, and tried to reproduce the failure consistently, but it appeared randomly.

After many attempts, I focused my attention on the microcontroller and the control signals. I suspected that either power instability or noise on the PWM control line could be causing the microcontroller to lock up.

Two changes finally solved the issue: replacing a capacitor on the microcontroller power supply line, adding a 100 pF capacitor on the trace from the optocoupler output to the PWM input pin down to ground. It helps filter high-frequency noise and clean up the PWM signal reaching the MC2100ELS.

After these modifications, the LED behavior returned to normal (blinking as expected), and the treadmill has been working reliably since.

It has now been running for several months without any issues, so things are looking good, fingers crossed.

I would also like to thank the users of the allaboutcircuits.com forum (https://forum.allaboutcircuits.com/), and especially MaxHeadRoom, for their valuable help and insights during this repair. Their suggestions were instrumental in tracking down and finally solving this tricky and intermittent problem.

Find below a couple of thermal images from my treadmill.



Notes

  • read risk disclaimer
  • excuse my bad english

Monday, December 1, 2025

Through-Hole Adapter Board for the SCT-013 CT

In this post I’ll present a purpose-built adapter board for the SCT-013 series current transformer: through-hole PCB, configurable burden resistor to match the specific version of the SCT-013, and a conditioned output suitable for a microcontroller input.

For the detailed logic of how the SCT-013 works in conjunction with a microcontroller, see my previous blog: https://davidegironi.blogspot.com/2016/12/ct-sensor-on-avr-atmega.html

The SCT-013 (and similar split-core current transformers) provide a safe and convenient way to monitor alternating current without cutting the conductor. However, to interface this type of CT properly to a microcontroller ADC input you need to handle a connect a few components.


An adapter board simplifies the mount of the SCT-013 (via its connector or wires) and you populate the correct resistor/burden resistor footprint, then provide a clean output to your microcontroller.

Schematic and PCB:

Notes

  • read risk disclaimer
  • excuse my bad english

Wednesday, November 5, 2025

Cheap AliExpress Emergency Light Repair (Kongin KG-913)

I've one emergency light from AliExpress, with rechargeable LED lights that automatically turns on when there’s a power outage. You plug it into the wall, it charges an internal battery, and when the mains goes off, it lights up the room.

After some time of use, it suddenly stopped working. Opening it up, the reason was pretty obvious: one of the electrolytic capacitors had exploded.

The failure didn’t stop there, the blown cap also burned a small transistor near it, and even some of the LEDs on the main board were dead.


Luckily, the circuit is simple. I replaced both the damaged capacitor and the transistor. For the LEDs, I salvaged some working ones from an old broken LED bulb I had lying around.

After soldering everything back and cleaning up the board, the light powered up again — working perfectly both from mains and battery.

Notes

  • read risk disclaimer
  • excuse my bad english

Wednesday, October 1, 2025

Ruby Amp PCB board, the 1w guitar amplifier

ref: 2020

 

This post it's a follow up of the August 8th 2019 one about the Ruby Amp.
As I already write in that post, the Ruby Amp it's a small instrument amplifier based on the LM386 IC. An in-depth analysis of this small amplifier in the electrosmash.com page here: https://www.electrosmash.com/ruby-amp-analysis. Basically this amplifier is composed by an N-Channel JFET input buffer that adjust the impedance of the instrument pickup. The speaker driving job it's done by the LM386.

Many mods can be found online for this amplifier.
Developing this mini PCB board, I've decide to collect for models/mods:
- Standard model: as found in http://www.runoffgroove.com/ruby.html page
- Bassman mod: makes the ruby sounds like an old Fender Bassman amp
Hiwatt mod: gives this amplifier a nice British sound like an Hiwatt amp
- Distorsion mod: adds a distorsion switch


The board itself is really small 3.2x4.3cm.
The power plug, input jacks, switch, and potentiometers needs to be connected using extension wires.
That's because I want this board to be adaptive to any box, even small one. Like salvaged hardware PC speakers.

You can find below the EagleCAD (https://en.wikipedia.org/wiki/EAGLE_(program)) schematics and board, as long as exported image.
On the schematic you will find instruction for the main mods available.


Schematics

Notes
  • read risk disclaimer
  • excuse my bad english

Tuesday, September 2, 2025

D08: "Kenshiro" Bass Amplifier it's TDA2050 based

D08 "Kenshiro" bass guitar amplifier is my latest amplifier. It's built on top of the reliable TDA2050 audio amplifier chip. 

This project started, like many of mine, from a forgotten piece of consumer audio gear, this time, an old Trust PC subwoofer. A basic, cubic box made of MDF, plastic front panel, and a surprisingly decent speaker inside.


Once I pulled it apart and confirmed the speaker still worked, I gutted the electronics and got to work turning it into something special. The case was dull, so I gave it a complete makeover: decoupage artwork featuring Kenshiro himself. It felt only fitting to name the amp after him. 

This amp runs on a single +30V power rail for the power stage and a separate +9V line for the preamp. 


At the heart of the power stage is the tried-and-true TDA2050, delivering solid output for small gigs or home practice. It’s simple, tough, and very effective when paired with the speaker I'm using. The final stage it's based upon the Fender Rumble 15 schematic with some modifications.

The preamp section is based on the classic J. Tillman Discrete FET Guitar Preamp(http://www.till.com/articles/GuitarPreamp/), using a J201 JFET for that sweet, tube-like response. There's another J201 stage after the tone stack to recover some lost gain and push the signal forward with character.

Tone shaping is simple. I've included a Low and High control.

Then I've added a distortion switch that activates a pair of 1N914 diodes for symmetrical clipping. Combined with a gain-boosting cap, this adds a touch of grit and aggression to the sound. Not too much, just enough to growl without getting muddy. 

The control panel is mounted on the back, I kept things simple: just a wooden panel with cutouts for the power input and a handle.

The sound is tight and responsive. The distortion is very usable, great for vintage vibes or even light fuzz. Volume is not very high, but this is a practice or studio amplifier, not a live one. It won’t fill a stadium, but for home practice or small rehearsals, Kenshiro delivers more than enough fury.


Notes

  • read risk disclaimer
  • excuse my bad english


Tuesday, August 5, 2025

MacBook Pro A1278 video issue repair, again!

On a previous post I've post a repair on a MacBook Pro A1278 video output. Find it here: https://davidegironi.blogspot.com/2025/02/macbook-pro-a1278-video-issue-repair.html
Well... believe me or not, the day after I post it, it does not work again.

So I've to open it again and check it.

This time I've decide to replace that component.
That is a common mode choke coil on the CLK+ and CLK- line of the LVDS of the display. Which makes sense on the behavior I've notice.
I've ordered a few DLP11SN900HL2L.

De-soldering mine I've notice mine have also a pin damaged.
So I solder the new one and It works.

Finger-crossed, now this Mac video should be called: repaired.

Notes

  • read risk disclaimer
  • excuse my bad english


Tuesday, July 8, 2025

EarthQuaker Devices Blumes repair

A colleague of mine recently handed me their EarthQuaker Devices Blumes, asking if I could take a look.
He told me the issue is a “noisy output”, not the good kind of noise you want from this overdrive pedal. Of course, I was intrigued. The Blumes is known for its warm, smooth overdrive and high-quality build, so hearing it was acting up definitely raised my curiosity.

Visually, the pedal looked flawless. No signs of abuse, oxidation, or physical damage. All jacks, knobs, and switches felt fine. I plugged it in and the problem became obvious: there was a harsh noise floor present even when the pedal when activated. 

I opened up the pedal and started by checking the obvious: power supply filtering, solder joints, input/output buffering. Everything looked clean, and nothing seemed to be physically failing. I scoped the power rails next and noticed something strange there was no negative voltage on the main op amp.

The Blumes, like many analog pedals, relies on both positive and negative voltage rails to give op-amps enough headroom for clean and responsive audio. To generate the negative rail from a standard 9V DC input, the circuit uses a voltage inverter IC, the ICL7660. In my case, that chip had gone bad.


I desoldered the suspect chip and dropped in a known-good replacement. The overdrive returned to its usual thick, musical self.

Notes

  • read risk disclaimer
  • excuse my bad english

Thursday, June 5, 2025

InEquilibrio01: a simple PID controlled self-balancing robot

ref: 2017


InEquilibrio01 is a compact self-balancing robot that maintains its upright position using a PID control loop.
It is built around an ATmega328 microcontroller running at 8 MHz using its internal oscillator, and uses two inexpensive DC gear motors for actuation. An MPU6050 sensor, which integrates a 3-axis gyroscope and accelerometer, provides real-time feedback on the robot’s orientation.


A lightweight PID library enables real-time tuning of control parameters, allowing the robot to adjust its posture dynamically. PID coefficients can be programmed via PC using a bluetooth adapter (such as the HC-05) and a simple host-side library.


Although the motors are quite basic and relatively slow, making smooth balancing a challenge, the system performs reliably and demonstrates the core principles effectively.


Power is supplied by a 7.4 V LiPo battery, regulated by a DC-DC buck converter that steps the voltage down to 5 V for the microcontroller and electronics.

Code

Notes

  • read risk disclaimer
  • excuse my bad english


Wednesday, May 7, 2025

Fixing the DOD FX-17 Wah/Volume Pedal’s Mechanical Noise

The DOD FX-17 is a compact pedal that functions as both a wah and volume pedal, with the added bonus of an expression output. Unlike typical treadle designs, this pedal features a proprietary control system, giving it a sleek, low-profile footprint and a smooth, responsive feel underfoot.

A friend of mine gives me this pedal cause it suffers of a mechanical noise issue.

In this particular case, the unit emitted a noticeable squeaking sound when the pedal was rocked back and forth.

The fix was surprisingly simple. After inspecting the pedal’s mechanics, it was clear the pedal joint lacked lubrication, leading to friction and the resulting noise. I've try with some drop of oil without solving this. I have to disassembly the join and give it a small application of grease at the pivot points of the pedal. This immediately resolved the issue. The motion is now silent and smooth, restoring the pedal to full working condition without impacting its tone or optical response.

Notes

  • read risk disclaimer
  • excuse my bad english


Monday, April 7, 2025

MIDI adapter breakout board

MIDI adapters are essential tools for musicians and audio enthusiasts. They act as bridges between MIDI devices, allowing seamless communication.

In this project, I’ll share the schematic of the adapter design along with a custom PCB I’ve developed. The goal is to create a compact, functional MIDI adapter suitable for studio and live environments.


It features:

  • MIDI In: For receiving signals from external devices.
  • MIDI Out: For sending processed MIDI signals.
  • MIDI Through: To pass MIDI signals directly to other devices, with an optional splitting mechanism for multiple outputs.

MIDI though can be cut away if you want.


It can be drawn at 3.3V or 5V and it will helps you connecting your microcontroller to a MIDI device.

Find schematic and PCB design here:

Schematics

Notes

  • read risk disclaimer
  • excuse my bad english

Tuesday, March 11, 2025

Enable copy&paste on Proxmox Windows VM


Find below a quick guide to enable copy & paste on Windows O.S. installed as VM on Proxmox.

On you Proxmox hypervisor shell you have to install the Spice VD Agent

apt install spice-vdagent

Then you have to enable it

systemctl enable spice-vdagent

systemctl start spice-vdagent

Then you have to set the Display option as Standard VGA, with clipboard VNC copy, you can do this by the Proxmox gui, or via command line using the following command:

qm set <vmid> -vga std,clipboard=vnc

Latest step is to download virtio-win on the windows device, you can find it here https://pve.proxmox.com/wiki/Windows_VirtIO_Drivers. Download the .iso and install it in your VM Windows. Then Reboot.

You now should be able to copy and paste using the Clipboard icon you see on the noVNC console display.

Notes

  • read risk disclaimer
  • excuse my bad english



Wednesday, February 19, 2025

MacBook Pro A1278 video issue repair

I've a MacBook Pro A1278 that I don't use that much.

Last time I've power it on it has a strange issue with the display. It turn off after a while. And after a couple of days of usage it also start to do weird things. Like if it's distorted.

So I decide to open it and luckily I've find it just a little bit of crust on a component next the display connector.


It just takes a little bit of isopropyl alcohol and time to clean this and make this MacBook working again.

Not a big repair, but still one. So maybe if some other has this same issue, you can go and check for that component.

Notes

  • read risk disclaimer
  • excuse my bad english

Tuesday, January 7, 2025

Sending email from Proxmox using postfix and gmail

Proxmox (https://www.proxmox.com/) is my reference hypervisor since a couple of years.

One of the thing I was missing is sending email from it, so I decide to setup postfix (https://www.postfix.org/) to do this.

The smtp mail service I've used for this is Google gmail. But you can use any other smtp server.

All the commands shown below has to be run from the node shell.

First you have to install some packages:

apt install -y libsasl2-modules mailutils rsyslog

Then you have to add a password file

nano /etc/postfix/sasl_passwd

Inside the file we are going to put the relay host, a username, and a password. As for the password, you are using google gmail you have to enable 2-Step-Verification and then add an App Password, find the guide here: https://support.google.com/accounts/answer/185833?hl=en
We are going to use the created app password for our credential. Note that this password usually contains spaces that we must remove on the sasl password file.

The content of the file should look something like this, here you should replace with your credentials

[smtp.gmail.com]:587 your_username@gmail.com:your_app_password_without_spaces

You then have to set permissions on this file, like so

chown root:root /etc/postfix/sasl_passwd
chmod 600 /etc/postfix/sasl_passwd

Now, and anytime you change this file you are going to build a new has using the postmap command, so run the following command:

postmap hash:/etc/postfix/sasl_passwd

Then we have to add a couple of file more, to replace the sender with your actual username, otherwise the smtp server will block your outgoing emails.

So add the sender file

nano /etc/postfix/sender_canonical_maps

and fill it with content:

/.+/    your_username@gmail.com

Then add the replace header file:

nano /etc/postfix/header_check

and fill it with content:

/From:.*/ REPLACE From: your_username@gmail.com

Now we can finally edit the mail configuration file

nano /etc/postfix/main.cf

We have to comment out the relayhost actual line

#relayhost =

And add the following lines at the bottom of the file

relayhost = [smtp.gmail.com]:587
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
sender_canonical_classes = envelope_sender, header_sender
sender_canonical_maps =  regexp:/etc/postfix/sender_canonical_maps
smtp_header_checks = regexp:/etc/postfix/header_check

Another thing you should change here, is to update the compatibility level from 2 to 3.6, this is not mandatory

compatibility_level = 3.6

We are now done, we can now restart postfix

systemctl restart postfix

And we should be able to send a test email by using the command:

echo "sample message" | mail -s "sample subject" recipient@email.com

If you want to look at the last 50 files of the postfix log file, just run

tail -n 50 /var/log/mail.log

Notes

  • read risk disclaimer
  • excuse my bad english