Mailbox checking.  This would be a great feature to add.  I figured if
SpamAssassin can reject a message and close the smtp connction, then so
could a custom function in qmail-scanner-queue.pl

Now I know I can recompile qmail-smtpd, but as a plesk user, I can't.  They
make custom changes, and nobody knows what these are.

Why do I want this?  Simple.  I am being hammered by spammers who connect
(they are not found in rbl checks), and then try to send messages to every
name under the sun.  These are scanned by Clamd and SA which is killing the
CPU/RAM.  I have stopped bounce messages, all of these files go to a black
hole, I log each mail and then send it to /dev/null in the .qmail-default
file.  Still when these mails come in, before qmail even looks to the
qmail-default file qmail-scanner runs it through SA/ClamAV.

Like I said before, I guess that if SA can reject a message, then we can do
the same from another check in the qmail-scanner script.  What we need to do
is open /var/qmail/users/assign.  We can then split the email address from
the domain and search for a match in this file.

The file uses <mailboxname>: so we can't just use simple matching, if we try
to match [EMAIL PROTECTED], we don't want to pick up [EMAIL PROTECTED] by
mistake.  So we should search for bob:, this still brings the problem of
miss-taking [EMAIL PROTECTED] when it is not really there.

So, really, I admit that I am a php guy and I don't know much about perl, or
really want to learn perl just for the sake of writing a 10 line function.
Can somebody give me the bennifit of their experiance?  I have come this
far:

# If we want to reject mail with no valid user
if ( $reject_dead) {


 # Go through each domain
 foreach $dom (@local_domains_array) {
  # Split the dmain name from mailbox/alias
  my ($first, $other) = split '@', $recips;
  # Give file location
  $alias_file = "/var/qmail/users/assign";
  # Open file
  open FILE "$alias_file" or die "Can't open myfile: $!";
  # Set search term
  $searchfor = $first . ':';
  # Search file for search term
  grep -i $searchfor, <FILE>;
  if (#term is found)
   { #Well, it exists
   # Just carry on as normal in qmail-scanner

  }else
   {
   # Not found, reject message
   &reject_email("We have reasons to believe you are a SPAMMER",31);
  }

 }

}


Now I know there is a lot missing in terms of finding the correct match in
teh file, but the rest makes sense right?

The form of the assign file is:

=2-bounce:popuser:110:110:/var/qmail/mailnames/domain.com/bounce:::
=2-cron:popuser:110:110:/var/qmail/mailnames/domain.com/server:::
=2-spam:popuser:110:110:/var/qmail/mailnames/domain.com/spam:::

I guess thats the same for all servers.

Many Thanks,

Justin Fielding,
Intelliweb Ltd UK.

A mission statement is defined as "a long awkward sentence that demonstrates
management's inability to think clearly." All good companies have one. -
Scott Adams, The Dilbert Principle, 1996"



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
Qmail-scanner-general mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/qmail-scanner-general

Reply via email to