Saturday, February 11, 2023

Add Domain specific DKIM in PMTA config

#MTAs

<virtual-mta ip1>

    smtp-source-host 192.198.0.1 host.domain.tld

    <domain *>

        max-msg-rate 400/h

    </domain>

</virtual-mta>

#DKIM Keys

domain-key key1,domain1.tld,/etc/pmta/keys/key1.domain.tld

domain-key key2,domain2.tld,/etc/pmta/keys/key2.domain.tld

domain-key key3,domain3.tld,/etc/pmta/keys/key3.domain.tld

#Specify the DKIM for specific Domain using Directive

<domain domain1.tld>

    dkim-sign yes

    smtp-hosts [127.0.0.1]:587

    dkim-identity @domain1.tld

</domain>

<domain domain2.tld>

    dkim-sign yes

    smtp-hosts [127.0.0.1]:587

    dkim-identity @domain2.tld

</domain>

<domain domain3.tld>

    dkim-sign yes

    smtp-hosts [127.0.0.1]:587

    dkim-identity @domain3.tld

</domain>

#CALL PMTA POOL for Rotation

<virtual-mta-pool pmta-pool>

    virtual-mta ip1

</virtual-mta-pool>


Extract the First Word Using Text Formulas

 =IFERROR(LEFT(A2,FIND(" ",A2)-1),A2)



Sunday, January 29, 2023

Remove both duplicate and original value from Excel or Google sheet

=if(countif(A:A,A1)=1,0,1)


There is a zero or a one in Columns C for each value in Columns A. A zero means that a value from Columns A is not repeating in the data range and should be kept. A one means that there are duplicate values and that row should be deleted. Then filter the rows having One in column C, Select and Delete.

Saturday, January 21, 2023

How to Extend Swap Space using Swap file in Linux

dd if=/dev/zero of=/swap_file bs=1G count=1

sudo fallocate -l 1G /swap_file

chmod 600 /swap_file

mkswap /swap_file

echo "swap_file swap swap defaults 0 0" >> /etc/fstab 
or 
vi /etc/fstab/swap_file swap swap defaults 0 0

swapon /swap_file

Error binding socket to :::25, status = EADDRINUSE (Solved)

Centos 
$ yum install net-tools 

Fedora: 
$ sudo dnf install net-tools 

Debian, Ubuntu: 
$ sudo apt install net-tools

netstat -tulpn

netstat -tulpn | grep -w 2500

Result: tcp     0         0 0.0.0.0:2500             0.0.0.0:*

kill 942

Friday, January 20, 2023

Install PMTA Management Console

yum install ntp (if not installed)
=======================
Install PMTAMC
=======================

Upload pmconsole1.5r19 to path /root/PMTA/ and run below commands

cd /root/PMTA/pmconsole1.5r19

rpm -ivh PowerMTA-MC-infrastructure-1.5r19-201906071449.x86_64.rpm

rpm -ivh PowerMTA-MC-1.5r19-201906071449.x86_64.rpm

service pmtamc stop

rm -rf /opt/pmtamc/glassfish/glassfish/domains/domain1/applications/pmtamc/WEB-INF/classes/com/port25/webui/security/Lak.class

cd /root/PMTA/pmconsole1.5r19/opt/pmtamc/glassfish/domains/domain1/applications/j2ee-modules/pmtamc/WEB-INF/classes/com/port25/webui/security

cp Lak.class /opt/pmtamc/glassfish/glassfish/domains/domain1/applications/pmtamc/WEB-INF/classes/com/port25/webui/security

rm -rf /opt/pmtamc/glassfish/glassfish/wars/pmtamc.war

cd /root/PMTA/pmconsole1.5r19/opt/pmtamc/glassfish/wars

cp pmtamc.war /opt/pmtamc/glassfish/glassfish/wars

cd /root/PMTA/pmconsole1.5r19

cp license /etc/pmtamc

service pmtamc start

open ports  (8181 8282 4848 3700 7676 8686)

++++++++++++++++++++++++++++

Register PMTA in PMTAMC

++++++++++++++++++++++++++++

http://examplepmtamc.com:{PORT}/pmtamc/nodemanagement/

PowerMTA Node Registration: Accept new PowerMTAs

pmta register --label={Name} --pmtamc-port={PORT} {HOST}

example

pmta register --label=softo --webmon-port=19000 --pmtamc-port=8181 157.245.221.117

----------------------------------------------------------------------------------------


 

Join Multiple table with subquery

SELECT DISTINCT

    e.card_id,

    e.photo_link,

    c.full_name,

    c.mobile_no,

    c.email,

    c.image_path,

    s.institute_name,

    p.profession_name,

    p.institute_name AS company, 

    i.village_road_present,

    i.post_office_present,

    i.thana_upazila_present,

    i.district_present,

    i.blood_group

FROM EVENT

    e

JOIN(

    SELECT DISTINCT

        id,

        full_name,

        mobile_no,

        email,

        image_path

    FROM

        cualumni

    WHERE

        softdeleted = 'No'

) AS c

ON

    c.id = e.user_id

JOIN(

    SELECT DISTINCT

        user_id,

        institute_name

    FROM

        education

    WHERE

        user_id IS NOT NULL

) AS s

ON

    s.user_id = e.user_id

JOIN(

    SELECT DISTINCT

        user_id,

        profession_name,

        institute_name

    FROM

        profession

    WHERE

        user_id IS NOT NULL

) AS P

ON

    P.user_id = e.user_id

JOIN(

    SELECT DISTINCT

        *

    FROM

        personal_info

    WHERE

        user_id IS NOT NULL

) AS i

ON

    i.user_id = e.user_id

Office 2021 Activation using command

  @echo off title Activate Microsoft Office 2021 (ALL versions) for FREE - office.com&cls&echo =====================================...