Archive

Archive for the ‘plesk’ Category

Mail queue management – Postfix

January 12, 2012 Leave a comment

Using qshape :-

ftp://ftp.kfki.hu/pub/packages/mail/postfix/experimental/postfix-2.2-20050222-newdb-nonprod/auxiliary/qshape/qshape.pl

For example, in the output below we see the top 10 lines of the (mostly forged) sender domain distribution for captured spam in the “hold” queue:

$ qshape -s hold | head
                         T  5 10 20 40 80 160 320 640 1280 1280+
                 TOTAL 486  0  0  1  0  0   2   4  20   40   419
             yahoo.com  14  0  0  1  0  0   0   0   1    0    12
  extremepricecuts.net  13  0  0  0  0  0   0   0   2    0    11
        ms35.hinet.net  12  0  0  0  0  0   0   0   0    1    11
      winnersdaily.net  12  0  0  0  0  0   0   0   2    0    10
           hotmail.com  11  0  0  0  0  0   0   0   0    1    10
           worldnet.fr   6  0  0  0  0  0   0   0   0    0     6
        ms41.hinet.net   6  0  0  0  0  0   0   0   0    0     6
                osn.de   5  0  0  0  0  0   1   0   0    0     4

If one looks at the two queues separately, the incoming queue is empty or perhaps briefly has one or two messages, while the active queue holds more messages and for a somewhat longer time:

$ qshape incoming

                 T  5 10 20 40 80 160 320 640 1280 1280+
          TOTAL  0  0  0  0  0  0   0   0   0    0     0

$ qshape active

                 T  5 10 20 40 80 160 320 640 1280 1280+
          TOTAL  5  0  0  0  1  0   0   0   1    1     2
  meri.uwasa.fi  5  0  0  0  1  0   0   0   1    1     2

This is from a server where recipient validation is not yet available for some of the hosted domains. Dictionary attacks on the unvalidated domains result in bounce backscatter. The bounces dominate the queue, but with proper tuning they do not saturate the incoming or active queues. The high volume of deferred mail is not a direct cause for alarm.

$ qshape deferred | head

                         T  5 10 20 40 80 160 320 640 1280 1280+
                TOTAL 2234  4  2  5  9 31  57 108 201  464  1353
  heyhihellothere.com  207  0  0  1  1  6   6   8  25   68    92
  pleazerzoneprod.com  105  0  0  0  0  0   0   0   5   44    56
       groups.msn.com   63  2  1  2  4  4  14  14  14    8     0
    orion.toppoint.de   49  0  0  0  1  0   2   4   3   16    23
          kali.com.cn   46  0  0  0  0  1   0   2   6   12    25
        meri.uwasa.fi   44  0  0  0  0  1   0   2   8   11    22
    gjr.paknet.com.pk   43  1  0  0  1  1   3   3   6   12    16
 aristotle.algonet.se   41  0  0  0  0  0   1   2  11   12    15

Important commands :-

  • Print queue: postqueue -p
  • Delete all messages from the queue: postsuper -d ALL
  • Read a message: postcat -q <queue file id>
  • See what shape the queue is in: qshape

Release messages from hold

mailq | awk '{if($1 ~ /[A-F0-9]+!$/) {gsub(/!/, "", $1); print($1); system(sprintf("postsuper -H%s", $1)); } }'
postqueue -f

Requeue hold messages to force delivery

mailq | awk '{if($1 ~ /[A-F0-9]+!$/) {gsub(/!/, "", $1); print($1); system(sprintf("postsuper -H%s", $1)); } }'

Flush the queue

postqueue -f

Clean all MAILER-DAEMON error messages

 

Normal Messages

mailq | tail +2 | awk '{ if ($7 == "MAILER-DAEMON") print $1 } ' | postsuper -d -

for me mailq returns the message id with a trailing ! so I use:

mailq | awk '{ if ($7 == "MAILER-DAEMON") print substr ($1, 1, length($1)-1) } ' | postsuper -d -

 

Messages with errors

mailq | grep MAILER-DAEMON |  sed -e 's/!$//' | cut -d " " -f 1 | postsuper -d -

or

mailq | tail +2 | awk '{ if ($7 == "MAILER-DAEMON") print $1 } ' | sed -e 's/!$//' | postsuper -d -

If you want to delete messages with the ! sign on the end, use

mailq | tail +2 | awk '{ if ($7 == "MAILER-DAEMON") print $1 } ' | cut -d! -f 1 | postsuper -d -

If you want to delete messages with the * sign on the end, use

mailq | tail +2 | awk '{ if ($7 == "MAILER-DAEMON") print $1 } ' | cut -d* -f 1 | postsuper -d -

 

NOTE

Sometimes, you may need to omit the

tail +2

courtesy :

http://maia.deec.uc.pt/Computers/Operating_Systems/Linux/Servers/Mail/Postfix/Postfix_Queue_Man

Categories: Linux, plesk, Postfix Tags:

Unable to remove Plesk Domain

January 12, 2011 2 comments

When we try to remove domain the following error message is appearing.

Unable to delete hosting: Unable to create SubDomainManager: Unable to create SubDomainPerformance object: WebServerManager::getSubDomainPerformance() failed: Unable to parse current performance.


Also I am not able to remove the subdomains.

When accessing a sub domain management page the following error message is displayed:

Unable to create SubDomainManager object: Unable to create SubDomainPerformance object: WebServerManager::getSubDomainPerformance() failed: Unable to parse current performance.

CAUSE
========
Sub domain is not configured in IIS.

RESOLUTION
========

It’s needed to be re-configured. This can be done using the following command line utility:

“%plesk_bin%\websrvmng.exe” –update-subdomain –vhost-name=<domain> –subdomain=<subdomain>

