Group Details Private

Donator

Member List

  • RE: Problem with Postfix // iRedmail configuration

    Hello again,

    I have found a temporary solution as per below. The email accounts that i want to use , only for internal purposes, added into a specific class (internal_only). All the other domain- account, can send to external emails. Don't forget to postmap interna_senders & internal domain.

    smtpd_sender_restrictions =

    check_sender_access hash:/etc/postfix/internal_senders

    reject_non_fqdn_sender

    reject_unlisted_sender

    permit_mynetworks

    permit_sasl_authenticated

    check_sender_access pcre:/etc/postfix/sender_access.pcre

    smtpd_restriction_classes = internal_only

    internal_only = check_recipient_access hash:/etc/postfix/internal_domain reject

    posted in General Discussion
  • Problem with Postfix // iRedmail configuration

    Hi guys,

    I have a Centos 7 which has an iRedmail web mail server in order the users to send local email each-other The Postfix has configured in order to send mail to internal users not external, as the below. My question is how to configure postfix to send email outside (External) from one specific domain. For example:

    I have create a domain at iRedmail test.com with multiple email addresses ([email protected],[email protected] etc).My question is how to allow this specific domain (@test.com) to send to external emails.

    vim /etc/postfix/main.cf
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_security_options = noanonymous
    smtpd_sasl_local_domain = $myhostname
    broken_sasl_auth_clients = yes
    smtpd_sasl_security_options = noanonymous


    smtpd_recipient_restrictions =
    permit_sasl_authenticated,
    permit_mynetworks,
    check_relay_domains


    myhostname = localhost
    mydomain = localdomain
    mydestination = $myhostname, localhost.$mydomain, localhost


    default_transport = error:outside mail is not deliverable

    posted in General Discussion
  • NodeMCU MQ135 air quality sensor tutorial

    Preparation

    Before we begin, you will have to obtain:

    Import Library

    Arduino > Sketch > Include Library > Add .ZIP library (Select the MQ135 Library zip file that you have downloaded from above)
    

    Connect the NodeMCU to MQ135 sensor

    Connect NodeMCU A0 to MQ135 AO
    Connect NodeMCU GND to MQ135 GND
    Connect NodeMCU 3.3V to MQ135 VCC
    

    Burnout

    It is necessary to "burnout" the sensor for first use to calibrate proper rzero value, to do so paste following code to your arduino window :

    #include "MQ135.h"
    const int ANALOGPIN=0;
    MQ135 gasSensor = MQ135(ANALOGPIN);
    void setup(){
      Serial.begin(115200);      // sets the serial port to 115200
    }
    void loop(){
      float rzero = gasSensor.getRZero();
      Serial.println(rzero);
      delay(1000);
    }
    
    • Upload the code to NodeMCU
    • Open the serial monitor : Tools > Serial Monitor

    Let it running for an hour or two until you get constant rzero value. Write down that RZERO value as you will need it for later use.

    If you made it up to here, you almost got to the end.

    ThingSpeak

    This is the platform that we are going to use to store our measures and display them in a nice graph that we can embed to any website or similar. (This tutorial might expand in future to a selfhosted variant of storing and displaying data)

    Measure Air Quality

    Adapt following code to reflect your RZERO value, API key, SSID and password.

    Note: RZERO is the value from the burnout section.

    #include <ESP8266WiFi.h>
    #include "MQ135.h"
    #define RZERO 76.63
    const int ANALOGPIN=0;
    MQ135 gasSensor = MQ135(ANALOGPIN);
    
    
    String apiKey = "WRITE-API-KEY"; // Enter your Write API key from ThingSpeak
    const char *ssid = "SSIDNAME"; // replace with your wifi ssid 
    const char *pass = "PASSWORDHERE"; // replace this field with your password
    const char* server = "api.thingspeak.com";
    WiFiClient client;
    void setup()
    {
    Serial.begin(115200);
    delay(10);
    Serial.println("Connecting to ");
    Serial.println(ssid);
    WiFi.begin(ssid, pass);
    while (WiFi.status() != WL_CONNECTED)
    {
    delay(500);
    Serial.print(".");
    }
    Serial.println("");
    Serial.println("WiFi connected");
    }
    void loop()
    {
      float ppm = gasSensor.getPPM();
      Serial.println(ppm);
      delay(1000);
    
    if (client.connect(server, 80)) 
    {
    String postStr = apiKey;
    postStr += "&field1=";
    postStr += String(ppm);
    postStr += "r\n";
    client.print("POST /update HTTP/1.1\n");
    client.print("Host: api.thingspeak.com\n");
    client.print("Connection: close\n");
    client.print("X-THINGSPEAKAPIKEY: " + apiKey + "\n");
    client.print("Content-Type: application/x-www-form-urlencoded\n");
    client.print("Content-Length: ");
    client.print(postStr.length());
    client.print("\n\n");
    client.print(postStr);
    Serial.print("Gas Level: ");
    Serial.println(ppm);
    Serial.println("Data Send to Thingspeak");
    }
    client.stop();
    Serial.println("Waiting...");
    
    // thingspeak needs minimum 15 sec delay between updates.
    delay(1500);
    }
    

    That is it, from here you are sending values to ThingSpeak platform, you got yourself a nice graph, and you are monitoring air quality 🙂

    Here is the image of values to know when the air is bad :

    air quality

    posted in Tutorials