Article ID: 128327, created on Feb 14, 2016, last review on Feb 15, 2016

  • Applies to:
  • Plesk Automation 11.5

Symptoms

The server is saturated with spam. There are many messages in the queue. Mail is sent slowly.

Resolution

Often spammers using non-existing mail addresses as destination. In such cases it's recommended to check that all domains have the option What to do with mail sent to nonexistent users set to Reject and not to forward. (click on the image below to get an example)

screenshot

In order to change this setting for all domains on mail server as follows:

  1. Find the ID of the node at Hosting Provider CP > Infrastructure > Service Nodes (for example, 27 for pa115postfix1.adatum.com).

  2. Login to PA Management node as root via SSH.
  3. Get ServiceNodeId by following query:

    [root@cp ~]# mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa -Ne "select id from ServiceNodes where externalId=27;" 
    +----+ 
    | 17 | 
    +----+
    
  4. Generate list for the service node ID 27 (ID 17 in psa database):

    [root@cp ~]# mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa -sNe "SELECT name FROM domains WHERE parentDomainId = 0 AND id IN (SELECT dom_id FROM DomainServices WHERE type='mail' AND ipCollectionId IN (SELECT ipCollectionId FROM IpAddressesCollections WHERE ipAddressId IN (SELECT id FROM IP_Addresses WHERE serviceNodeId = 17)))" > mail01_domains.txt
    

    Where is serviceNodeId = 17 id of mail service node, from step 3.

  5. Create set_mail_opt.sh script with following content:

    #!/bin/bash
    while read dom; do
    /usr/local/psa/bin/subscription_settings -u $dom -no_usr reject
    
    done < $1
    
  6. Add execution permission for root:

    [root@cp ~]# chmod 0744 set_mail_opt.sh
    
  7. Now you can apply mail settings with the script as follows:

    # ./set_mail_opt.sh mail01_domains.txt
    

    mail01_domains.txt - is the list of domain with Mail Hosting on pa115postfix1.adatum.com

Next step is to check that all the IP addresses and networks in the white lists are reliable and familiar to you under Hosting Provider CP > Infrastructure > Service Nodes > mail service node > Mail Server Settings > White List. Make sure that SMTP authorization is enabled, otherwise server will act as open relay, i.e. allows anyone on the Internet to send e-mail through it.

Since PA update #18 you can use DomainKeys spam protection and Greylisting for the Postfix mail server. For additional information please check Greylisting and DomainKeys in Plesk Automation.

Also, it's recommended to enable SpamAssassin filter on the server-wide level under Hosting Provider CP > Infrastructure > Service Nodes > mail service node > Spam Filter Settings. In order to enable SpamAssassin by the default please check How to enable Spamassassin by default on mail accounts?

You can also apply the solution from another article, which describes the procedure of discovering which domains are sending mail through PHP scripts in case of using Postfix.

Note: In case of using Plesk Automation, all steps from #114845 article should be applied on Postfix service node and changes must be reverted back as soon as spam source will be identified.

Search Words

spam

outgoing spam

mail spoofing

flooded mail queue

mail enable open relay

postfix spam

cannot send and receive email

email server very slow

server send mail to spam

Mail Queue stuck and many spam messages

spam abuse

mail queue full with spam

mail message is bounced

spam attack

spam email

33a70544d00d562bbc5b17762c4ed2b3 caea8340e2d186a540518d08602aa065 e0aff7830fa22f92062ee4db78133079

Email subscription for changes to this article
Save as PDF