Every day, enormous amounts of SPAM are generated on the Internet, filling the inboxes of all email users. Most SPAM is sent by computers infected with bots and controlled by a third party, which are grouped into so-called bot farms to send bulk junk mail or carry out denial-of-service attacks.
To prevent any of our servers from ending up on an RBL (short for Realtime Blackhole List, or Lista Negra en Tiempo real in Spanish) because our server is sending SPAM to other servers in bulk, it is important to control outgoing mail.
At Clouding, we have an agreement with OpenProvider that offers SpamExperts accounts to control SPAM both incoming and outgoing. As Clouding customers, you have a promotional coupon that gives you a discount on many OpenProvider products.
In the following tutorial, we explain how to configure an outbound filter in SpamExperts to prevent outgoing SPAM.
Configuration in the OpenProvider account
Once you have registered with OpenProvider using the coupon we email you when you register with Clouding.io, access your OpenProvider panel and go to Filtro de SPAM in the menu on the left. The first step is to add a new filter by clicking Añadir nuevo filtro.
As shown in the image below, add a domain name, which should generally be mail.dominio.TLD. Then select the product “Filtro de Salida” and finally, in Servidor de correo, enter the same value as the domain name along with its port.
Once you have filled in all this information, click the green button labeled "Guardar".
Now, in the Filtro de spam section, you will see the new filter you created. To configure this filter, click the "Ir al panel de control del filtro de spam".
Once inside the spam filter control panel, select the menu option Salida > Manejar usuarios, where you will create a user as shown in the following image. Finally, click "Añadir y configurar".
A new page will open where you must select the option "Remitente envolvedor" in the "Método de identificación" section and then uncheck the box labeled "Activar límite de conexión saliente".
Configuration on the Clouding server
Finally, to complete the configuration, we need to make some changes so that our server at Clouding uses the OpenProvider service we configured earlier. To do this, we need to modify a file depending on whether we use Postfix or Qmail.
If you use Postfix
Edit the file /etc/postfix/main.cf and change the relayhost parameter to the following:
relayhost = smtp.antispamcloud.com:587Finally, restart the mail service:
/etc/init.d/postfix restartIf you use Qmail
Edit or create the file /var/qmail/control/smtproutes and add the following text:
:smtp.antispamcloud.com:587/etc/init.d/xinetd restartFinally, restart the mail service:
/etc/init.d/xinetd restartIf you use Exim
Edit the default Exim configuration file /etc/exim/exim.conf. Look for the following lines in the file:
begin routersAnd add the following:
spamexperts_smarthost_router:
driver = manualroute
# Exclude null sender messages from relaying via the smarthost
condition = ${if or {{!eq{$sender_address}{}} {!eq{$sender_host_address}{}}}}
transport = spamexperts_smarthost_transport
route_list = $domain smtp.antispamcloud.com::587
no_moreIf you are using Exim with VestaCP, it is important to also add the line:
domains = ! +local_domainsThis is what the configuration for VestaCP should look like:
spamexperts_smarthost_router:
driver = manualroute
domains = ! +local_domains
# Exclude null sender messages from relaying via the smarthost
condition = ${if or {{!eq{$sender_address}{}} {!eq{$sender_host_address}{}}}}
transport = spamexperts_smarthost_transport
route_list = $domain smtp.antispamcloud.com::587
no_moreTo prevent local mail from being sent, add these lines after begin transports:
spamexperts_smarthost_transport:
driver = smtp
hosts_require_tls = *Finally, restart the mail service:
/etc/init.d/exim restartAdd an SPF record to DNS
You also need to add an SPF record to your DNS so that SpamExperts can verify the server. Below, we explain how to add an SPF record in the Clouding panel. First, log in to your account and click “DNS” in the top menu.
Add a new record by clicking the + symbol. A form will appear that you need to fill in as follows:
- Tipo de registro: TXT
- Subdominio: Leave this blank.
- Datos: v=spf1 include:spf.antispamcloud.com -all
- TTL: 3600
Once you click "Enviar", a new record will appear:
Add a DKIM signature (optional)
To enable the DKIM signature, go to the SpamExperts panel and select the option: Generar certificado DKIM. In the Selector DKIM field, enter default. The website will return text that you must use to create a TXT record, just as you did for SPF.