Posts

Commands to check spamming in POSTFIX mail server

Commands to check spamming in POSTFIX mail server 1. To see the mail queue: # mailq 2. To flush the mail queue: # postfix flush  OR # postfix -f 3. To remove all mails from the queue: # postsuper -d ALL 4. To remove all mails in the deferred queue: # postsuper -d ALL deferred 5. To delete all queued messages from or to the domain called  spamdomain.com : # ./ postfix-delete.pl   spamdomain.com 6. To delete all queued messages that contain the word “abc” in the e-mail address: # ./ postfix-delete.pl  abc 7. To know the number of messages sitting in the deferred queue: # find /var/spool/postfix/deferred -type f | wc -l 8. To get a sorted list of the accounts that have the most mail in the queue. This usually means a maximum of 2 or 3 spammers at the end of the list: # mailq|grep ^[A-F0-9]|cut -c 42-80|sort |uniq -c|sort -n|tail 9.Get the mailids of all email currently in queue: postqueue -p|egrep “[A-F0-9]{11}”|awk ‘{print ...

How to identify a script sending spam through Postfix

You get information that your server is sending out spam emails. You have to find the source of the problem to fix it and stop it as soon as possible. Switch to a user with sudo rights Check the mail queue with command mailq The first column of the mail queue list shows unique mail ID's, pick one from an obvious spam email and copy it Check this email's details with command postcat -q <ID> using the unique mail ID you copied in place of <ID> Identify the line starting with "X-PHP-Originating-Script". This should show which script is generating the spam emails Remove the script, patch the website with latest security fixes and make sure folder and file permissions are secure Empty the mail queue with command postsuper -d ALL Check the mail queue again with command mailq to see if more emails are now generated. If the problem persists, repeat the above steps and see if you find other scripts causing you problems. Ref: https://frontmag.no/artikl...

Windows DNS Export/Import

Image
Exporting / Importing Standard DNS zone records are relatively easy; just copy the zone (eg. orange.com.dns ) files from existing server (C:\WINDOWS\system32\dns) and place these .dns files in the same location (C:\WINDOWS\system32\dns) in the target (new) server, restart the DNS service and you are done. Note: if you are hosting mix DNS record (AD and Standard) then copy zone file may not work. Your need to create empty primary standard domain in forward lookup zone and open this zone file from C:\WINDOWS\system32\dns and copy the contents from the source .dns file and reload or restart the dns server for refresh. . Exporting AD Integrated DNS zone records: Generally exporting AD DNS to files is recording purpose. We can build a new DNS server and all these record will be replicated. Step 1. Mouse right click on the every zone record and click on Export list…. Alternative (using dnscmd command) F.Y.I – DNSCMD comes with the Windows Support Tools. C...

Exporting and Importing Sites and App Pools from IIS 7 and 7.5

Exporting and Importing Sites and App Pools from IIS 7 and 7.5 When using multiple IIS server in a Load Balanced Environment it will  be alot of work to create all your website twice with the same settings on each webserver. Therefor it is possible to export and import your configuration from one webserver to the other. This will also be usefull when your upgrading from IIS 7 (Windows Server 2008) to IIS 7.5 (Windows Server 2008 R2). When you create a website in IIS 7 or 7.5 a unique application pool will also be created and used by this website, that’s why you need to import these application pools first on the second webserver before importing the website(s). To Export the Application Pools on IIS 7 : %windir%\system32\inetsrv\appcmd list apppool /config /xml > c:\apppools.xml This will export all the application pools on your webserver, therefor you need to edit the apppools.xml and remove the application that you do not need to import for exampl...

HOW TO CONNECT FTP OVER SSL/TLS IN FILEZILLA

Image
For the security reasons, we recently enabled FTP over SSL/TLS on servers. Plain text authentication (Clear Text Session) will no longer work on our servers. For the users we would suggest to use FTP client like FileZilla, to upload their web contents. Below mentioned are the instructions to upload files/folders using FileZilla FTP client: Create Site Go to File >> Site Manager >> New Site . Following are the required details to fill up. Host: Enter Hostname(i.e. ftp.yourdomain.com) or IP address which we have sent in Welcome e-mail. Port: 990 (Default FTP port is 21, you can also keep it blank). Protocol: FTP - File Transfer Protocol. Encryption: Select Required implicit FTP over TLS from dropdown list. Logon Type: Select Normal from the dropdown list. User: Your FTP username. Password: Your FTP Passw ord. 3.Click on Connect button, if you wish to temporary connect otherwise...

How to setup multiple PHP versions on Apache

There are several reasons you might need to run multiple versions of PHP on the same server. Maybe you have a PHP 5.2 application running on your server and you need to start working on another application based on a new framework like Symfony2 or Lithium? Perhaps you haver a client with a legacy site that runs PHP 5.2, or maybe you simply want to test some of the new functionality? This post is going to explain how to setup a server to run multiple versions of PHP. Apache doesn’t allow multiple versions of PHP using mod_php, so we need to compile it using FastCGI support. This will allow us to configure multiple sites, each one with a different version of PHP. I also allow us to specify the owner of the PHP process so we don’t have to use the default Apache user. Assigning specific users for each site has a number of advantages, including eliminating those pesky permissions problems when you have files created both by users and the webserver. Pre-requisites Before the start, w...

Backup & Restore Database as SQL Dump by SqlYog

Image
Direct Connection using MySQL C API (Sqlyog) → Download SQLyog Community Edition from this url and install /run https://github.com/webyog/sqlyog-community/wiki/Downloads fter you have connected to an instance of MySQL, you can make additional connections by selecting the New Connection option from the File menu. Saved Connections Select the connection name from the list. To rename a saved connection, click on the Rename button and edit the connection name and click save option to save the changed connection name. Other details can also be changed by selecting the particular connection, changing the necessary values and then by clicking on save to save those values. MySQL Host Address Specify a host name where the database is situated or the IP address of the server. User Name Specify a user name for connecting to the database server. Note: This is MySQL username...