How to install and config pmta full detailed

Pmta installlation

Pmta installlation

1. Point your domain and allow root log in

Allow Root Login: -----------------
1- Set a root password using the follwing Command: sudo passwd root
2- Open the SSH configuration File using the follwing command: sudo nano /etc/ssh/sshd_config
3- Search For PermitRootLogin and uncomment it and make sure its set to yes. 4- Then Go down in the file and set "PasswordAuthentication" to yes. Save and exit.
5- Restart SSH Service using the follwing command: sudo service sshd reload Thats it!

2.Installing vesta cp

Install Vest Control Panel ---------------------------
# Download installation script curl -O http://vestacp.com/pub/vst-install.sh
# Run it bash vst-install.sh note : give any email id and then the server.domain.com

3. Installng PMta and debugging the code

upload the file . install it by rpm -ivh file name now apply llicence and null to debug the code pmtad --debug

4. Basic config and debugging

config file

postmaster info@xmailing.me #smtp-port 25 smtp-listener 54.218.71.176:25 log-connections yes log-commands yes # WARNING: verbose! allow-unencrypted-plain-auth yes sync-msg-create false sync-msg-update false run-as-root no log-file /var/log/pmta/log # logrotate is used for rotation # move-to /opt/myapp/pmta-acct # configure as fit for your application # move-interval 5m max-size 50M # transient errors (soft bounces) move-interval 1d delete-after never records t # # spool directories # spool /var/spool/pmta http-mgmt-port 1983 http-access 127.0.0.1 admin http-access 0/0 monitor http-access 54.218.71.176 admin # BEGIN: USERS/VIRTUAL-MTA / VIRTUAL-MTA-POOL / VIRTUAL-PMTA-PATTERN # # password pass123 source {smtpuser-auth} smtp-service yes always-allow-relaying yes require-auth true process-x-virtual-mta yes default-virtual-mta pmta-pool remove-received-headers true add-received-header false hide-message-source true #BEGIN VIRTUAL MTAS smtp-source-host 54.218.71.176 server.xmailing.me #domain-key dkim,*,/home/admin/conf/mail/example.com/dkim.pem #domain-key default,*,/var/cpanel/domain_keys/private/example.com max-msg-rate 400/h route [127.0.0.1]:25 #END VIRTUAL MTAS virtual-mta pmta-vmta1 # END: USERS/VIRTUAL-MTA / VIRTUAL-MTA-POOL / VIRTUAL-PMTA-PATTERN always-allow-api-submission yes add-message-id-header yes retain-x-job yes retain-x-virtual-mta yes verp-default yes process-x-envid yes process-x-job yes jobid-header X-Mailer-RecptId process-x-virtual-mta yes route [127.0.0.1]:25

if you want the basic config just chage the domain and ip ( for amazon chage the private ip

to debug and see the error run pmtad --debug

Testing with smtpern.net

Setting Dkim record

dkim commands


find / -name dkim.pem
mv dkim.pem dkim_old
openssl genrsa -out dkim.private.key 1024
openssl rsa -in dkim.private.key -out dkim.public.key -pubout -outform PEM
mv dkim.private.key dkim.pem
vim dkim.public.key
service pmta restart

the dkim template


Host: dkim._domainkey
TXT Value : "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

>> after pasting this in dns zone . go to config file chanege and uncomment lines and also add the dkim.pem directroy and then add it , and restart pmta

Spf and Dmrac


SPF:
v=spf1 a mx ip4:54.218.71.176 -all
DMARC:
v=DMARC1; p=none; fo=1; rua=mailto:dmarc@xmailing.me; ruf=mailto:dmarc@xmailing.me

dns zone . txt record host @ txt valuse spf rexxord

ip rotation

>> server sub doomain 1. dns zone >> add trecord >> A record 2. pint ip to dirrrent servers name : server pints to ip

config ip rotaiton inside thhe server config file


>>> smtp listtener
>>go down virtual mta . copy it and palste it again with changes make it vmta2
>> make a new entry in the virtual pool
>> restart pmta and test in smtper .net with serer and different ips

id service provicder is not configing ip then follows

# If your Hosting Provider don't allow automatic Network Configuration for the second adapter, you need to run the following commands: # Navigate to the Network Adapters Directory: cd /etc/sysconfig/network-scripts # Copy the network configuration of the first ethernet adapter cp ifcfg-eth0 ifcfg-eth0:1 # Open The configuration to edit vim ifcfg-eth0:1 # set the values: #BOOTPROTO=dhcp DEVICE=eth0:1 #HWADDR=fa:16:3e:00:00:00 ONBOOT=yes TYPE=Ethernet #USERCTL=no IPADDR=XXX.XXX.XXX.XXX # your IP #restart network configuration service service network restart

installing mail server

>> installing mail wizz >> delivery server >>> create new >> smtp done

ip rotaion with spf

v=spf1 a mx ip4:54.218.71.176 p4:54.218.71.176 p4:54.218.71.176 ~all
https://www.appmaildev.com/en/dkim

Comments

Popular posts from this blog

powermta and vesta cp with mail wizz

How to install wine in kalilinux for using .exe files in linux