Help - Search - Members - Calendar
Full Version: Complainterator for Linux
SpamCop Discussion > Discussions & Observations > Suggested Tools and Applications
efa
I post also here, a version of Complainterator crossplatform, thinked to work on Linux, but work on every platform with a complete GNU/Posix environment.
As example I also test it with Cygwin on WinXP, but should work on Solaris or MacOS X.

It is written as a Bash scri_pt, so you have no GUI.
The scri_pt is written under the GNU/GPL license so, as everytime other developer are wellcomed.
My thanks to tembow for the idea and many explanations on domain name system
In my experience, it cutted my spam from 20 a day, to 5 a day. It carry my time around spam to near 0.


Invocation:
If run with a parameter, will be interpretated as a URL, and complaint for this.
It recover Registrar, Name Servers, Registrar Name Server, and send all the complaints emails for the spammed domain.

If run without parameter, it download all the spam from an IMAP4 account, from a particular spam folder.
spam should be moved there before by a Bayesian filter like the one included in Mozilla, that after a week of training, indentify 100% of spam with 0% false positive, carrying away from your eyes all the spam.
Then it analyze the spam (decoding as appropriate) to find the URL, and complaint for all the founded URL.
It can follow some simple redirect URL and complaint also for those.
Then it parse again the mail to find scam email, and complaint also for those.
Last, it forward the spam to a configured email like spamcop or knujon.
My suggestion is to use in tandem with Spamcop as are complementary solutions.
This version send complaint emails with domain in obfuscated [dot] format for some Registrars.
Initially are Beijing and Hichina, you can add more in 'RegistrarObfuscated.txt' file.


Take care of configure your user IMAP and SMTP mail account inside the scri_pt.
In particular correctly fill the string 'userMail' with <email>
Example:
userMail="Name <yourEmail[at]domain.tld>"
as some SMTP server require the <>
From this version you can (optional) use an external mail server configuration file.
It must be called 'xComplaintConfig.txt' and should be in this format:

CODE

# mail server user configurations:
export userImap="imap.gmail.com"       # imap4 server
export userUser=""       # user on imap4 server
export userPass=""       # pass on imap4 server
export imapSSL="--ssl"   # insert --ssl when IMAP server require (Gmail)
export spamFold="[Gmail]/spam"   # spam folder on IMAP server
export userSmtp=""       # user smtp server
export userMail=""       # user email "Name <email[at]domain.tld>"
export forwardEmail=""   # a mail to forward all spams



The Registrar list is exacly the same as:
http://www.spamtrackers.eu/downloads/Compl...lainterator.txt
but with unix style new line, sorted alphabetically, and with no line ending space.
Unfortunately the search algoritm is really slow. Need a new version in C language with a GUI in GTK+.


The scri_pt depend on the following external tools executables:

CODE

cat      # text handling
grep     # text handling
awk      # text handling
sed      # text handling
tr       # text handling
cut      # text handling
sort     # text handling
dos2unix # text handling
wc       # text handling
read     # input handling (bash builtin)
base64   # decode base64 encoding
iconv    # international encoding conversion

dig      # NameServer query
host     # IP query
whois    # whois query

wget      # URL html redirect check
telnet    # send emails
fetchmail # receive emails



On Windows you have to install Cygwin with standard package, plus whois, wget, inettools (for telnet), fetchmail, dos2unix, base64, and iconv.
More you have to install the package 'dig' from:
http://members.shaw.ca/nicholas.fong/dig/
as isn't included in Cygwin.


The package can be downloaded from:
http://www.castlecops.com/p1110770-Complai...ux.html#1110770
kamaraju
QUOTE(efa @ Sep 3 2008, 06:25 PM) *

I post also here, a version of Complainterator crossplatform, thinked to work on Linux, but work on every platform with a complete GNU/Posix environment.


I was experimenting with V.0.10.20 2008/09/09 and found out that you are using telnet in the scri_pt as in

if (test 0 == "$debug") then
cat sendoutDoma.txt | telnet $userSmtp 25
cat mailoutDoma.txt >> complaints.txt
echo "====================================================" >> complaints.txt
echo Mail sended. Exit.
else
echo Mail not sended. Exit.
fi


Is there no other alternative available (like ssh)? Telnet is supposed to be insecure and not all the Linux systems I know have telnet installed.

hth
raju
efa
QUOTE(kamaraju @ Sep 25 2008, 06:40 PM) *

Is there no other alternative available (like ssh)? Telnet is supposed to be insecure and not all the Linux systems I know have telnet installed.

the problem is the SMTP server.
Most I know, at ISO/OSI level 5, use simple un-encripted, un-autenticated, telnet connection on TCP port 25.
Exist ESMTP, SMTP/TLS and SMTP-AUTH (ESMTPA) protocol, but which provider use it?
Most provider check only the domain part of the sender email, and the direct connection to block relaing, but no real autentication or encription are used.
Try your SMTP server, it accept ssh connection? If yes, surely you can substitute telnet with ssh in the scri_pt.
Let me know if it work. If yes, please tell me which kind of SMTP server is.

Another solution may be to use 'exim' (or 'ssmtp' or 'msmtp') available everywhere. At simple level they do a telnet on port 25, but can also support all types of encription.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.