How to Purge the postfix Mail Queue

To clear the mail queue in Postfix, we will use the command called postsuper . “postsuper” is short for Postfix superintendent. The postsuper command is used for postfix mail queue related maintenance work and can only be run as a superuser (root).
To check the mail queue in system, we use mailq command . Using the mailq command will show a list of e-mail messages that have not been delivered. Most of the messages will have a status of “deferred” and sit in the deferred queue .

First run the command mailq command to check how many messages are in queue overall.

There are three likely scenarios that you will need to blow away the queue:

Scenario 1 : Remove particular mail queue id (on running mailq command,you will get mail queue id)

postsuper -d mail_queue_id

Scenario 2: Remove ALL messages from all queue

postsuper -d ALL

Scenario 3: Remove only ALL deferred messages which are in the deferredqueue

postsuper -d ALL deferred

Update Home Assistant on CentOS 7

CentOS 7 sucks because the default version of Python is 2.7. To run Home Assistant you need at least Python 3.5. Fortunately you can install other versions of Python alongside the default Python 2.7 installation. These instructions assume that you already have installed Home Assistant.

  • First install Python 3.6.
  • Set the Python virtual environment to use 3.6: #scl enable rh-python36 bash
  • Do the upgrade: #pip3 install –user –upgrade homeassistant

Programming the Sonoff with Tasmota using the Arduino IDE

  1. Make sure you configured the IDE as described in Prerequisite!
  2. Load the file sonoff.ino into the IDE.
  3. In the Arduino IDE for sonoff select from Tools Board Generic ESP8266 Module ( Tools Board Generic ESP8285 Module for CH4 version) and set the following options:
  • Upload Using: Serial
  • Flash Mode: DOUT
  • Flash Frequency: 40MHz
  • CPU Frequency: 80MHz
  • Flash Size: 1M (64K SPIFFS) ⚠️️**If Version 5.x.x -> Flash Size: “1M (no SPIFFS)”**⚠️️
  • Debug Port: Disabled
  • Debug Level: None
  • Reset Method: ck
  • Upload Speed: 115200
  • Port: Your COM port connected to sonoff
  1. Open user_config.h and configure your WiFi settings and optionally your MQTT, Syslog, WebServer, NTP, etc. settings
  2. Verify and/or compile the project and upload to your sonoff using the serial connection established above.