Upgrading from Ubuntu 8.04 to 10.04 LTS
today I will show one of the techniques que he empleado para bloquear los correos SPAM que llegan diariamente a los buzones de los usuarios, esta vez me enfoque en los Asuntos y el Contenido del Mensaje, es algo similar a lo implementado por mi amigo
hollman
para bloquear el contenido adjunto del mensaje.
ahora si vamos a la practica.
Queremos bloquear la palabra Viagra tanto en Asunto del Mensaje y tambien si esta hace parte del contenido del mensaje, lo hariamos de la siguiente forma
"editamos el archivo main.cf"
#vi /etc/postfix/main.cf
"agregamos estas dos lineas" body_checks = regexp:/etc/postfix/body_checks header_checks = regexp:/etc/postfix/header_checks.regexp
well now we have to create these files (they are ordinary text files)
# vi / postfix / header_checks.regexp
"add the following content"
/ ^ Subject: .* Viagra $ .* / REJECT "Invalid Subject" (1)
"inside the quotes put the message that will be released in the logs to see what you are filtering, usually list the block line by line with (a) (2) to make this easier by if you have any problems or because no blockade. "
file with some of the issues look like this:
/ ^ Subject: .* viagra .* $ / REJECT "Invalid Subject" (1) / ^ Subject: .* V1agra .* $ / REJECT "Invalid Subject" (2) / ^ Subject: .* V! agra .* $ / REJECT "Invalid Subject" (3)
/ ^ Subject:. * V1 agra .* $ / REJECT "Invalid Subject" (4)
/ ^ Subject: .* Cialis .* $ / REJECT "Invalid Subject" (5)
/ ^ Subject: .* sex .* $ / REJECT "Subject not valid" (6)
/ ^ Subject: .* strong .* $ / REJECT "Invalid Subject" (7) / ^ Subject: .* herbal .* $ / REJECT "Invalid Subject" (8) / ^ Subject: .* Herbal Formule .* $ / REJECT "Invalid Subject" (9)
"save"
well what was just created the file to the issues.
now create those who checked the body of the message.
# vi / etc / postfix / body_checks
"we enter the content"
/ Viagra & Cialis / REJECT
put the word (s) to block within the "/" and accompanied by the word REJECT.
a file with multiple keywords to block looks more or less:
/ casino online / REJECT / real casino / REJECT / seven casino / REJECT
/ European Union / REJECT
/ great games / REJECT
/ REJECT http://www.bestlux-games.net/
/ female / REJECT / Click here to view as a web page / REJECT / drudgery / REJECT
"save"
NOTE: we need to verify rather than words or phrases are going to block, since this method is very accurate, but usually crashes coincidences "
give right now:
# postmap / etc / postfix / body_checks
# postmap / etc / postfix / header_checks.regexp
after this we can see that files are created with the same name but accompanied. db, well now if we restart postfix to
changes take
# / etc / init.d / postfix restart
if we try to send an email and it contains the words we enter in our database we will see is rejected by the server.
you can feed your "database" so that your email contains less SPAM. Always remember
enter words in these files restart postfix for him to take the changes. Hello
0 comments:
Post a Comment