Re: [vchkpw] accept selected mails

2003-03-16 Thread Jonas Pasche
Hi Payal,

 Thanks for the reply. Yes, I know about .qmail files but the problem how
 to *drop* unwanted mails.

As I said: Read the man pages.

From the qmail-command man page:

[...]
EXIT CODES
   command's exit codes are interpreted as follows:  0  means
   that the delivery was successful; 99 means that the delivĀ­
   ery was successful, but that qmail-local should ignore all
   further delivery instructions; [...]

Doesn't ignore all further delivery instructions sound like something
you need? :)

$ cat .qmail-yourfilter
|here-is-a-script-that-exits-99-if-the-sender-is-invalid
[EMAIL PROTECTED]

 Also should i just check the From: field or is there anything else I
 should check for (against the database, maybe using egrep)

That entirely depends on what you want to do.

Jonas




Re: [vchkpw] accept selected mails

2003-03-16 Thread Anders Brander
Hi,

On Sun, 2003-03-16 at 16:56, Jonas Pasche wrote:
 From the qmail-command man page:
 EXIT CODES
command's exit codes are interpreted as follows:  0  means
that the delivery was successful; 99 means that the delivĀ­
ery was successful, but that qmail-local should ignore all
further delivery instructions; [...]

- and there's more, i often use these defines in my dotqmail-code:

/* exit codes */
#define EXIT_ACCEPT 0
#define EXIT_DROP 99
#define EXIT_BOUNCE 100
#define EXIT_TEMPERROR 111

-- 
Anders Brander [EMAIL PROTECTED]




Re: [vchkpw] accept selected mails

2003-03-15 Thread Payal Rathod
* Jonas Pasche [EMAIL PROTECTED] [2003-03-15 07:35]:
 Hi Payal,
  I am using vpopmail + qmail on a test system. Now for user
  [EMAIL PROTECTED] I want to accept mails only from email addresses given in file
  accept_only.dat. The rest of the mails from any other email address 
  should be dropped/deleted without any notice.
  
  Can someone please give on hints on writing such a script?
 
 man dot-qmail
 man qmail-command
 
 Should be a simple two-liner .qmail file; the first line with an |if
 expression that checks $SENDER against your file and exits with an
 appropriate exit code, and a forward rule to a defined Maildir in the
 second line.

Thanks for the reply. Yes, I know about .qmail files but the problem how
to *drop* unwanted mails. I can check the mails against a sample.txt
file and if match is found redirect it to ./Maildir/. But how to drop
the mails otherwise?
Also should i just check the From: field or is there anything else I
should check for (against the database, maybe using egrep)

Warm regards,
-Payal

-- 
Visit GNU/Linux Success Stories
www.geocities.com/rpayal99
Guest-Book Section Updated.



Re: [vchkpw] accept selected mails

2003-03-15 Thread Cory Wright
On Sat, Mar 15, 2003 at 03:14:22PM +0530, Payal Rathod wrote:
 Thanks for the reply. Yes, I know about .qmail files but the problem how
 to *drop* unwanted mails. I can check the mails against a sample.txt
 file and if match is found redirect it to ./Maildir/. But how to drop
 the mails otherwise?

You can use the `validate-sender` program from my qblue package to accomplish
this.  If you want to deliver to a regular Maildir you could use the following:

  |if except validate-sender ~/Maildir/valid.dat; then maildir ./Maildir/ ; fi

The `maildir` script is part of the safecat package.

I am running vpopmail 5.3.9 with --enable-make-seekable=y and the following
also works for me:

  |if except validate-sender /var/vpopmail/domains/standblue.com/valid.dat; then 
/var/vpopmail/bin/vdelivermail '' /var/vpopmail/domains/standblue.com/cwright/ ; fi

These examples deliver the message if the sender address is listed in the 
valid.dat file, and drop it otherwise.  The validate-sender program relies
on $SENDER, which can easily be forged, so this should only be used to do
trivial checks.

You can find qblue at the following URL:

  http://projects.standblue.net/software/qblue/index.moto

Good luck,

Cory

--
Cory Wright
Stand Blue Technology
http://www.standblue.net/



Re: [vchkpw] accept selected mails

2003-03-14 Thread Jonas Pasche
Hi Payal,

 I am using vpopmail + qmail on a test system. Now for user
 [EMAIL PROTECTED] I want to accept mails only from email addresses given in file
 accept_only.dat. The rest of the mails from any other email address 
 should be dropped/deleted without any notice.
 
 Can someone please give on hints on writing such a script?

man dot-qmail
man qmail-command

Should be a simple two-liner .qmail file; the first line with an |if
expression that checks $SENDER against your file and exits with an
appropriate exit code, and a forward rule to a defined Maildir in the
second line.

Jonas