==========================

If the issue persist try  these also :

1. Remove the Registry Key

HKEY_LOCAL_MACHINE -> SOFTWARE -> PLESK -> PSA Config -> Config ->SitesCache

2. The follow your suggestion and remove the domain.

cd %plesk_bin%

websrvmng.exe –remove-vhost –vhost-name=Domainname

3. Then install the domain through the command line:

websrvmng.exe –install-vhost –vhost-name=Domainname

4. Then go to the Plesk Control Panel and delete the domain. It is still in the list, but it will actually delete this time.

Categories: IIS, plesk, Windows Tags: , ,

[FIX] Tables are not displayed in MSSQL DB Webadmin.

January 8, 2011 Leave a comment

Symptoms

When browsing MSSQL database as domain user using MSSQL DB Webadmin no tables are displayed. But they can be seen when logged in as sa.

Cause

Plesk uses DB user that is created in a database to establish connection to MSSQL using DB Webadmin. It’s the first user listed in users list for a database. Actually all users in this database should have db_owner role on the database. The most likely reason of the is that the user has db_denydatareader role enabled.

Resolution

Remove role db_denydatareader from the user.

Categories: plesk

The file filename.php is part of Plesk distribution. It cannot be run outside of Plesk environment.

January 8, 2011 Leave a comment

To fix the issue in the first case you need to complete the following steps:

1. Close your browser. Or just make sure that your browser does not show cached web pages.

2. Stop Plesk Control Panel Service.

3. Remove all files from within %plesk_dir%PrivateTempd. Reset current Plesk to default PLSK.00000000.0000. You can do it using defpkey.reg attached to this article.

4. Start Plesk Control Panel Service.

6. Re-upload valid Plesk key straight via Plesk Panel. You can upload PLSK.XXXXXXXX.XXXX.exe key.

To fix the issue in the second case you need to follow the steps:

1. Switch Plesk web server to another provider.

If IIS is used as Plesk web server switch it to Apache:

%plesk_bin%\reconfigurator.exe --switch-plesk-web-server --new-provider=apache


If Apache is used as Plesk web server switch it to IIS:

%plesk_bin%\reconfigurator.exe --switch-plesk-web-server --new-provider=iis



Check if Plesk works correctly once these steps are completed. Plesk PHP files were corrupted if the same error is displayed. . In this case you need to run Plesk Repair in Add or Remove Programs.

Attachments:

Categories: plesk

Reset my admin password on my Plesk Linux server

September 9, 2010 2 comments

This can be accomplished with the ch_admin_passwd binary.

[root@plesklinux root]# cd /usr/local/psa/admin/bin/

[root@plesklinux bin]# ./ch_admin_passwd --help./ch_admin_passwd:

Utility to set Plesk adminstrator’s password

Gets password from the environment variable PSA_PASSWORD
Password should be from 5 to 16 symbols and should not contain login name, whitespace, quotes or national characters.

Usage: ./ch_admin_passwd -h, --help

display this help and exit.
We must export the variable before running the binary. We will unset the variable when we are done.

[root@plesklinux bin]# export PSA_PASSWORD='newpass'

[root@plesklinux bin]# echo $PSA_PASSWORDnewpass

[root@plesklinux bin]# ./ch_admin_passwd

[root@plesklinux bin]# export PSA_PASSWORD=

[root@plesklinux bin]# cat /etc/psa/.psa.shadownewpass

[root@plesklinux bin]#
Categories: plesk Tags: , ,

Plesk rebuild Apache configuration files

September 9, 2010 1 comment

Sometimes you need to rebuild all your httpd.include files, it can be done with websrvmng command:

/usr/local/psa/admin/bin/websrvmng -av

Backup and restore a Plesk domain from the command line

September 9, 2010 Leave a comment

BACKUP

Set a domain name as a variable in your shell (not really required, just makes the rest harder to screw up if you copy and paste from this howto):

DOMAIN_NAME=example.com

Go to the directory where plesk keeps the dumps

cd /var/lib/psa/dumps/$DOMAIN_NAME

Create a file with the description. even if you don’t care about the description, the file needs to exist.

echo "description goes here" > description.txt

Run the backup:

/usr/local/psa/admin/bin/domain_bu --backup --domain-name  $DOMAIN_NAME --dump-file $DOMAIN_NAME.domain_dump --desc-file  description.txt

Note that the shell prompt will be returned to you before the backup is completd. you can watch for the backup to be finished with this command (after waiting a moment or two for backup_restore.log to be created if it wasn’t there already):

tail -f backup_restore.log

When you see the text “Single domain backup is successfully completed.” (or something to that effect, depending on your version), the backup is completed.

RESTORE

To restore again with the backup, or restore on another server:

– Add the domain under the desired client in plesk (the domain has to exist in plesk to continue).

– Copy the .dump file to other server’s /var/lib/psa/dumps/[DOMAIN_NAME] directory.

– Set a domain name, client login and ip address the site should use as variables in your shell (not really required, just makes the rest harder to screw up if you copy and paste from this howto):

DOMAIN_NAME=example.com
CLIENT_LOGIN=myclient
IP_ADDRESS=1.2.3.4

Go to the dumps directory where you had copied the dump to

cd /var/lib/psa/dumps/$DOMAIN_NAME

Run the restore command:

/usr/local/psa/admin/bin/domain_bu --restore --domain-name  $DOMAIN_NAME --client-login $CLIENT_LOGIN --domain-ip $IP_ADDRESS  --dump-file $DOMAIN_NAME.domain_dump

If you get errors when restoring related to unmatched cert, see the instructions here: http://forum.plesk.com/showthread.php?s=&threadid=12274

Categories: plesk Tags: , , ,