Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
spam [2008/05/01 22:18] greebo |
spam [2016/08/05 09:00] (current) zagi |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ===== HOSTS adblocker ==== | ||
| - | = DNS " | ||
| - | IN MX 5 | + | <code bash> |
| - | IN MX 10 your.real.mx.server | + | # |
| - | IN MX 15 spamvoid.aufbix.org. | + | |
| + | # If this is our first run, save a copy of the system' | ||
| + | if [ ! -f / | ||
| + | then | ||
| + | echo " | ||
| + | sudo cp /etc/hosts / | ||
| + | sudo chmod 444 / | ||
| + | fi | ||
| + | |||
| + | # Perform work in temporary files | ||
| + | temphosts1="/ | ||
| + | temphosts2="/ | ||
| + | temphosts3="/ | ||
| + | temphosts4="/ | ||
| + | |||
| + | # Obtain various hosts files and merge into one | ||
| + | echo " | ||
| + | wget -nv -O - http:// | ||
| + | wget -nv -O - http:// | ||
| + | #wget -nv -O - http:// | ||
| + | wget -nv -O - http:// | ||
| + | wget -nv -O - http:// | ||
| + | wget -nv -O - " | ||
| + | |||
| + | # Do some work on the file: | ||
| + | # 1. Remove MS-DOS carriage returns | ||
| + | # 2. Delete all lines that don't begin with 127.0.0.1 or 0.0.0.0 or ::1 | ||
| + | # 3. make everything lowercase | ||
| + | # 4. Delete any lines containing the word localhost because we'll obtain that from the original hosts file | ||
| + | # 5. Replace 127.0.0.1 and 0.0.0.0 with ::1 {localhost on IPv6} | ||
| + | # 5. Scrunch extraneous spaces separating address from name into a single tab | ||
| + | # 6. Delete any comments on lines | ||
| + | # 7. Clean up leftover trailing blanks | ||
| + | # 8. We whitelist hosts j.mp | ||
| + | # | ||
| + | # Pass all this through sort with the unique flag to remove duplicates and save the result | ||
| + | echo " | ||
| + | # | ||
| + | # IPv4 | ||
| + | #sed -e ' | ||
| + | # | ||
| + | # IPv6 ready | ||
| + | sed -e ' | ||
| + | |||
| + | # Combine system hosts with adblocks | ||
| + | echo Merging with original system hosts... | ||
| + | echo -e "# Windows HOSTS file should NOT be over 135K!\n# Ad blocking hosts generated " | ||
| + | cat / | ||
| + | sudo cp $temphosts3 / | ||
| + | |||
| + | # Clean up temp files and remind user to copy new file | ||
| + | echo " | ||
| + | rm $temphosts1 $temphosts2 $temphosts3 $temphosts4 | ||
| + | echo " | ||
| + | echo | ||
| + | echo "You can always restore your original hosts file with this command:" | ||
| + | echo " sudo cp / | ||
| + | echo "so don't delete that file! (It's saved read-only for your protection.)" | ||
| + | |||
| + | # *buntu style | ||
| + | / | ||
| + | |||
| + | |||
| + | </ | ||
| + | |||
| + | original (with bugs) @ http:// | ||
| + | |||
| + | |||
| + | how to use this in Ubuntu >>> | ||
| + | ====== Fighting SPAM ====== | ||
| + | |||
| + | http:// | ||
| + | |||
| + | |||
| + | ===== DNS " | ||
| + | |||
| + | http:// | ||
| + | |||
| + | |||
| + | http:// | ||
| + | |||
| + | | ||
| + | IN MX 20 your.real.mx.server | ||
| + | IN MX 25 your-ipv4only.real.mx.server | ||
| + | IN MX 30 spamtrap-tryothermx | ||
| Most spam/ | Most spam/ | ||
| - | Spamvoid.aufbix.org | + | \\ |
| + | spamtrap-tryothermx | ||
| + | |||
| + | [http:// | ||
| + | \\ | ||
| + | 5. Address Resolution and Mail Handling\\ | ||
| + | ...\\ | ||
| + | When the lookup succeeds, the mapping can result in a list of\\ | ||
| + | alternative delivery addresses rather than a single address, because\\ | ||
| + | of multiple MX records, multihoming, | ||
| + | mail transmission, | ||
| + | each of the relevant addresses in this list in order, until a\\ | ||
| + | delivery attempt succeeds. \\ | ||
| + | \\ | ||
| + | |||
| + | |||
| + | * greylisting == | ||
| + | * sender address verification = | ||
| + | * RFC2820/ | ||
| + | * helo checks = | ||
| + | * policyd-weight | ||
| + | |||
| + | |||
| + | |||
| + | ===p0f=== | ||
| + | |||
| + | <code bash> | ||
| + | #! /bin/sh | ||
| + | # | ||
| + | # start p0f | ||
| + | |||
| + | case " | ||
| + | start) | ||
| + | / | ||
| + | ;; | ||
| + | |||
| + | stop) ps aux | grep p0 | grep -v grep | grep -v stop | ||
| + | #killall -9 / | ||
| + | echo "You will have to kill p0f and p0f-analyzer manually" | ||
| + | ;; | ||
| + | |||
| + | *) N=/ | ||
| + | echo " | ||
| + | exit 1 | ||
| + | ;; | ||
| + | esac | ||
| + | exit 0 | ||
| + | </ | ||
| + | |||
| + | ===p0f spamassassin== | ||
| + | / | ||
| + | |||
| + | header L_P0F_WXP X-Amavis-OS-Fingerprint =~ /^Windows XP/\\ | ||
| + | score L_P0F_WXP 3.5\\ | ||
| + | header L_P0F_W X-Amavis-OS-Fingerprint =~ / | ||
| + | score L_P0F_W 1.7\\ | ||
| + | header L_P0F_UNKN X-Amavis-OS-Fingerprint =~ / | ||
| + | score L_P0F_UNKN 0.8\\ | ||
| + | header L_P0F_Unix X-Amavis-OS-Fingerprint =~ / | ||
| + | score L_P0F_Unix -1.0\\ | ||
| + | |||
| + | === / | ||
| + | |||
| + | |||
| + | \\ | ||
| + | # Use passive OS fingerprinting\\ | ||
| + | $os_fingerprint_method = ' | ||
| + | \\ | ||
| + | #$log_level = 1;\\ | ||
| + | |||
| + | \\ | ||
| + | $policy_bank{' | ||
| + | \\ | ||
| + | |||
| + | == clam == | ||
| + | |||
| + | add clamav to amavis group | ||
| + | |||
| + | 01-debian: | ||
| + | $unrar | ||
| + | |||
| + | / | ||
| + | |||
| + | chomp($mydomain = `hostname -d`); | ||
| + | @local_domains_acl = qw (.); | ||
| + | |||
| + | |||
| + | 20-debian-defaults\\ | ||
| + | $virus_quarantine_method = undef;\\ | ||
| + | $spam_quarantine_method = undef;\\ | ||
| + | $banned_files_quarantine_method = undef;\\ | ||
| + | $bad_header_quarantine_method = undef;\\ | ||
| + | \\ | ||
| + | |||
| + | $final_spam_destiny | ||
| + | |||
| + | $X_HEADER_LINE = " | ||
| - | | + | 30-template-localization\\ |
| + | $hdr_encoding | ||
| + | $bdy_encoding | ||
| - | = sender address verification = | ||
| - | = RFC2820/ | ||
| - | = helo checks = | ||
| - | = policyd-weight = | ||

