Re: [vchkpw] vdelivermail writes the wrong ,S= value when spamassassin is enabled

2015-09-17 Thread Rolf Eike Beer
> When spamassassin is enabled but maildrop is not I see failed assertions in
> dovecots POP server[2], which are caused by vdelivermail using a wrong
> filename. The filename, more exactly the S= value is calculated
> _before_ the mail is piped into spamassassin, which adds two more header
> lines with it's scan results, so the actual size afterwards is bigger than
> what is recorded. The attached patch #5 fixes this for me, with some
> cleanups in #1-#4 I did on the way to find the culprit.

Ping?

signature.asc
Description: This is a digitally signed message part.
!DSPAM:55fafb1041552455840022!

Re: [vchkpw] vdelivermail segfault on 5.4.28

2009-09-07 Thread Remo Mattei

What is the os Federico
Contattano off line ciao

Remo
Inviato da iPhone

Il giorno Sep 6, 2009, alle ore 14:15, Federico Santulli mob...@nhm.it 
 ha scritto:



dmesg shows this:

vdelivermail[17906]: segfault at 20 ip 00411311 sp  
7fffc3f1c290 error 4 in vdelivermail[40+19000]


is there any fix ?



What is the os Federico

Inviato da iPhone

Il giorno Sep 6, 2009, alle ore 14:15, Federico Santulli mob...@nhm.it 
 ha scritto:



dmesg shows this:

vdelivermail[17906]: segfault at 20 ip 00411311 sp  
7fffc3f1c290 error 4 in vdelivermail[40+19000]


is there any fix ?
!DSPAM:4aa4187e51101367615150!



!DSPAM:4aa521b332711988320330!


Re: [vchkpw] vdelivermail fault with 5.4.28

2009-08-27 Thread Steve Cole
On Tuesday 25 August 2009 04:23:48 pm Matt Brookings wrote:
 Steve Cole wrote:
  Moving to the new vpopmail (with the identical CFLAGS  configure options
  for 5.4.23 that I've been using for a long time), I get:

 What CFLAGS and configure options are you using?

./configure --enable-valias --enable-auth-module=mysql

hostname = zeus
uname -m = x86_64
uname -r = 2.6.30.5
uname -s = Linux
uname -v = #1 SMP Mon Aug 17 11:03:52 EDT 2009


CFLAGS=-Os -pipe -fomit-frame-pointer
GCC 4.3.4

!DSPAM:4a96aaa532714587391783!



Re: [vchkpw] vdelivermail fault with 5.4.28

2009-08-27 Thread Matt Brookings
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Steve Cole wrote:
 CFLAGS=-Os -pipe -fomit-frame-pointer

Remove these CFLAGS and try again.  Let me know how it goes.  I can't reproduce 
this issue unfortunately.
If you can, and would like to contact me off-list to give me access to the 
environment so I can debug it,
that would be highly appreciated.
- --
/*
Matt Brookings m...@inter7.com   GnuPG Key FAE0672C
Software developer Systems technician
Inter7 Internet Technologies, Inc. (815)776-9465
*/
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkqWrDQACgkQIwet2/rgZyymBgCfXIQbyj3Jh49dQB+Lwke9YYD3
umkAnisiRXSzolKSY2a6/GthlPOv+ed3
=qdMf
-END PGP SIGNATURE-


Re: [vchkpw] vdelivermail fault with 5.4.28

2009-08-25 Thread Matt Brookings
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Steve Cole wrote:
 Moving to the new vpopmail (with the identical CFLAGS  configure options for 
 5.4.23 that I've been using for a long time), I get:

What CFLAGS and configure options are you using?
- --
/*
Matt Brookings m...@inter7.com   GnuPG Key FAE0672C
Software developer Systems technician
Inter7 Internet Technologies, Inc. (815)776-9465
*/
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEUEARECAAYFAkqUSFQACgkQIwet2/rgZywpxACUDRGuCfg9dokkzuhM04z9GE1t
VgCfQvsPgDHHG9T5AnnsGfetJJ8qH1Q=
=tJle
-END PGP SIGNATURE-


Re: [vchkpw] vdelivermail stdout to Dovecot deliver

2009-04-03 Thread Rick Romero
On Thu, 2009-04-02 at 06:01 -0700, Tom Collins wrote:
 On Mar 30, 2009, at 7:32 PM, Rick Romero wrote:
  What I'm trying to work around with this method is to handle
  user-specific .qmail directives.  Dovecot doesn't do that, and that is
  why I can't full out replace vdelivermail with deliver.
 
 
 What if vpopmail was updated to store a user's .qmail file as  
 domain.com/.qmail-user instead of domain.com/user/.qmail?

It seems whatever solution I want to implement has a lot of work
involved.  
In this case it would involve migrating all the existing
domain.com/user/.qmail files to domain.com/.qmail-user, and the
applications which create/modify them.  It's not done through vpopmaild.

I think the simplest option is just calling deliver via vdelivermail's
existing run_command function (which IMHO does exactly what is needed -
it would be exactly the same as calling maildrop via
domain.com/user/.qmail), I just have been too busy to really test it.

Rick


!DSPAM:49d699c132681621912481!



Re: [vchkpw] vdelivermail stdout to Dovecot deliver

2009-04-02 Thread Tom Collins

On Mar 30, 2009, at 7:32 PM, Rick Romero wrote:

What I'm trying to work around with this method is to handle
user-specific .qmail directives.  Dovecot doesn't do that, and that is
why I can't full out replace vdelivermail with deliver.



What if vpopmail was updated to store a user's .qmail file as  
domain.com/.qmail-user instead of domain.com/user/.qmail?


Granted, with a lot of users you end up with a huge number of files  
in the domain directory, and that will have an impact on performance,  
but it might be a solution to your problem.  We'd have to make other  
changes to the codebase so the alias/forward routines ignored .qmail- 
user files that belonged to actual POP/IMAP accounts.


-Tom




!DSPAM:49d4b73032681666196558!



Re: [vchkpw] vdelivermail stdout to Dovecot deliver

2009-03-31 Thread Matt Brookings
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rick Romero wrote:
 vdelivermail already has a 'run_command' function for running .qmail
 commands, I'm going to try using that next to call deliver.  That should
 solve the chained pipe issue.

I'll admit that I'm not very familiar with the issues involved in getting
vdelivermail to deliver to Dovecot directly, but I would like to see more
support for Dovecot in vpopmail.

As soon as there's some preliminary idea of how to get this part working,
or some sample code, please let me know so I can look over it.
- --
/*
Matt Brookings m...@inter7.com   GnuPG Key D9414F70
Software developer Systems technician
Inter7 Internet Technologies, Inc. (815)776-9465
*/
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAknSJM4ACgkQ6QgvSNlBT3AMSQCfRgRJKWFkAZBWF5yVG8OIupF9
kqYAoITu0i1zvDJfstERjcU2HrviTZqm
=3ImN
-END PGP SIGNATURE-


Re: [vchkpw] vdelivermail stdout to Dovecot deliver

2009-03-30 Thread Rick Romero


Ok.  This won't work.  My test system had all the variables set in the  
shell, which is why it worked. :(  The reason it won't work is that  
qmail-local is the parent process of both vdelivermail AND deliver.   
If vdelivermail sets HOME, it does not apply to deliver's environment.  
 :(


On the up side, with vdelivermail sending the mail to STDOUT, if you do

|/usr/local/vpopmail/bin/vdelivermailstdout |  
/usr/local/libexec/dovecot/deliver -d $...@$host


It should deliver.. I'll try and test this tonite - on my test system  
I received an error 'email' in my INBOX when $EXT and $HOST didn't  
exist on my commandline.  The caveat being you need to run the dovecot  
Auth on each machine that does delivery.  :/


The other option would be for vdelivermail to call Dovecot's deliver  
after setting the environment.


Programming question - if I write to fd0 (STDOUT), and then exec() a  
process, will that child process see the data I put in fd0 from the  
parent?  Maybe I'll just try that as well.


Rick

Quoting Rick Romero r...@havokmon.com:


On Wed, 2009-03-11 at 14:19 -0500, Rick Romero wrote:

I think it'll work just dandy if vdelivermail set's the HOME variable
and writes the email to stdout.




I attached a patch, but I think testing this is going to be a pita
unless someone has some sort of shell 'vdelivermail' tester ?


:O Holy crap it worked.  Not only did it compile without error, but it
actually worked as expected.

The command:

cat  
/home/vpopmail/domains/havokmon.com/rick/Maildir/cur/1236799820.50282.mx.vfemail.net,S=3365:2,S | env -v EXT=rick HOST=havokmon.com HOME=/home/vpopmail/domains/havokmon.com/rick /usr/local/vpopmail/bin/vdelivermailstdout ''  
r...@havokmon.com


Causes the ./vdelivermail (which is compiled to send to STDOUT) to
display the email in the terminal

If I run:

cat  
/home/vpopmail/domains/havokmon.com/rick/Maildir/cur/1236799820.50282.mx.vfemail.net,S=3365:2,S | env -v EXT=rick HOST=havokmon.com HOME=/home/vpopmail/domains/havokmon.com/rick /usr/local/vpopmail/bin/vdelivermail ''  
r...@havokmon.com


The email will be delivered to my mailbox. So I've got a decent test
environment.

Now appending deliver to that first command line:

cat  
/home/vpopmail/domains/havokmon.com/rick/Maildir/cur/1236751658.43485.mx.vfemail.net,S=3436:2,S | env EXT=rick HOST=havokmon.com HOME=/home/vpopmail/domains/havokmon.com/rick /usr/local/vpopmail/bin/vdelivermailstdout '' r...@havokmon.com |  
/usr/local/libexec/dovecot/deliver


And it worked too!  Wow.  I'm blown away.  I need a glass of champagne.
Not that I didn't think it would work, but that it worked 'pefectly'
without throwing an error on the first try. :)  I think it took me
longer to figure out how to test it in a shell.

The only problem I see is the new message starts with a (null).
(null)Delivered-To: r...@havokmon.com

Now the null occurs whether I use deliver, the original vdelivermail, or
the new vdelivermailstdout, so I think its part of the cat.  I'll work
on it a little more tomorrow, so I can go to bed happy tonite :)

Rick









!DSPAM:49d1032d32681689686421!



RE: [vchkpw] vdelivermail stdout to Dovecot deliver

2009-03-30 Thread Tren Blackburn
I have a question about this. When I first implemented dSPAM I used the same 
method of nested pipes to handle delivery through .qmail-default. However the 
problem I ran into was if there was a problem in the first pipe that caused an 
error mail was lost due to the broken pipe. Is that something that could happen 
here? Is the pipe intelligent enough to see a failure and notify the previous 
process?

And with regards to the environment variables, if you export them in the parent 
process shouldn't they be part of the environments of the child processes? 
Another possibility is piping through maildrop. That's the solution I ended up 
moving to for dSPAM since it was able to handle errors properly through an 
exception and xfilter clause. Based on the error codes dspamc sent I could 
re-queue or do other things. And to ensure that chkuser still functioned 
properly for bounce-no-mailbox you just setup the .qmail-default like this:

| /usr/local/bin/maildrop /etc/maildroprc # bounce-no-mailbox

Because chkuser only checks for the existence of bounce-no-mailbox in 
.qmail-default. It doesn't care about vdelivermail so adding it as a comment 
works perfectly.

I'm not sure if this method would be worth doing in the case of dovecot, but it 
helped me get around some of the same issues with dSPAM, and ensure that mail 
was never lost.

Regards,

Tren

 -Original Message-
 From: Rick Romero [mailto:r...@havokmon.com]
 Sent: Monday, March 30, 2009 10:37 AM
 To: vchkpw@inter7.com
 Subject: Re: [vchkpw] vdelivermail stdout to Dovecot deliver
 
 
 Ok.  This won't work.  My test system had all the variables set in the
 shell, which is why it worked. :(  The reason it won't work is that
 qmail-local is the parent process of both vdelivermail AND deliver.
 If vdelivermail sets HOME, it does not apply to deliver's environment.
   :(
 
 On the up side, with vdelivermail sending the mail to STDOUT, if you do
 
 |/usr/local/vpopmail/bin/vdelivermailstdout |
 /usr/local/libexec/dovecot/deliver -d $...@$host
 
 It should deliver.. I'll try and test this tonite - on my test system
 I received an error 'email' in my INBOX when $EXT and $HOST didn't
 exist on my commandline.  The caveat being you need to run the dovecot
 Auth on each machine that does delivery.  :/
 
 The other option would be for vdelivermail to call Dovecot's deliver
 after setting the environment.
 
 Programming question - if I write to fd0 (STDOUT), and then exec() a
 process, will that child process see the data I put in fd0 from the
 parent?  Maybe I'll just try that as well.
 
 Rick
 
 Quoting Rick Romero r...@havokmon.com:
 
  On Wed, 2009-03-11 at 14:19 -0500, Rick Romero wrote:
  I think it'll work just dandy if vdelivermail set's the HOME
 variable
  and writes the email to stdout.
 
 
  I attached a patch, but I think testing this is going to be a pita
  unless someone has some sort of shell 'vdelivermail' tester ?
 
  :O Holy crap it worked.  Not only did it compile without error, but
 it
  actually worked as expected.
 
  The command:
 
  cat
 
 /home/vpopmail/domains/havokmon.com/rick/Maildir/cur/1236799820.50282.m
 x.vfemail.net,S=3365:2,S | env -v EXT=rick HOST=havokmon.com
 HOME=/home/vpopmail/domains/havokmon.com/rick
 /usr/local/vpopmail/bin/vdelivermailstdout ''
  r...@havokmon.com
 
  Causes the ./vdelivermail (which is compiled to send to STDOUT) to
  display the email in the terminal
 
  If I run:
 
  cat
 
 /home/vpopmail/domains/havokmon.com/rick/Maildir/cur/1236799820.50282.m
 x.vfemail.net,S=3365:2,S | env -v EXT=rick HOST=havokmon.com
 HOME=/home/vpopmail/domains/havokmon.com/rick
 /usr/local/vpopmail/bin/vdelivermail ''
  r...@havokmon.com
 
  The email will be delivered to my mailbox. So I've got a decent test
  environment.
 
  Now appending deliver to that first command line:
 
  cat
 
 /home/vpopmail/domains/havokmon.com/rick/Maildir/cur/1236751658.43485.m
 x.vfemail.net,S=3436:2,S | env EXT=rick HOST=havokmon.com
 HOME=/home/vpopmail/domains/havokmon.com/rick
 /usr/local/vpopmail/bin/vdelivermailstdout '' r...@havokmon.com |
  /usr/local/libexec/dovecot/deliver
 
  And it worked too!  Wow.  I'm blown away.  I need a glass of
 champagne.
  Not that I didn't think it would work, but that it worked 'pefectly'
  without throwing an error on the first try. :)  I think it took me
  longer to figure out how to test it in a shell.
 
  The only problem I see is the new message starts with a (null).
  (null)Delivered-To: r...@havokmon.com
 
  Now the null occurs whether I use deliver, the original vdelivermail,
 or
  the new vdelivermailstdout, so I think its part of the cat.  I'll
 work
  on it a little more tomorrow, so I can go to bed happy tonite :)
 
  Rick
 
 
 
 
 
 
 
 
 


!DSPAM:49d1159e32681919617724!



RE: [vchkpw] vdelivermail stdout to Dovecot deliver

2009-03-30 Thread Cleaver, Japheth
 -Original Message-
 From: Tren Blackburn [mailto:t...@eotnetworks.com]
 Sent: Monday, March 30, 2009 11:55 AM
 To: vchkpw@inter7.com
 Subject: RE: [vchkpw] vdelivermail stdout to Dovecot deliver
 
 I have a question about this. When I first implemented dSPAM I used
the
 same method of nested pipes to handle delivery through .qmail-default.
 However the problem I ran into was if there was a problem in the first
 pipe that caused an error mail was lost due to the broken pipe. Is
that
 something that could happen here? Is the pipe intelligent enough to
see a
 failure and notify the previous process?
 
 And with regards to the environment variables, if you export them in
the
 parent process shouldn't they be part of the environments of the child
 processes? Another possibility is piping through maildrop. That's the
 solution I ended up moving to for dSPAM since it was able to handle
errors
 properly through an exception and xfilter clause. Based on the error
codes
 dspamc sent I could re-queue or do other things. And to ensure that
 chkuser still functioned properly for bounce-no-mailbox you just
setup
 the .qmail-default like this:
 
 | /usr/local/bin/maildrop /etc/maildroprc # bounce-no-mailbox
 
 Because chkuser only checks for the existence of bounce-no-mailbox
 in .qmail-default. It doesn't care about vdelivermail so adding it as
a
 comment works perfectly.
 
 I'm not sure if this method would be worth doing in the case of
dovecot,
 but it helped me get around some of the same issues with dSPAM, and
ensure
 that mail was never lost.
 
 Regards,
 
 Tren

[Cleaver, J.C.] 
One option is patching vdelivermail to not see the final delivery
through. At a previous location I was at, we had it leave files in
Maildir/tmp and trigger an external script. If that exited successfully,
vdeliermail left it in Maildir/tmp and exited OK -- presumably leaving
that file there for later processing by some other script. If it didn't,
back out of the delivery with a tempfail.

Ideally, you would have that external script record an entry in a DB
queue somewhere. Later on (later meaning a few async seconds later),
the queue is polled and the final delivery process does whatever it
wants with that guaranteed-safe file, it being responsible for dropping
it in Maildir/new when it's complete.

If everything goes according to plan, you should be guaranteed not to
drop mail. The only drawback is that your final delivery script can't
generate a bounce back out through the mail stream automatically, it
would have to re-inject.

Regards,

Japheth Cleaver

!DSPAM:49d11a8032681616791409!



RE: [vchkpw] vdelivermail stdout to Dovecot deliver

2009-03-30 Thread Tren Blackburn
 -Original Message-
 From: Cleaver, Japheth [mailto:jclea...@soe.sony.com]
 Sent: Monday, March 30, 2009 12:16 PM
 To: vchkpw@inter7.com
 Subject: RE: [vchkpw] vdelivermail stdout to Dovecot deliver
 
  -Original Message-
  From: Tren Blackburn [mailto:t...@eotnetworks.com]
  Sent: Monday, March 30, 2009 11:55 AM
  To: vchkpw@inter7.com
  Subject: RE: [vchkpw] vdelivermail stdout to Dovecot deliver
 
  I have a question about this. When I first implemented dSPAM I used
 the
  same method of nested pipes to handle delivery through .qmail-
 default.
  However the problem I ran into was if there was a problem in the
 first
  pipe that caused an error mail was lost due to the broken pipe. Is
 that
  something that could happen here? Is the pipe intelligent enough to
 see a
  failure and notify the previous process?
 
  And with regards to the environment variables, if you export them in
 the
  parent process shouldn't they be part of the environments of the
 child
  processes? Another possibility is piping through maildrop. That's
the
  solution I ended up moving to for dSPAM since it was able to handle
 errors
  properly through an exception and xfilter clause. Based on the error
 codes
  dspamc sent I could re-queue or do other things. And to ensure that
  chkuser still functioned properly for bounce-no-mailbox you just
 setup
  the .qmail-default like this:
 
  | /usr/local/bin/maildrop /etc/maildroprc # bounce-no-mailbox
 
  Because chkuser only checks for the existence of bounce-no-mailbox
  in .qmail-default. It doesn't care about vdelivermail so adding it
as
 a
  comment works perfectly.
 
  I'm not sure if this method would be worth doing in the case of
 dovecot,
  but it helped me get around some of the same issues with dSPAM, and
 ensure
  that mail was never lost.
 
  Regards,
 
  Tren
 
 [Cleaver, J.C.]
 One option is patching vdelivermail to not see the final delivery
 through. At a previous location I was at, we had it leave files in
 Maildir/tmp and trigger an external script. If that exited
 successfully,
 vdeliermail left it in Maildir/tmp and exited OK -- presumably leaving
 that file there for later processing by some other script. If it
 didn't,
 back out of the delivery with a tempfail.


Hmmm...it seems to me like that wouldn't scale very well, and could
possibly get messy if you're dealing with a cluster of SMTP delivery
nodes. But it's another way for sure. Maildrop doesn't require any
hacking of vdelivermail as it's a drop-in replacement for it since
vdelivermail is called at the end of maildrop after all the filtering is
done inside. This guarantees no loss of mail, without needing extra
external processes. 

 
 Ideally, you would have that external script record an entry in a DB
 queue somewhere. Later on (later meaning a few async seconds later),
 the queue is polled and the final delivery process does whatever it
 wants with that guaranteed-safe file, it being responsible for
dropping
 it in Maildir/new when it's complete.
 
 If everything goes according to plan, you should be guaranteed not to
 drop mail. The only drawback is that your final delivery script can't
 generate a bounce back out through the mail stream automatically, it
 would have to re-inject.
 

How much additional overhead is caused due to re-injection over
re-queuing? It seems like this requires on quite a few additional pieces
that are outside of the qmail delivery path and if any of them break or
not work as expected, could delay final delivery infinitely due to
messages gathering in the tmp folder. I'm unsure how you would handle
remote delivery with this method as it seems to assume the final mailbox
is on the same server/cluster as the delivery process. 

Ideally we shouldn't need *any* of these hacks, maildrop or otherwise.
It'd be nice to plug in a different delivery method to qmail. However,
that's not really an option, so we build what we can to do what we need,
and we all have different needs usually. :)

Regards,

Tren





!DSPAM:49d1215832689616257855!



RE: [vchkpw] vdelivermail stdout to Dovecot deliver

2009-03-30 Thread Rick Romero

What I'm trying to work around with this method is to handle
user-specific .qmail directives.  Dovecot doesn't do that, and that is
why I can't full out replace vdelivermail with deliver.

As for pipes, I see where you're coming from, and it's probably best to
not chain pipes, but instead exec the deliver process from within
vdelivermail just as it would a user-specific .qmail directive.
I was having problems with that, but you've just given me another avenue
to try - vdelivermail will exec piped commands, so I may be able to
re-use that code.  Then your 'piped program failed' action should be no
different than when maildrop or procmail is called from .qmail.

The problem with the environments is that piping doesn't appear to be
creating a child process of the previous command
(within .qmail-default).  fd1 (I think that's STDOUT) is a persistent
file descriptor which each piped process can read, but qmail-local is
the actual parent process of everything that runs from .qmail-default -
vdelivermail is the parent of everything that runs from ~user/.qmail.  

I also discovered that I have an .inbox under my domain folder after
testing dovecot deliver because $home was set to my domain, which
qmail-local does. Unfortuantely it's tried and true :/

Rick

On Mon, 2009-03-30 at 11:55 -0700, Tren Blackburn wrote:
 I have a question about this. When I first implemented dSPAM I used the same 
 method of nested pipes to handle delivery through .qmail-default. However the 
 problem I ran into was if there was a problem in the first pipe that caused 
 an error mail was lost due to the broken pipe. Is that something that could 
 happen here? Is the pipe intelligent enough to see a failure and notify the 
 previous process?
 
 And with regards to the environment variables, if you export them in the 
 parent process shouldn't they be part of the environments of the child 
 processes? Another possibility is piping through maildrop. That's the 
 solution I ended up moving to for dSPAM since it was able to handle errors 
 properly through an exception and xfilter clause. Based on the error codes 
 dspamc sent I could re-queue or do other things. And to ensure that chkuser 
 still functioned properly for bounce-no-mailbox you just setup the 
 .qmail-default like this:
 
 | /usr/local/bin/maildrop /etc/maildroprc # bounce-no-mailbox
 
 Because chkuser only checks for the existence of bounce-no-mailbox in 
 .qmail-default. It doesn't care about vdelivermail so adding it as a comment 
 works perfectly.
 
 I'm not sure if this method would be worth doing in the case of dovecot, but 
 it helped me get around some of the same issues with dSPAM, and ensure that 
 mail was never lost.
 
 Regards,
 
 Tren
 
  -Original Message-
  From: Rick Romero [mailto:r...@havokmon.com]
  Sent: Monday, March 30, 2009 10:37 AM
  To: vchkpw@inter7.com
  Subject: Re: [vchkpw] vdelivermail stdout to Dovecot deliver
  
  
  Ok.  This won't work.  My test system had all the variables set in the
  shell, which is why it worked. :(  The reason it won't work is that
  qmail-local is the parent process of both vdelivermail AND deliver.
  If vdelivermail sets HOME, it does not apply to deliver's environment.
:(
  
  On the up side, with vdelivermail sending the mail to STDOUT, if you do
  
  |/usr/local/vpopmail/bin/vdelivermailstdout |
  /usr/local/libexec/dovecot/deliver -d $...@$host
  
  It should deliver.. I'll try and test this tonite - on my test system
  I received an error 'email' in my INBOX when $EXT and $HOST didn't
  exist on my commandline.  The caveat being you need to run the dovecot
  Auth on each machine that does delivery.  :/
  
  The other option would be for vdelivermail to call Dovecot's deliver
  after setting the environment.
  
  Programming question - if I write to fd0 (STDOUT), and then exec() a
  process, will that child process see the data I put in fd0 from the
  parent?  Maybe I'll just try that as well.
  
  Rick
  
  Quoting Rick Romero r...@havokmon.com:
  
   On Wed, 2009-03-11 at 14:19 -0500, Rick Romero wrote:
   I think it'll work just dandy if vdelivermail set's the HOME
  variable
   and writes the email to stdout.
  
  
   I attached a patch, but I think testing this is going to be a pita
   unless someone has some sort of shell 'vdelivermail' tester ?
  
   :O Holy crap it worked.  Not only did it compile without error, but
  it
   actually worked as expected.
  
   The command:
  
   cat
  
  /home/vpopmail/domains/havokmon.com/rick/Maildir/cur/1236799820.50282.m
  x.vfemail.net,S=3365:2,S | env -v EXT=rick HOST=havokmon.com
  HOME=/home/vpopmail/domains/havokmon.com/rick
  /usr/local/vpopmail/bin/vdelivermailstdout ''
   r...@havokmon.com
  
   Causes the ./vdelivermail (which is compiled to send to STDOUT) to
   display the email in the terminal
  
   If I run:
  
   cat
  
  /home/vpopmail/domains/havokmon.com/rick/Maildir/cur/1236799820.50282.m
  x.vfemail.net,S=3365:2,S | env -v EXT=rick HOST

Re: [vchkpw] vdelivermail stdout to Dovecot deliver

2009-03-30 Thread Manvendra Bhangui
On Mon, Mar 30, 2009 at 11:06 PM, Rick Romero r...@havokmon.com wrote:

 Programming question - if I write to fd0 (STDOUT), and then exec() a
 process, will that child process see the data I put in fd0 from the parent?
  Maybe I'll just try that as well.


make fd0 a file (using makeseekable) and do lseek (0, 0L, SEEK_SET);

Attached is a function which can make stdin seekable.


!DSPAM:49d192c032681954743819!


makeseekable.c
Description: Binary data


RE: [vchkpw] vdelivermail stdout to Dovecot deliver

2009-03-30 Thread Tren Blackburn
But regardless of whether the parent is qmail-local or vdelivermail, 
vdelivermail still provides the same environment variables. I did a test by 
writing a quick one line shell script that wrote the environment variables to a 
file and ran it from /home/vpopmail/domains/test.com/test/.qmail via a pipe. It 
sets all the environment variables that you need:

DEFAULT=test
DTLINE='Delivered-To: test.com-t...@test.com '
EXT=test
EXT2=
EXT3=
EXT4=
HOME=/home/vpopmail/domains/test.com
HOST=test.com
HOST2=test
HOST3=test
HOST4=test
LOCAL=test.com-test 
newsender=r...@mx3.eotnetworks.com 
PWD=/home/vpopmail/domains/test.com/test
recipient=test.com-t...@test.com
RPLINE='Return-Path: r...@mx3.eotnetworks.com '
sender=r...@mx3.eotnetworks.com 
UFLINE='From r...@mx3.eotnetworks.com Tue Mar 31 05:17:31 2009 '
USER=test.com _=/home/vpopmail/etc/test.sh

You should have all the environment variables you need/want there. And if you 
need something extra, just have vdelivermail set the environment variable and 
the pipe in user/.qmail will pick it up, or if using maildrop, use the import 
command to bring the variables you need in and go crazy. I'd still using 
something like maildrop that lets you properly handle the pipe as it only 
requires one pipe; nested pipes cause mail loss when they break due to not 
being able to properly pass exit codes through the extra pipe (or so it was 
explained to me when I was fighting with that issue). Maildrop can be setup to 
handle any circumstance you have to deal with and just defer delivery until the 
problem is resolved without causing mail loss.

Hope that helps,

Tren

 -Original Message-
 From: Rick Romero [mailto:r...@havokmon.com]
 Sent: Monday, March 30, 2009 7:32 PM
 To: vchkpw@inter7.com
 Subject: RE: [vchkpw] vdelivermail stdout to Dovecot deliver
 
 
 What I'm trying to work around with this method is to handle
 user-specific .qmail directives.  Dovecot doesn't do that, and that is
 why I can't full out replace vdelivermail with deliver.
 
 As for pipes, I see where you're coming from, and it's probably best to
 not chain pipes, but instead exec the deliver process from within
 vdelivermail just as it would a user-specific .qmail directive.
 I was having problems with that, but you've just given me another
 avenue
 to try - vdelivermail will exec piped commands, so I may be able to
 re-use that code.  Then your 'piped program failed' action should be no
 different than when maildrop or procmail is called from .qmail.
 
 The problem with the environments is that piping doesn't appear to be
 creating a child process of the previous command
 (within .qmail-default).  fd1 (I think that's STDOUT) is a persistent
 file descriptor which each piped process can read, but qmail-local is
 the actual parent process of everything that runs from .qmail-default -
 vdelivermail is the parent of everything that runs from ~user/.qmail.
 
 I also discovered that I have an .inbox under my domain folder after
 testing dovecot deliver because $home was set to my domain, which
 qmail-local does. Unfortuantely it's tried and true :/
 
 Rick
 
 On Mon, 2009-03-30 at 11:55 -0700, Tren Blackburn wrote:
  I have a question about this. When I first implemented dSPAM I used
 the same method of nested pipes to handle delivery through .qmail-
 default. However the problem I ran into was if there was a problem in
 the first pipe that caused an error mail was lost due to the broken
 pipe. Is that something that could happen here? Is the pipe intelligent
 enough to see a failure and notify the previous process?
 
  And with regards to the environment variables, if you export them in
 the parent process shouldn't they be part of the environments of the
 child processes? Another possibility is piping through maildrop. That's
 the solution I ended up moving to for dSPAM since it was able to handle
 errors properly through an exception and xfilter clause. Based on the
 error codes dspamc sent I could re-queue or do other things. And to
 ensure that chkuser still functioned properly for bounce-no-mailbox
 you just setup the .qmail-default like this:
 
  | /usr/local/bin/maildrop /etc/maildroprc # bounce-no-mailbox
 
  Because chkuser only checks for the existence of bounce-no-mailbox
 in .qmail-default. It doesn't care about vdelivermail so adding it as a
 comment works perfectly.
 
  I'm not sure if this method would be worth doing in the case of
 dovecot, but it helped me get around some of the same issues with
 dSPAM, and ensure that mail was never lost.
 
  Regards,
 
  Tren
 
   -Original Message-
   From: Rick Romero [mailto:r...@havokmon.com]
   Sent: Monday, March 30, 2009 10:37 AM
   To: vchkpw@inter7.com
   Subject: Re: [vchkpw] vdelivermail stdout to Dovecot deliver
  
  
   Ok.  This won't work.  My test system had all the variables set in
 the
   shell, which is why it worked. :(  The reason it won't work is that
   qmail-local is the parent process of both vdelivermail

Re: [vchkpw] vdelivermail delete for the win

2008-01-04 Thread Allan Dukat


Hi

I am about to install John M. Simpsons suite of patches around 
validrcptto.cdb, see:


http://qmail.jms1.net/patches/validrcptto.cdb.shtml

The onchange patch, see:

http://qmail.jms1.net/vpopmail/

In order to only recieve mail, on my system, for which I have a valid 
recipient.


Allan Dukat   E|:-{)=

On Fri, 4 Jan 2008, Matthew Goodman wrote:

After my recent issues with maildrop and delivering mail, I got to know 
my system a little better. Having scanned through the qmail-queue I 
noticed a lot of messages just sitting around for days on end trying to 
deliver to non-existent email boxes, in response to spammers. Some of my 
bigger customers had all email set to 'bounce' and not 'delete'.


Several hundred e-mail accounts getting several thousand spams a day 
ended up creating  a constant flow of between 10,000 and 20,000 mail 
messages bouncing in the qmail-queue on a daily basis.


I was getting pretty worried about the hard disks that contain my mail 
queue and the /var/vpopmail/domains tree. They were dishing out between 
250 - 400 (I've seen it as high as 800) transactions per second on 
average. After setting vdelivermail delete on some of my bigger domains, 
my queue has dropped to under 1000 messages, and iostat shows a 
SIGNIFICANT decrease in disk activity during both peak and off-peak 
times.


I wish someone had told me about that earlier. What a great tool for
reducing unnecessary load.





!DSPAM:477e2355310542473718141!



Re: [vchkpw] vdelivermail delete for the win

2008-01-04 Thread Matt Brookings
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Matthew Goodman wrote:
 I wish someone had told me about that earlier. What a great tool for
 reducing unnecessary load.

An ever better tool is the chkuser patch and vdelivermail set to bounce so
the message never even reaches qmail-queue.
- --
/*
Matt Brookings [EMAIL PROTECTED]   GnuPG Key ABA26FE7
Software developer Systems technician
Inter7 Internet Technologies, Inc. (815)776-9465
*/
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with CentOS - http://enigmail.mozdev.org

iD8DBQFHflE4Yaj0Mauib+cRArpOAKCg61nk0EwTLdZdOQev+uQJ+G7dLQCeK0/o
urTGbkw0uXyh5PJ3A7ljbKo=
=9imd
-END PGP SIGNATURE-


RE: [vchkpw] vdelivermail delete for the win

2008-01-04 Thread Matthew Goodman
Hmm I may have to check that out :)

Working with Gentoo ebuilds and what-not, so I don't get all the cl
packages.

I know you all have a p0f-qmail install too. Almost had you guys do it... I
put it aside for the holidays though.



-Original Message-
From: Matt Brookings [mailto:[EMAIL PROTECTED] 
Sent: Friday, January 04, 2008 5:31 AM
To: vchkpw@inter7.com
Subject: Re: [vchkpw] vdelivermail delete for the win

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Matthew Goodman wrote:
 I wish someone had told me about that earlier. What a great tool for
 reducing unnecessary load.

An ever better tool is the chkuser patch and vdelivermail set to bounce so
the message never even reaches qmail-queue.
- --
/*
Matt Brookings [EMAIL PROTECTED]   GnuPG Key ABA26FE7
Software developer Systems technician
Inter7 Internet Technologies, Inc. (815)776-9465
*/
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with CentOS - http://enigmail.mozdev.org

iD8DBQFHflE4Yaj0Mauib+cRArpOAKCg61nk0EwTLdZdOQev+uQJ+G7dLQCeK0/o
urTGbkw0uXyh5PJ3A7ljbKo=
=9imd
-END PGP SIGNATURE-


!DSPAM:477e726f310541851520309!



Re: [vchkpw] vdelivermail patch in order to handle maildrop filtering capabilities

2006-10-27 Thread Jérôme MOLLIER-PIERRET


Rick

Inserting maildrop into .qmail-default is a fine implementation solution 
 but this patch provide thoses advantages :


- Maildrop handle correctly the maildir quota (and in you mailfilter 
sample you should handle the exit codde 77).  But for example, this 
configuration will nevers bounce the quota-warn and over-quota message ...


- Imagine you use and admin tool like qmailadmin, you'll have to patch 
it to modify permanently the behavior of .qmail-default of the domain.


This patch let you use you mailfterfile in very simple way handling all 
specific case maildrop do, and the implementation is in our mind 
cleanest ... for many raison.


Hoping this feature help.

Regards,

Jerome MOLLIER-PIERRET

Rick Romero a écrit :

On Thu, 2006-10-26 at 12:39 -0400, John Simpson wrote:

On 2006-10-26, at 0359, Jérôme MOLLIER-PIERRET wrote:

John Simpson a écrit :
also, what if a user (i.e. the owner of one specific mailbox)  
wants to create their own .mailfilter file, either directly or  
using some kind of web interface which gives them a set of options  
and writes a .mailfilter file based on their choices? i would  
search for /home/vpopmail/domains/.mailfilter-userid before the  
file names you're already checking for.
This case is not implemented in the patch, and therefore because it  
is not simple to handle .qmail-* style for maildrop. But it  
should be very easy to do this in maildrop style in the main or  
referal .mailfilter file.


For the web interface, i agree ... it would be very nice. But there  
is lot of job to do before :)))
that's what i was thinking- at some point in the future, somebody  
(maybe myself, if i ever get some free time) (yeah, right) will want  
to write a web interface which gives individual mailbox owners the  
ability to either edit their own .mailfilter file, or choose from a  
list of options which will cause the web back-end to create or modify  
a per-mailbox .mailfilter file, maybe using some kind of templates to  
support each available option.


Horde has a module that allows for mailfiler file modification, but I
haven't looked into it.  It uses FTP to put it in the user's mailbox.
Also, There's an FTP Server called Pure-FTPd that can auth against
MySQL, and use that home folder as the user's FTP folder (this I've used
to give my mail users an FTP option) - so something is out there to
implement.  I just don't trust my users with, IMHO essentially, shell
access.

i just don't like seeing patches which lock out future possibilities.  
flexibility is a good thing.


other than that, your patch looks like a good idea.


I don't know what everyone else is doing, but my .qmail-default looks
like this:
|maildrop  /home/vpopmail/domains/havokmon.com/mailfilter
| /usr/home/vpopmail/bin/vdelivermail
'' /usr/home/vpopmail/domains/havokmon.com/rick

And my mailfiler is essentially:
SHELL=/bin/sh
VHOME=`/usr/local/vpopmail/bin/vuserinfo -d [EMAIL PROTECTED]

if (/^X-Spam-Status: Yes*/)
{

 # Delete messages with a score of 10 or higher, filter all other
# spam messages into a spam folder
/^X-Spam-Status: yes, (hits|score)=![:digit:]+\.[:digit:]+!.*/
if ( $MATCH2 = 10.0 )
{
exception {
 EXITCODE = 99
 to  /dev/null
 exit
}
}
else
{

# then try delivering it to a Spam folder
exception {
  EXITCODE = 99
  to $VHOME/Maildir/.Spam/
  exit
}
}
}
exit


I forget exactly what option does it - it's either the EXITCODE with
exit, and or the exception{} blocks, but my .qmail-default is processeed
entirely.  


It took a bit of searching to get that to work - it was a few years
ago...

Rick




Re: [vchkpw] vdelivermail patch in order to handle maildrop filtering capabilities

2006-10-27 Thread Rick Romero
On Fri, 2006-10-27 at 09:42 +0200, Jérôme MOLLIER-PIERRET wrote:
 Rick
 
 Inserting maildrop into .qmail-default is a fine implementation solution 
   but this patch provide thoses advantages :
 
 - Maildrop handle correctly the maildir quota (and in you mailfilter 
 sample you should handle the exit codde 77).  But for example, this 
 configuration will nevers bounce the quota-warn and over-quota message ...
 
 - Imagine you use and admin tool like qmailadmin, you'll have to patch 
 it to modify permanently the behavior of .qmail-default of the domain.

Ahhh That's what I was missing - I wasn't sure what wasn't covered by
what I was doing.  Thanks. :)

Rick




Re: [vchkpw] vdelivermail patch in order to handle maildrop filtering capabilities

2006-10-26 Thread Jérôme MOLLIER-PIERRET




John Simpson a écrit :

what if there happens to be a mailbox with the name mailfilter? (yes, 
it's a rather contrived example, but you see some really weird stuff 
when you run an ISP... as an example, we had one user who ran one of the 
local post offices and wanted postmaster as his userid, the tech 
support guy who took the signup told him he could have it, and i was the 
one who got to call him back and explain why he couldn't have it... i 
ended up telling him it was already used, and that was that. of course 
for the next three weeks i got a series of who are you? emails to the 
postmaster mailbox from this guy...)


instead of using mailfilter, you should probably use .mailfilter as 
the filename. names starting with a letter or number should really be 
reserved for mailbox names.


Yes your remark is good, just have to sed mailfilter by .mailfilter ... 
in the patch file.




also, what if a user (i.e. the owner of one specific mailbox) wants to 
create their own .mailfilter file, either directly or using some kind of 
web interface which gives them a set of options and writes a .mailfilter 
file based on their choices? i would search for 
/home/vpopmail/domains/.mailfilter-userid before the file names you're 
already checking for.


This case is not implemented in the patch, and therefore because it is 
not simple to handle .qmail-* style for maildrop.
But it should be very easy to do this in maildrop style in the main or 
referal .mailfilter file.


For the web interface, i agree ... it would be very nice. But there is 
lot of job to do before :)))



Jérôme MOLLIER-PIERRET


Re: [vchkpw] vdelivermail patch in order to handle maildrop filtering capabilities

2006-10-26 Thread Jérôme MOLLIER-PIERRET




On Oct 25, 2006, at 8:52 AM, Jérôme MOLLIER-PIERRET wrote:

You'll find our patch below, if it can help someone ...


I'll put it in my personal patch queue for inclusion in a future release 
of vpopmail, but since I don't use maildrop, I may not include it unless 
others tell me it's worth adding.


Let us know, but if you add this to future realease it would be nice to 
include IFDEF header to activate or not this feature in the configure...




Please upload it to SourceForge http://vpopmail.sf.net/ so there's a 
permanent record of it out there, and someone searching for that 
functionality can use your patch until it's added to the release 
versions of vpopmail.


I'll post it today.

Regards,

Jérôme.


Re: [vchkpw] vdelivermail patch in order to handle maildrop filtering capabilities

2006-10-26 Thread John Simpson

On 2006-10-26, at 0359, Jérôme MOLLIER-PIERRET wrote:

John Simpson a écrit :


also, what if a user (i.e. the owner of one specific mailbox)  
wants to create their own .mailfilter file, either directly or  
using some kind of web interface which gives them a set of options  
and writes a .mailfilter file based on their choices? i would  
search for /home/vpopmail/domains/.mailfilter-userid before the  
file names you're already checking for.


This case is not implemented in the patch, and therefore because it  
is not simple to handle .qmail-* style for maildrop. But it  
should be very easy to do this in maildrop style in the main or  
referal .mailfilter file.


For the web interface, i agree ... it would be very nice. But there  
is lot of job to do before :)))


that's what i was thinking- at some point in the future, somebody  
(maybe myself, if i ever get some free time) (yeah, right) will want  
to write a web interface which gives individual mailbox owners the  
ability to either edit their own .mailfilter file, or choose from a  
list of options which will cause the web back-end to create or modify  
a per-mailbox .mailfilter file, maybe using some kind of templates to  
support each available option.


i just don't like seeing patches which lock out future possibilities.  
flexibility is a good thing.


other than that, your patch looks like a good idea.

--
| John M. Simpson - KG4ZOW - Programmer At Large |
| http://www.jms1.net/   [EMAIL PROTECTED] |
--
| Mac OS X proves that it's easier to make UNIX  |
| pretty than it is to make Windows secure.  |
--




PGP.sig
Description: This is a digitally signed message part


Re: [vchkpw] vdelivermail patch in order to handle maildrop filtering capabilities

2006-10-26 Thread John Simpson

On 2006-10-26, at 1251, Rick Romero wrote:


I don't know what everyone else is doing, but my .qmail-default looks
like this:
|maildrop  /home/vpopmail/domains/havokmon.com/mailfilter
| /usr/home/vpopmail/bin/vdelivermail
'' /usr/home/vpopmail/domains/havokmon.com/rick

And my mailfiler is essentially:
...
 # Delete messages with a score of 10 or higher, filter all other
# spam messages into a spam folder
/^X-Spam-Status: yes, (hits|score)=![:digit:]+\.[:digit:]+!.*/
if ( $MATCH2 = 10.0 )
{
exception {
 EXITCODE = 99
 to  /dev/null


it's been my experience that this line is not necessary, just setting  
EXITCODE=99 and then exit is enough to cause the message to NOT be  
delivered anywhere.



I forget exactly what option does it - it's either the EXITCODE with
exit, and or the exception{} blocks, but my .qmail-default is  
processeed

entirely.


setting EXITCODE to 99 tells qmail-local (which is what actually  
reads the .qmail file) that the delivery is done, it was  
successful, and it should stop processing the .qmail file (i.e. don't  
go on to the next line.) the exit codes are documented in man qmail- 
command.


--
| John M. Simpson - KG4ZOW - Programmer At Large |
| http://www.jms1.net/   [EMAIL PROTECTED] |
--
| Mac OS X proves that it's easier to make UNIX  |
| pretty than it is to make Windows secure.  |
--




PGP.sig
Description: This is a digitally signed message part


Re: [vchkpw] vdelivermail patch in order to handle maildrop filtering capabilities

2006-10-26 Thread Christopher Chan


that's what i was thinking- at some point in the future, somebody (maybe 
myself, if i ever get some free time) (yeah, right) will want to write a 
web interface which gives individual mailbox owners the ability to 
either edit their own .mailfilter file, or choose from a list of options 
which will cause the web back-end to create or modify a per-mailbox 
.mailfilter file, maybe using some kind of templates to support each 
available option.


sqwebmail provides some ability to generate .mailfilter files although 
the interface isn't the greatest.


There is also a module for squirrelmail too that generates .mailfilter 
files. However I had to make some changes before it would work properly.


Re: [vchkpw] vdelivermail patch in order to handle maildrop filtering capabilities

2006-10-25 Thread Tom Collins

On Oct 25, 2006, at 8:52 AM, Jérôme MOLLIER-PIERRET wrote:

You'll find our patch below, if it can help someone ...


I'll put it in my personal patch queue for inclusion in a future  
release of vpopmail, but since I don't use maildrop, I may not  
include it unless others tell me it's worth adding.


Please upload it to SourceForge http://vpopmail.sf.net/ so there's  
a permanent record of it out there, and someone searching for that  
functionality can use your patch until it's added to the release  
versions of vpopmail.


--
Tom Collins  -  [EMAIL PROTECTED]
Vpopmail - virtual domains for qmail: http://vpopmail.sf.net/
QmailAdmin - web interface for Vpopmail: http://qmailadmin.sf.net/




Re: [vchkpw] vdelivermail patch in order to handle maildrop filtering capabilities

2006-10-25 Thread John Simpson

On 2006-10-25, at 1152, Jérôme MOLLIER-PIERRET wrote:


It also has the granularity of a using a mailfilter configuration  
file for domains (ie /home/vpopmail/domains/onedomain/mailfilter),  
all domains (ie /home/vpopmail/domains/mailfilter) … and indeed a  
default one in /etc/mailfilter.


what if there happens to be a mailbox with the name mailfilter?  
(yes, it's a rather contrived example, but you see some really weird  
stuff when you run an ISP... as an example, we had one user who ran  
one of the local post offices and wanted postmaster as his userid,  
the tech support guy who took the signup told him he could have it,  
and i was the one who got to call him back and explain why he  
couldn't have it... i ended up telling him it was already used, and  
that was that. of course for the next three weeks i got a series of  
who are you? emails to the postmaster mailbox from this guy...)


instead of using mailfilter, you should probably use .mailfilter  
as the filename. names starting with a letter or number should really  
be reserved for mailbox names.


also, what if a user (i.e. the owner of one specific mailbox) wants  
to create their own .mailfilter file, either directly or using some  
kind of web interface which gives them a set of options and writes  
a .mailfilter file based on their choices? i would search for /home/ 
vpopmail/domains/.mailfilter-userid before the file names you're  
already checking for.


--
| John M. Simpson - KG4ZOW - Programmer At Large |
| http://www.jms1.net/   [EMAIL PROTECTED] |
--
| Mac OS X proves that it's easier to make UNIX  |
| pretty than it is to make Windows secure.  |
--




PGP.sig
Description: This is a digitally signed message part


Re: [vchkpw] vdelivermail qmail-queue ALPHA patch - take 3

2006-05-10 Thread Joshua Megerman
 On May 9, 2006, at 12:57 PM, Jeremy Kitchen wrote:
 the problem is that vpopmail is using qmail-inject to forward
 messages.
 qmail-inject does not tolerate malformed messages.

 it's that simple.

 Any volunteers to review the code in vdelivermail.c and modify it to
 use qmail-queue instead of qmail-inject?

 OK, here's a quick stab at a basic patch - I modified qmail_inject_open
 to
 open qmail-queue appropriately (no args), and changed deliver_mail to
 talk
 to it.  I THINK :)

 There's no bounds checking and so forth in here, there are a few places
 where there really needs to be some extra code to make sure that the
 data
 acquired is valid, but it's designed to be proof-of-concept.  It
 compiles,
 but that's all I can guarantee.

 Use at your own risk, yada yada...  Feel free to modify it as needed, I
 have no ego attached to this code :)

 OK, so I can't stand writing sloppy code :)  Here's an updated version of
 the patch that handles things a little better (albeit in a slightly more
 complicated manner), and cleans up a couple remaining stragglers of the
 changeover.

And here's another update.  I realized as I was driving home last night
that I'd made a mistake (that's what I get for coding while tired :)) and
was printing double NULLs in the envelope.  This fixes it (and simplifies
the code a little too).

Josh
-- 
Joshua Megerman
SJGames MIB #5273 - OGRE AI Testing Division
You can't win; You can't break even; You can't even quit the game.
  - Layman's translation of the Laws of Thermodynamics
--- vdelivermail.c.orig	2006-05-09 17:35:00.0 -0400
+++ vdelivermail.c	2006-05-10 09:09:19.0 -0400
@@ -72,6 +72,7 @@
 
 #define BUFF_SIZE 300
 int fdm;
+int fde;
 
 #define EXIT_BOUNCE 100
 #define EXIT_DEFER 111
@@ -304,33 +305,41 @@
 }
 #endif
 
-/* Forks off qmail-inject.  Returns PID of child, or 0 for failure. */
-pid_t qmail_inject_open(char *address)
+/* Forks off qmail-queue.  Returns PID of child, or 0 for failure. */
+pid_t qmail_queue_open()
 {
  int pim[2];
+ int pie[2];
+
  pid_t pid;
- static char *binqqargs[4];
+ static char *binqqargs[2];
 
 if ( pipe(pim) == -1) return 0;
+if ( pipe(pie) == -1) return 0;
 
 switch(pid=vfork()){
   case -1:
 close(pim[0]);
 close(pim[1]);
+close(pie[0]);
+close(pie[1]);
 printf (Unable to fork: %d., errno);
 return 0;
   case 0:
 close(pim[1]);
+close(pie[1]);
 if (vfd_move(0,pim[0]) == -1 ) _exit(-1);
+if (vfd_move(1,pie[0]) == -1 ) _exit(-1);
 binqqargs[0] = QMAILINJECT;
-binqqargs[1] = --;
-binqqargs[2] = (*address == '' ? address[1] : address[0]);
+binqqargs[1] = 0;
 execv(*binqqargs, binqqargs);
-printf (Unable to launch qmail-inject.);
+printf (Unable to launch qmail-queue.);
 exit (EXIT_DEFER);/* child's exit caught later */
 }
 fdm = pim[1];
+fde = pie[1];
 close(pim[0]);
+close(pie[0]);
 return(pid);
 }
 
@@ -628,10 +637,18 @@
   char *dtline;
   char *atpos;
   int dtlen;
+  char *sender = 0;
+  char keychar[2] = { 'F', 'T' };
+  char *envptrs[4] = { keychar, sender, keychar+1, address };
+  int envlens[4] = { 1, 0, 1, 0 }; // sender and address get initialized later
+  int writestr;
 
   if (*address=='') ++address;  /* will this case ever happen? */
-  inject_pid = qmail_inject_open(address);
-  if (inject_pid == 0) vexiterr (EXIT_DEFER, system error, can't open qmail-inject);
+  envptrs[3] = address;
+  envlens[3] = strlen(address) + 1;
+
+  inject_pid = qmail_queue_open();
+  if (inject_pid == 0) vexiterr (EXIT_DEFER, system error, can't open qmail-queue);
   
   /* use the DTLINE variable, but skip past the dash in 
* [EMAIL PROTECTED] 
@@ -665,13 +682,33 @@
   }
   
   if (fdcopy (fdm, 0, DeliveredTo, strlen(DeliveredTo)) != 0) {
-  printf (write to qmail-inject failed: %d\n, errno);
+  printf (write to qmail-queue failed: %d\n, errno);
   close(fdm);
+  close(fde);
   waitpid(inject_pid,child,0);
   vexiterr (EXIT_DEFER, system error);
   }
 
+  if (!(sender = getenv(SENDER))) {
+  printf (unable to acquire SENDER from environment\n);
+  close(fdm);
+  close(fde);
+  vexiterr (EXIT_DEFER, system error);
+  }
+  envptrs[1] = sender;
+  envlens[1] = strlen(sender) + 1;
+
+  for (writestr = 0; writestr  4; writestr++) {
+if ((write(fde, (void *)envptrs[writestr], envlens[writestr])) != envlens[writestr]) {
+printf (write to qmail-queue failed: %d\n, errno);
+close(fdm);
+close(fde);
+vexiterr (EXIT_DEFER, system error);
+}
+  }
+
   close(fdm);
+  close(fde);
   waitpid(inject_pid,child,0);
   if (wait_exitcode(child) == 0) return;
   vexiterr (EXIT_DEFER, 

Re: [vchkpw] vdelivermail qmail-queue ALPHA patch

2006-05-09 Thread Joshua Megerman
 On May 9, 2006, at 12:57 PM, Jeremy Kitchen wrote:
 the problem is that vpopmail is using qmail-inject to forward messages.
 qmail-inject does not tolerate malformed messages.

 it's that simple.

 Any volunteers to review the code in vdelivermail.c and modify it to
 use qmail-queue instead of qmail-inject?

 OK, here's a quick stab at a basic patch - I modified qmail_inject_open to
 open qmail-queue appropriately (no args), and changed deliver_mail to talk
 to it.  I THINK :)

 There's no bounds checking and so forth in here, there are a few places
 where there really needs to be some extra code to make sure that the data
 acquired is valid, but it's designed to be proof-of-concept.  It compiles,
 but that's all I can guarantee.

 Use at your own risk, yada yada...  Feel free to modify it as needed, I
 have no ego attached to this code :)

OK, so I can't stand writing sloppy code :)  Here's an updated version of
the patch that handles things a little better (albeit in a slightly more
complicated manner), and cleans up a couple remaining stragglers of the
changeover.

Josh
-- 
Joshua Megerman
SJGames MIB #5273 - OGRE AI Testing Division
You can't win; You can't break even; You can't even quit the game.
  - Layman's translation of the Laws of Thermodynamics
[EMAIL PROTECTED]--- vdelivermail.c.orig	2006-05-09 17:35:00.0 -0400
+++ vdelivermail.c	2006-05-09 18:33:26.0 -0400
@@ -72,6 +72,7 @@
 
 #define BUFF_SIZE 300
 int fdm;
+int fde;
 
 #define EXIT_BOUNCE 100
 #define EXIT_DEFER 111
@@ -304,33 +305,41 @@
 }
 #endif
 
-/* Forks off qmail-inject.  Returns PID of child, or 0 for failure. */
-pid_t qmail_inject_open(char *address)
+/* Forks off qmail-queue.  Returns PID of child, or 0 for failure. */
+pid_t qmail_queue_open()
 {
  int pim[2];
+ int pie[2];
+
  pid_t pid;
- static char *binqqargs[4];
+ static char *binqqargs[2];
 
 if ( pipe(pim) == -1) return 0;
+if ( pipe(pie) == -1) return 0;
 
 switch(pid=vfork()){
   case -1:
 close(pim[0]);
 close(pim[1]);
+close(pie[0]);
+close(pie[1]);
 printf (Unable to fork: %d., errno);
 return 0;
   case 0:
 close(pim[1]);
+close(pie[1]);
 if (vfd_move(0,pim[0]) == -1 ) _exit(-1);
+if (vfd_move(1,pie[0]) == -1 ) _exit(-1);
 binqqargs[0] = QMAILINJECT;
-binqqargs[1] = --;
-binqqargs[2] = (*address == '' ? address[1] : address[0]);
+binqqargs[1] = 0;
 execv(*binqqargs, binqqargs);
-printf (Unable to launch qmail-inject.);
+printf (Unable to launch qmail-queue.);
 exit (EXIT_DEFER);/* child's exit caught later */
 }
 fdm = pim[1];
+fde = pie[1];
 close(pim[0]);
+close(pie[0]);
 return(pid);
 }
 
@@ -628,10 +637,18 @@
   char *dtline;
   char *atpos;
   int dtlen;
+  char *sender = 0;
+  char keychar[3] = FT;
+  char *envptrs[6] = { keychar, sender, keychar+2, keychar+1, address, keychar+2 };
+  int envlens[6] = { 1, 0, 1, 1, 0, 1 }; // sender and address get initialized later
+  int writestr;
 
   if (*address=='') ++address;  /* will this case ever happen? */
-  inject_pid = qmail_inject_open(address);
-  if (inject_pid == 0) vexiterr (EXIT_DEFER, system error, can't open qmail-inject);
+  envptrs[4] = address;
+  envlens[4] = strlen(address) + 1;
+
+  inject_pid = qmail_queue_open();
+  if (inject_pid == 0) vexiterr (EXIT_DEFER, system error, can't open qmail-queue);
   
   /* use the DTLINE variable, but skip past the dash in 
* [EMAIL PROTECTED] 
@@ -665,13 +682,33 @@
   }
   
   if (fdcopy (fdm, 0, DeliveredTo, strlen(DeliveredTo)) != 0) {
-  printf (write to qmail-inject failed: %d\n, errno);
+  printf (write to qmail-queue failed: %d\n, errno);
   close(fdm);
+  close(fde);
   waitpid(inject_pid,child,0);
   vexiterr (EXIT_DEFER, system error);
   }
 
+  if (!(sender = getenv(SENDER))) {
+  printf (unable to acquire SENDER from environment\n);
+  close(fdm);
+  close(fde);
+  vexiterr (EXIT_DEFER, system error);
+  }
+  envptrs[1] = sender;
+  envlens[1] = strlen(sender) + 1;
+
+  for (writestr = 0; writestr  6; writestr++) {
+if ((write(fde, (void *)envptrs[writestr], envlens[writestr])) != envlens[writestr]) {
+printf (write to qmail-queue failed: %d\n, errno);
+close(fdm);
+close(fde);
+vexiterr (EXIT_DEFER, system error);
+}
+  }
+
   close(fdm);
+  close(fde);
   waitpid(inject_pid,child,0);
   if (wait_exitcode(child) == 0) return;
   vexiterr (EXIT_DEFER, system error);

Re: [vchkpw] vdelivermail - expected behaviour?

2005-10-01 Thread Tom Collins

On Oct 1, 2005, at 1:16 PM, Brian Downey wrote:
The bounce-no-mailbox works when junk heads to 
'[EMAIL PROTECTED]', but when adding a dash extension onto 
any /existing/ address, such as [EMAIL PROTECTED],  
it gets delivered.  Even while the address does not specifically exist 
in the database or a corresponding .qmail-whatever file.


Is this expected behavior?  It's somewhat frustrating since there are 
a few lists out there that got ahold of my older email addresses 
(bdowney-something) and everything gets delivered no matter what.


Yes, that is expected behavior.  It may only apply if you compile with 
the --enable-qmail-ext configure option though.


One workaround would be to create a .qmail-bdowney-blablablah file with 
the following:


|/var/qmail/bin/bouncesaying 'Nonexistent account'

All mail to that address will bounce.  Of course, chkuser will still 
accept the message instead of rejecting it at the SMTP level, but it's 
better than having to deal with the mail.


Another option would be to just put '#' in the .qmail file to delete 
the message without delivering it.


--
Tom Collins  -  [EMAIL PROTECTED]
QmailAdmin: http://qmailadmin.sf.net/  Vpopmail: http://vpopmail.sf.net/
You don't need a laptop to troubleshoot high-speed Internet: 
sniffter.com




Re: [vchkpw] vdelivermail strangeness over nfs

2005-04-13 Thread John Chess
On 4/12/05, Tom Collins [EMAIL PROTECTED] wrote:
 On Apr 12, 2005, at 6:59 AM, John Chess wrote:
  Running lsof on the nfs mount, it looks like vdelivermail is walking
  the entire user directory tree on the nfs server. After sending a test
  mail to [EMAIL PROTECTED], an lsof shows:
 
 You probably have domain quotas enabled, and it's checking usage.  If
 you're not using domain quotas (AFAIK, they don't work), then recompile
 vpopmail with that feature disabled.
 
 Make sure both servers are set in the same time zone with clocks
 relatively in sync.  It could be that one thinks the maildirsize file
 is old and should be updated.

That's exactly what the problem was- ntpd had died on that box, and
the clock drifted enough to confuse it. Thank you for your help!

I misspoke when I said that vdelivermail was walking the entire user
directory. What I meant to say is that it was walking the entire
_domain_ directory, looking in each user's directory. I'm still
puzzled by this. Do you think domain quotas are causing this?

JC


Re: [vchkpw] vdelivermail strangeness over nfs

2005-04-13 Thread Tom Collins
On Apr 13, 2005, at 4:41 AM, John Chess wrote:
I misspoke when I said that vdelivermail was walking the entire user
directory. What I meant to say is that it was walking the entire
_domain_ directory, looking in each user's directory. I'm still
puzzled by this. Do you think domain quotas are causing this?
I know domain quotas are causing that.  Turn them off.
--
Tom Collins  -  [EMAIL PROTECTED]
QmailAdmin: http://qmailadmin.sf.net/  Vpopmail: http://vpopmail.sf.net/
You don't need a laptop to troubleshoot high-speed Internet: 
sniffter.com

--
Tom Collins  -  [EMAIL PROTECTED]
QmailAdmin: http://qmailadmin.sf.net/  Vpopmail: http://vpopmail.sf.net/
You don't need a laptop to troubleshoot high-speed Internet: 
sniffter.com



Re: [vchkpw] vdelivermail strangeness over nfs

2005-04-12 Thread Tom Collins
On Apr 12, 2005, at 6:59 AM, John Chess wrote:
Running lsof on the nfs mount, it looks like vdelivermail is walking
the entire user directory tree on the nfs server. After sending a test
mail to [EMAIL PROTECTED], an lsof shows:
You probably have domain quotas enabled, and it's checking usage.  If 
you're not using domain quotas (AFAIK, they don't work), then recompile 
vpopmail with that feature disabled.

Make sure both servers are set in the same time zone with clocks 
relatively in sync.  It could be that one thinks the maildirsize file 
is old and should be updated.

--
Tom Collins  -  [EMAIL PROTECTED]
QmailAdmin: http://qmailadmin.sf.net/  Vpopmail: http://vpopmail.sf.net/
You don't need a laptop to troubleshoot high-speed Internet: 
sniffter.com



Re: [vchkpw] vdelivermail

2005-04-07 Thread Boris Pavlov
mario,
you did changed the location of vpopmail but copied the old domains/ 
directory, right?
if so, you must change many things,
firstly, check if the vpopmail user and vchkpw group have same id's in 
/etc/passwd. if so, you can go on w/o reinstall
secondly, you must check out the qmail's assing file
and, then, change every single vpasswd file and every file in domains/ 
that begins with .qmail*

you can do it with a simple shell script.
Mario Cardia wrote:
Hi!
I need a help here.
i am makeing a new mailserver. i installed qmail, vpopmail, maildrop, 
etc...
the mail server works fine.
the problem is that i have many .qmail-user files that redirect mail with
vdeliver mail, exemple:
| /opt/vpopmail/bin/vdelivermail '' /opt/vpopmail/domains/test.com/user
It works fine in old mail server but in the new one it fails.
in qmail-send log i got the folowing message:
deferral: Unable_to_run_/bin/sh:_
i traced back and i know that it happens when vdelivermail execute the
execv command.
i change de vdelivermail to print errno message and the message was
too many open files.
it happens because vdelivermail was not supose to return in execv 
command, but it does and happens to execute too many vdelivermail process
i did check /bin/sh and /bin/bash permissions and it's ok (755).
just to make shure i've changed to 777 and the error persist.
i checked out qmail and vpopmail permissions and it was what
it supose to be
The diferences between de old server and the new server are:
- vpopmail version(5.4.5 in the old one, 5.4.10 in the new one)
- qmail location (/var/qmail in the old one, /opt/qmail in the new one)
i tried to downgrade vpopmail to 5.4.5 and the same error happens.
i compiled all software informing then where qmail is installed and
i don't think this could be the problem... (am i right?)
the vdelivermail in .qmail-default (bounce) works fine, only in
.qmail-user or .qmail-user-default the error hapens.
please, help me. I don't know what to do anymore.
thanks
Mario Cardia
[EMAIL PROTECTED]
(i'm brazilian, so sorry by my poor english)



Re: [vchkpw] vdelivermail and overquota catchalls

2005-02-04 Thread Juliano Simões
Tom,

We would be glad to test the new version of vdelivermail on
our test environment.

If you would like to send us the code, we will let you
about the results in a few days.

Regards,

Juliano Simões
Gerente de Tecnologia
Axios Tecnologia e Serviços
http://www.axios.com.br
[EMAIL PROTECTED]
+55 41 2141-1800

- Original Message - 
From: Tom Collins [EMAIL PROTECTED]
To: vchkpw@inter7.com
Sent: Friday, February 04, 2005 7:01 PM
Subject: Re: [vchkpw] vdelivermail and overquota catchalls


On Feb 4, 2005, at 10:37 AM, Juliano Simões wrote:
 However, if the message is sent to a non-existent account
 of a domain with an over quota catchall, the message gets
 delivered.

 Is there a way to enforce the quota limit in this case?

I have an updated vdelivermail that corrects this problem.  I haven't
had time to test it enough to release it to the other developers
though.  I think I still need to add one more piece of code (if it is
processing a user's .qmail file and they don't have a maildirsize file,
lookup the account's quota) before it will be ready for release.

If someone out there has a development system and can thoroughly test
it (verify that it defers in all overquota instance), I'll send it
their way.

--
Tom Collins  -  [EMAIL PROTECTED]
QmailAdmin: http://qmailadmin.sf.net/  Vpopmail: http://vpopmail.sf.net/
Info on the Sniffter hand-held Network Tester: http://sniffter.com/



Re: [vchkpw] vdelivermail slow delivery (too much...)

2005-01-15 Thread Bill Wichers
 The hardware is a Compaq Prolian 7000 whith 1.5 gb RAM and RAID 5 storage
 (100
 gb). There are 2 partition (both ext3) / and /var. qmail and vpopmail are
 installed in /var.

 The mail server has about 200 hosted domain but only one is big.

 This one has about 20k mail accounts.

Aha! Problem probably found! I have had similar problems with large mail
accounts on ext3 partitions. Above some number of files (which I've never
bothered to find out), server load goes through the roof and delivery
slows to a crawl. I suspect you have one or more users with thousands of
files in their maildir -- possibly a postmaster account set to catch-all
(which is dangerous), that is never checked and is full of spam.

Move your maildirs onto a parition formatted with a filesystem better
suited to large numbers of files in directories. Reiserfs is liked by many
and is frequently recommended by others on this list. I use XFS myself,
mainly due to its very nice backup/dump tools.

 -Bill

*
Waveform Technology
UNIX Systems Administrator




Re: [vchkpw] vdelivermail, user quotas and the maildirsize file

2004-12-04 Thread X-Istence
On Dec 3, 2004, at 7:24 PM, Tom Collins wrote:
I don't know.  I've only started to look into the mail quota code.
I may pull fresh code from the most recent Courier-IMAP (original 
source of most of the code) and make sure that I spend as little time 
with the file open as necessary.  I think that vdelivermail will open 
it for exclusive write access and then append the new size.

I have no idea how it will behave if multiple processes want to append 
to it at the same time.  It may be difficult, but I guess I could 
write a shell script that attempts to deliver two very large emails 
simultaneously.  I could also add an artificial delay in vdelivermail 
so it keeps the file open longer than necessary in order to force one 
process to wait for write access.

--
Tom Collins  -  [EMAIL PROTECTED]
QmailAdmin: http://qmailadmin.sf.net/  Vpopmail: 
http://vpopmail.sf.net/
Info on the Sniffter hand-held Network Tester: http://sniffter.com/


How about locking the file from reading and writing until the writing 
task is complete, that way there should never be an inconsistent 
moment, unless off course two vdelivermails try to grab the file lock 
at the same time, and kernel both grants them (Happened to me on BSD 
4.2, was solved in a later version). So that should never happen.

If you make the time spent with the file as little as possible, then 
there should be no slowdown at all.

X-Istence


Re: [vchkpw] vdelivermail, user quotas and the maildirsize file

2004-12-03 Thread Dave Goodrich
[intentionaly top posted]
You are my new hero Mr. Collins.
If you are in or near central Indiana, my wife makes apple pie and 
vegetable soup that grown men will crawl through broken glass for, there 
are a few servings waiting for you.

Can't wait to give it a try.
DAve
Tom Collins wrote:
I've undertaken the task of cleaning up vdelivermail. I think I've fixed 
some problems where vdelivermail could exit without closing its 
connection to MySQL. I've also fixed sections that exited with the wrong 
exit code (causing qmail-local to assume mail was delivered when it 
wasn't, or vice-versa).

I'm now digging into quotas. Oh, the joy.
I found one immediate problem. vdelivermail was adding an email's size 
to the maildirsize file before it was successfully delivered. If there 
was any sort of error, the maildirsize file would end up out of whack.

Additionally, the size of the extra headers (Return-Path and 
Delivered-To) weren't included in the values written. This causes a 
problem because POP/IMAP will enter a negative value for the size of the 
entire message (including those headers). I could be wrong on that -- 
the POP/IMAP server might use the S= part of the filename which was 
also written incorrectly by the old vdelivermail.

Anyway, I've made some good progress, and now it only updates 
maildirsize if the message was successfully written. It will update the 
maildirsize of ANY Maildir that it delivers to, including valiases, the 
catchall, and save-a-copy on .qmail files that forward to another location.

The only missing piece is actually checking for overquota situations on 
anything but a standard user without a .qmail file. I also don't handle 
the situation where the maildirsize file does not exist. Realistically, 
I can only re-create it for the Maildir that belongs to the current 
user. Other than reading the maildirsize file, there's no easy way to 
look up a quota based on a Maildir directory path.

After all of the time I've put into it, there's no way I'm going to 
touch domain quotas...

If anyone knows of any other vdelivermail oddities that should be fixed, 
please let me know and I'll try to address them in this upcoming release.

--
Tom Collins - [EMAIL PROTECTED]
QmailAdmin: http://qmailadmin.sf.net/ Vpopmail: http://vpopmail.sf.net/
Info on the *Sniffter* hand-held Network Tester: http://sniffter.com/

No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.289 / Virus Database: 265.4.4 - Release Date: 11/30/2004
--
Systems Administrator
http://www.tls.net
Get rid of Unwanted Emails...get TLS Spam Blocker!


RE: [vchkpw] vdelivermail, user quotas and the maildirsize file

2004-12-03 Thread shadowplay.net
Title: Message




does 
this change take into account the ablity for multi processing on the maildirsize 

and 2 
vdeliverers attempting to add to the mailbox at near simultaneous time... 

think 
multiple mailservers with a nfs connection to the maildirectories... 


ie at 
this time if i accept a mail its added to quota.. 
then 
while im writing my mail in a second vdeliver needs to 
write,
looksin quota, reports over,and we bounce.. 


under 
the new structure.. will this occur or will BOTH files get 

written into the mail directory...




  
  -Original Message-From: Tom Collins 
  [mailto:[EMAIL PROTECTED] 
  I found one immediate 
  problem. vdelivermail was adding an email's size to the maildirsize file 
  before it was successfully delivered. If there was any sort of error, the 
  maildirsize file would end up out of whack.
  


Re: [vchkpw] vdelivermail, user quotas and the maildirsize file

2004-12-03 Thread Tom Collins
On Dec 3, 2004, at 3:01 PM, shadowplay.net wrote:
does this change take into account the ablity for multi processing on 
the maildirsize
 and 2 vdeliverers attempting to add to the mailbox at near 
simultaneous time...
 think multiple mailservers with a nfs connection to the 
maildirectories...
  
ie at this time if i accept a mail its added to quota..
 then while im writing my mail in a second vdeliver needs to write,
looks in quota, reports over, and we bounce..
  
under the new structure.. will this occur or will BOTH files get
 written into the mail directory... 
I don't know.  I've only started to look into the mail quota code.
I may pull fresh code from the most recent Courier-IMAP (original 
source of most of the code) and make sure that I spend as little time 
with the file open as necessary.  I think that vdelivermail will open 
it for exclusive write access and then append the new size.

I have no idea how it will behave if multiple processes want to append 
to it at the same time.  It may be difficult, but I guess I could write 
a shell script that attempts to deliver two very large emails 
simultaneously.  I could also add an artificial delay in vdelivermail 
so it keeps the file open longer than necessary in order to force one 
process to wait for write access.

--
Tom Collins  -  [EMAIL PROTECTED]
QmailAdmin: http://qmailadmin.sf.net/  Vpopmail: http://vpopmail.sf.net/
Info on the Sniffter hand-held Network Tester: http://sniffter.com/


Re: [vchkpw] Vdelivermail high load

2004-07-13 Thread Jeremy Kitchen
On Tuesday 13 July 2004 09:47 am, Fernando Costa de Almeida wrote:
  Hi all,

  Today, when issuing a top on my pop server, I noticed that there were
 some vdelivermails process eating a lot of cpu resources. Then, looking
 in the logs files, I saw that it was a spam to a specific domain, and
 this domain had the postmaster account as the 'catchall account'.

  What surprised me is the number of emails in the its Maildir: about
 1479158 Is the number of emails in a Maildir related to the amount
 of cpu vdelivermail uses? I saw an increasing use of the disc too,
 somethings 100%...

if you're using ext2/3 filesystem, or any other non-directory hashing 
filesystem, this will occur.

This isn't vpopmail's fault, it's the filesystem.

You have two options, remove the emails, or switch to a better filesystem 
(such as reiserfs, or UFS with DIR_HASH)

for more details about this filesystem issue, please visit google, as this is 
discussed on more mailing lists than you could possibly think of.

-Jeremy

-- 
Jeremy Kitchen ++ Systems Administrator ++ Inter7 Internet Technologies, Inc.
  [EMAIL PROTECTED] ++ www.inter7.com ++ 866.528.3530 ++ 847.492.0470 int'l
kitchen @ #qmail #gentoo on EFnet ++ scriptkitchen.com/qmail



RE: [vchkpw] Vdelivermail high load

2004-07-13 Thread Fernando Costa de Almeida
Hi Jeremy, thanks for your explanation!

Im using FreeBSD and consequently an UFS Filesystem (with
DIR_HASH and SoftUpdates enabled). I will delete the emails, but I
posted this question just to make sure that my problem was caused by the
high number of files in the user's Maildir. The next step is to avoid
that an user have so many emails in his Maildir, perhaps enabling quota
for all users...

I frequently face high IO loads in this server, even though its
has one dedicated disk for the qmail queue and logs.

Thanks.


___
ALMEIDA, Fernando Costa de
Computeasy Informtica
www.computeasy.com.br
BSD USER BSD050945
ICQ 72293951

 -Original Message-
 From: Jeremy Kitchen [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, July 13, 2004 1:12 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [vchkpw] Vdelivermail high load
 
 
 On Tuesday 13 July 2004 09:47 am, Fernando Costa de Almeida wrote:
   Hi all,
 
   Today, when issuing a top on my pop server, I noticed that 
 there were
  some vdelivermails process eating a lot of cpu resources. 
 Then, looking
  in the logs files, I saw that it was a spam to a specific 
 domain, and
  this domain had the postmaster account as the 'catchall account'.
 
   What surprised me is the number of emails in the its Maildir: about
  1479158 Is the number of emails in a Maildir related to 
 the amount
  of cpu vdelivermail uses? I saw an increasing use of the disc too,
  somethings 100%...
 
 if you're using ext2/3 filesystem, or any other non-directory hashing 
 filesystem, this will occur.
 
 This isn't vpopmail's fault, it's the filesystem.
 
 You have two options, remove the emails, or switch to a 
 better filesystem 
 (such as reiserfs, or UFS with DIR_HASH)
 
 for more details about this filesystem issue, please visit 
 google, as this is 
 discussed on more mailing lists than you could possibly think of.
 
 -Jeremy
 
 -- 
 Jeremy Kitchen ++ Systems Administrator ++ Inter7 Internet 
 Technologies, Inc.
   [EMAIL PROTECTED] ++ www.inter7.com ++ 866.528.3530 ++ 
 847.492.0470 int'l
 kitchen @ #qmail #gentoo on EFnet ++ scriptkitchen.com/qmail
 
 



RE: [vchkpw] Vdelivermail high load

2004-07-13 Thread Charles Sprickman
On Tue, 13 Jul 2004, Fernando Costa de Almeida wrote:

   Hi Jeremy, thanks for your explanation!

   Im using FreeBSD and consequently an UFS Filesystem (with
 DIR_HASH and SoftUpdates enabled). I will delete the emails, but I
 posted this question just to make sure that my problem was caused by the
 high number of files in the user's Maildir. The next step is to avoid
 that an user have so many emails in his Maildir, perhaps enabling quota
 for all users...

Another question...  Is there a quota on this account?  I've caught some
maildrop and vdelivermail processes chewing up a ton of cpu just trying to
recalculate the quota.  Very similar situation; catchalls are evil and
outdated.  Since the user had an incredibly huge quota anyway, I set them
to NOQUOTA with vmoduser and everything calmed down.

Thanks,

Charles

   I frequently face high IO loads in this server, even though its
 has one dedicated disk for the qmail queue and logs.

   Thanks.


 ___
 ALMEIDA, Fernando Costa de
 Computeasy Informtica
 www.computeasy.com.br
 BSD USER BSD050945
 ICQ 72293951

  -Original Message-
  From: Jeremy Kitchen [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, July 13, 2004 1:12 PM
  To: [EMAIL PROTECTED]
  Subject: Re: [vchkpw] Vdelivermail high load
 
 
  On Tuesday 13 July 2004 09:47 am, Fernando Costa de Almeida wrote:
Hi all,
  
Today, when issuing a top on my pop server, I noticed that
  there were
   some vdelivermails process eating a lot of cpu resources.
  Then, looking
   in the logs files, I saw that it was a spam to a specific
  domain, and
   this domain had the postmaster account as the 'catchall account'.
  
What surprised me is the number of emails in the its Maildir: about
   1479158 Is the number of emails in a Maildir related to
  the amount
   of cpu vdelivermail uses? I saw an increasing use of the disc too,
   somethings 100%...
 
  if you're using ext2/3 filesystem, or any other non-directory hashing
  filesystem, this will occur.
 
  This isn't vpopmail's fault, it's the filesystem.
 
  You have two options, remove the emails, or switch to a
  better filesystem
  (such as reiserfs, or UFS with DIR_HASH)
 
  for more details about this filesystem issue, please visit
  google, as this is
  discussed on more mailing lists than you could possibly think of.
 
  -Jeremy
 
  --
  Jeremy Kitchen ++ Systems Administrator ++ Inter7 Internet
  Technologies, Inc.
[EMAIL PROTECTED] ++ www.inter7.com ++ 866.528.3530 ++
  847.492.0470 int'l
  kitchen @ #qmail #gentoo on EFnet ++ scriptkitchen.com/qmail
 
 




RE: [vchkpw] Vdelivermail high load

2004-07-13 Thread Fernando Costa de Almeida

 Yes!

 This account has a big quota (about 50MB)...
 
 Here is what I did:

 1) Deleted all emails from this account;
 2) Increased vfs.ufs.dirhash_maxmem to improve performance on big
directories (Thanks to Jeremy who mades me read more about DIRHASH)...
 

  And now, I will set the users to NOQUOTA (thanks to you, hehe)...

   

 
 Another question...  Is there a quota on this account?  I've 
 caught some
 maildrop and vdelivermail processes chewing up a ton of cpu 
 just trying to
 recalculate the quota.  Very similar situation; catchalls are evil and
 outdated.  Since the user had an incredibly huge quota 
 anyway, I set them
 to NOQUOTA with vmoduser and everything calmed down.
 
 Thanks,
 
 Charles
 
  I frequently face high IO loads in this server, even though its
  has one dedicated disk for the qmail queue and logs.
 
  Thanks.
 
 
  ___
  ALMEIDA, Fernando Costa de
  Computeasy Informtica
  www.computeasy.com.br
  BSD USER BSD050945
  ICQ 72293951
 
   -Original Message-
   From: Jeremy Kitchen [mailto:[EMAIL PROTECTED]
   Sent: Tuesday, July 13, 2004 1:12 PM
   To: [EMAIL PROTECTED]
   Subject: Re: [vchkpw] Vdelivermail high load
  
  
   On Tuesday 13 July 2004 09:47 am, Fernando Costa de Almeida wrote:
 Hi all,
   
 Today, when issuing a top on my pop server, I noticed that
   there were
some vdelivermails process eating a lot of cpu resources.
   Then, looking
in the logs files, I saw that it was a spam to a specific
   domain, and
this domain had the postmaster account as the 'catchall 
 account'.
   
 What surprised me is the number of emails in the its 
 Maildir: about
1479158 Is the number of emails in a Maildir related to
   the amount
of cpu vdelivermail uses? I saw an increasing use of 
 the disc too,
somethings 100%...
  
   if you're using ext2/3 filesystem, or any other 
 non-directory hashing
   filesystem, this will occur.
  
   This isn't vpopmail's fault, it's the filesystem.
  
   You have two options, remove the emails, or switch to a
   better filesystem
   (such as reiserfs, or UFS with DIR_HASH)
  
   for more details about this filesystem issue, please visit
   google, as this is
   discussed on more mailing lists than you could possibly think of.
  
   -Jeremy
  
   --
   Jeremy Kitchen ++ Systems Administrator ++ Inter7 Internet
   Technologies, Inc.
 [EMAIL PROTECTED] ++ www.inter7.com ++ 866.528.3530 ++
   847.492.0470 int'l
   kitchen @ #qmail #gentoo on EFnet ++ 
 scriptkitchen.com/qmail
  
  
 
 
 



Re: [vchkpw] vdelivermail traversing all maildirs on server before delivering mail

2004-06-29 Thread Tom Collins
On Jun 29, 2004, at 5:09 PM, Nick Bright wrote:
I will try this, but could you elaborate on why that is/would cause
this? Is this 'by design' for a setup with domain limits turned on?
It's a poor design that requires vdelivermail to traverse the entire 
domain to determine whether it's over quota or not.

--
Tom Collins  -  [EMAIL PROTECTED]
QmailAdmin: http://qmailadmin.sf.net/  Vpopmail: http://vpopmail.sf.net/
Info on the Sniffter hand-held Network Tester: http://sniffter.com/


Re: [vchkpw] vdelivermail traversing all maildirs on server before delivering mail

2004-06-29 Thread Nick Bright
On Tue, 2004-06-29 at 19:20, Tom Collins wrote:
 On Jun 29, 2004, at 5:09 PM, Nick Bright wrote:
  I will try this, but could you elaborate on why that is/would cause
  this? Is this 'by design' for a setup with domain limits turned on?
 
 It's a poor design that requires vdelivermail to traverse the entire 
 domain to determine whether it's over quota or not.
 
Ah. I see, thanks Tom.
 --
 Tom Collins  -  [EMAIL PROTECTED]
 QmailAdmin: http://qmailadmin.sf.net/  Vpopmail: http://vpopmail.sf.net/
 Info on the Sniffter hand-held Network Tester: http://sniffter.com/
-- 
- Nick Bright
  Terraworld, Inc
  http://home.terraworld.net | 888-332-1616



Re: [vchkpw] vdelivermail ignoring NOQUOATA?

2004-05-22 Thread Rod K
Nevermind it was a corrupt build.  Interesting thing was that I rebuilt 
it... twice... and still had problems.  I finally got the idea to copy 
the vdelivermail executable from a machine with the same arch.  Problem 
solved. 

Rod K wrote:
I have Vpopmail 5.4.0 installed on a FreeBSD 4.9 system.
We experienced a situation with very heaver load averages (sometimes  
30) and determined that vdelivermail seemed to be taking far too long 
to process mail delivery.

I ran truss on several of the vdelivermail processes and discovered 
that vdelivermal was doing a stat on every directory in the recipients 
domain, evidently for quota purposes.  However, no quotas are 
installed on the system.  vlimits.default is using default and every 
user also has NOQUOTA set.

Any ideas as to what could be causing this?
Rod Kreisler



Re: [vchkpw] vdelivermail bounce-no-mailbox. Can I drop?

2004-05-10 Thread Rick Widmer


[EMAIL PROTECTED] wrote:

does vdelivermail mail have a drop-no-mailbox option?
Replace drop-no-mailbox with delete

Rick






Re: [vchkpw] vdelivermail is soo slow..

2004-04-08 Thread X-Istence
Brian wrote:
Hello All,

I'm at a loss and all I can come up with is this:

last pid: 70373;  load averages:  4.32,  3.48,  3.53
up 33+19:31:48  09:32:36
148 processes: 26 running, 122 sleeping
CPU states:  5.6% user,  0.0% nice, 94.0% system,  0.2% interrupt,  0.2% 
idle
Mem: 125M Active, 262M Inact, 67M Wired, 19M Cache, 61M Buf, 28M Free
Swap: 512M Total, 512M Free

  PID USERNAME  PRI NICE  SIZERES STATE  C   TIME   WCPUCPU COMMAND
93447 www18   0 15384K 13288K lockf  1   3:06  2.20%  2.20% httpd
68988 vpopmail   56   0  1376K   944K RUN1   0:00 17.94%  1.71% 
vdelivermai
snip

Ouch, that looks painfull. Do the messages get delivered at all?



This is a snapshot from top as I'm trying to send an email to a local 
ezmlm list that goes to about 50 local people.
This shouldnt be slow at all. I have a mailling list that goes to 300 
local people, with vdelivermail and never have this problem, however, i 
do not use MySQL.

I get 50 vdelivermails (which is fine) but they are all slow to deliver.

I've had this server for almost a year (dual 933's 512Ecc U160 drives) 
and it does nothing but qmail+vpopmail and a webmail client.

I have clam antivirus and spamassassin which I'm calling through 
qmail-scanner.

this is my tcp.rules file:

127.0.0.:allow,RELAYCLIENT=,RBLSMTPD=,QMAILQUEUE=/var/qmail/bin/qmail-scanner-queue 

192.168.1.:allow,RELAYCLIENT=,RBLSMTPD=,QMAILQUEUE=/var/qmail/bin/qmail-scanner-queue 

:allow,QMAILQUEUE=/var/qmail/bin/qmail-scanner-queue
This is useless to us if its vdelivermail that is screwing up and not 
qmail-smtpd.


snip


and yesterday I was getting intermittent errors like this:

2004-04-06 09:28:48.197123500 delivery 19551: deferral: 
vmysql:_sql_error[1]:_Can't_create_database_'vpopmail'._Database_exists/
2004-04-06 09:28:48.211717500 delivery 19534: deferral: 
vmysql:_sql_error[1]:_Can't_create_database_'vpopmail'._Database_exists/
2004-04-06 09:28:48.232450500 delivery 19544: deferral: 
vmysql:_sql_error[1]:_Can't_create_database_'vpopmail'._Database_exists/
This cant be good.


snip
but so far today things have been ok.. except that vdeliver mail is *so* 
high..

Have you tried recompiling vpopmail from scratch/ports tree, and 
installing a new copy. It shouldnt make a difference, but if it does 
then something was wrong with your old binaries.

2004-04-07 09:41:06.857760500 delivery 956: success: did_0+0+1/
How long does it take approxamitly for each mail to be delivered with 
vdelivermail? And do you have it compiled with the spamassassin patch or 
not.

This is on a FreeBSD 4.9-p3 system ( I know I have to patch to p4 )

Go patch yourself :P

vpopmail-5.4.0 and mysql 3.23.57 (compiled for freebsd 4.8)

Should be fine.

Uptime: 23 hours 32 min 43 sec
Threads: 3  Questions: 18086  Slow queries: 0  Opens: 19  Flush tables: 
1  Open tables: 13 Queries per second avg: 0.213

TIA

- Brian


X-Istence


Re: [vchkpw] vdelivermail is soo slow..

2004-04-08 Thread Jeremy Kitchen
On Wednesday 07 April 2004 09:29 am, Brian wrote:
[snip bunch of vdelivermail's fighting for cpu]

 This is a snapshot from top as I'm trying to send an email to a local
 ezmlm list that goes to about 50 local people.

do all of those users have lots and lots of mail in their accounts, and you're 
running and old filesystem such as ext2/3 or UFS without DIR_HASH?  If so, 
you're seeing filesystem chokage, and need to either clean out those mail 
directories or get a better filesystem.

-Jeremy

-- 
Jeremy Kitchen
Systems Administrator
[EMAIL PROTECTED]
Kitchen @ #qmail on EFNet - Join the party!
.
Inter7 Internet Technologies, Inc.
www.inter7.com
866.528.3530 toll free
847.492.0470 int'l
847.492.0632 fax
GNUPG key ID: 93BDD6CE


Re: [vchkpw] vdelivermail EXITCODE problem

2003-10-01 Thread thomas.hendrich
Hi Anders,

thanks for that hint, I think I´ll give it a try next weekend.
To be honest, what I´ve done to get rid of that problem is let qmail do the whole 
stuff with interpreting the EXITCODE from my spamfilter script.

Instead of putting the .qmail file in 
/path-to-vpopmail/domains/domain1/emailadress1/.qmail ( here vdelivermail would do the 
delivery and the check for the EXITCODE ) I made a script to create a 
.qmail-emailadress1 in /path-to-vpopmail/domains/domain1/.qmail-emailadress1 ( here it 
is qmail that handles the .qmail file, starts my spamfilter script, gets the EXITCODE 
and then drops the mail into /path-to-vpopmail/domains/domain1/emailadress1/Maildir/ 
where vdelivermail gets it and delivers it.

It is somehow a little bit difficult but works fine for me.
If I have any experiences with that patch I´ll let you all know.

Thanks

Thomas

 Hi,

 On Tue, 2003-09-30 at 10:09, [EMAIL PROTECTED] wrote:
  So I upgraded to the last stable version 5.2.1 whereas the
  changelog said that within 5.2.1 the EXITCODE checks would be
  performed.

 Vpopmail 5.2.1 fails to catch exitcode 100. Here is a patch:
 http://fmail.dk/stuff/vpopmail-5.2.1-vdeliver-command-100.diff

 Hope this helps.

 /Anders





 



Re: [vchkpw] vdelivermail EXITCODE problem

2003-09-30 Thread Brah Mon
Something to look at:

it seems to stand out in my memory as ive had this same problem, but i dont
recall a resolve for it..
basically if you are having the same problem i was, then you cannot have
anything in your .qmail processing fork..
it must continue to run in the foreground or the mail will keep
re-spawning.. one day i ended up with 900 mysqld's running
due to vdelivermail-maildrop-mailfilter. and it only seemed to happen when
called by .qmail files.
if you are doing any processing in .qmail files, make sure they do not get
backgrounded or forked..

i think the man pages for either vdelivermail or qmail-command will have
more info about this..

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, September 30, 2003 4:09 AM
Subject: [vchkpw] vdelivermail EXITCODE problem


Hi everybody,

yesterday I asked you if there is a problem in vdelivermail of handling
EXITCODEs in .qmail files and I discovered that in my installed version 5.2
no checking of the EXITCODE was possible.

So I upgraded to the last stable version 5.2.1 whereas the changelog said
that within 5.2.1 the EXITCODE checks would be performed.

Now over the night I discovered that a script started within a .qmail file
before the deliver-to-Maildir instruction and returns an EXITCODE of 99 or
100 ( which value is not important ) the delivery of that mail is
interrupted ( not stopped as it sould be ) BUT the mail stays in the queue
and the queue starts delivering mail again and again.
What I´m trying to say is that one single mail has been delivered about 200
times that night and everytime the script told vdelivermail to end the
delivery and everytime the mail stayed within the qmail queue to be
delivered some time later.

What I now want to know is if there must be another EXITCODE so that
vdelivermail definetely kills that mail processing or if this is a bug in
vdelivermail and I should upgrade to something higher ( i read in the
changelog that several fixes to the EXITCODE thing have been made in 5.3.x
but this versions are to be devel-state and I´m wondering if I should use
devel-software on a running system.

Thanks for your help!

Thomas






Re: [vchkpw] vdelivermail EXITCODE problem

2003-09-30 Thread Anders Brander
Hi,

On Tue, 2003-09-30 at 10:09, [EMAIL PROTECTED] wrote:
 So I upgraded to the last stable version 5.2.1 whereas the
 changelog said that within 5.2.1 the EXITCODE checks would be
 performed.

Vpopmail 5.2.1 fails to catch exitcode 100. Here is a patch:
http://fmail.dk/stuff/vpopmail-5.2.1-vdeliver-command-100.diff

Hope this helps.

/Anders





Re: [vchkpw] vdelivermail and bounced messages

2003-04-04 Thread Peter Palmreuther
Hi Chris,

On Fri, 04 Apr 2003 08:35:19 -0600 Chris Manjoine wrote:

 When mail gets sent to a user that does not exist it gets bounced to
 the user and to the default postmaster not of the domain but for the
 email server.

 my .qmail.default file says
 | /usr/home/vpopmail/bin/vdelivermail '' bounce-no-mailbox

Are you sure the _bounce_ gets directed and delivered to $SENDER _AND_
postmaster?

Usually postmaster only gets double-bounces, stating ... but the bounce
bounced. ... in the very beginning of the mail.

What makes you assume _qmail_ (and it is qmail handling the bounce,
vdelivermail only exits '100' to tell qmail delivery agent to bounce)
doubles the bounce?
-- 
Pit



Re: [vchkpw] vdelivermail and bounced messages

2003-04-04 Thread Chris Manjoine
ok bounces the the default postmaster when the sender is bogus so it 
doesn't send twice.
So I guess my problem is how do I get those bounces to goto the virtual 
email postmaster and not the default mail server postmaster?

At 05:00 PM 4/4/2003 +0200, you wrote:
Hi Chris,

On Fri, 04 Apr 2003 08:35:19 -0600 Chris Manjoine wrote:

 When mail gets sent to a user that does not exist it gets bounced to
 the user and to the default postmaster not of the domain but for the
 email server.
 my .qmail.default file says
 | /usr/home/vpopmail/bin/vdelivermail '' bounce-no-mailbox
Are you sure the _bounce_ gets directed and delivered to $SENDER _AND_
postmaster?
Usually postmaster only gets double-bounces, stating ... but the bounce
bounced. ... in the very beginning of the mail.
What makes you assume _qmail_ (and it is qmail handling the bounce,
vdelivermail only exits '100' to tell qmail delivery agent to bounce)
doubles the bounce?
--
Pit




RE: Re: [vchkpw] vdelivermail and bounced messages

2003-04-04 Thread domi

one solution could be to use doublebounceto
and write a program to take care of mails, parsing
them and trying to find out what to do with it.
And finally dump it to domain postmaster or the
mailer-deamon or /dev/null depending on what it is...

Just a thought, have never tested, not even done
some deeper analyzing of the problem...

=d0Mi=

  Original Message -
 Date:  4-Apr-2003 22:25:50 +0200
 From: Chris Manjoine [EMAIL PROTECTED]
 To:  [EMAIL PROTECTED]
 Subject: Re: [vchkpw] vdelivermail and bounced messages
 
 ok bounces the the default postmaster when the sender is bogus so it 
 doesn't send twice.
 So I guess my problem is how do I get those bounces to goto the virtual 
 email postmaster and not the default mail server postmaster?
 
 At 05:00 PM 4/4/2003 +0200, you wrote:
 Hi Chris,
 
 On Fri, 04 Apr 2003 08:35:19 -0600 Chris Manjoine wrote:
 
   When mail gets sent to a user that does not exist it gets bounced to
   the user and to the default postmaster not of the domain but for the
   email server.
 
   my .qmail.default file says
   | /usr/home/vpopmail/bin/vdelivermail '' bounce-no-mailbox
 
 Are you sure the _bounce_ gets directed and delivered to $SENDER _AND_
 postmaster?
 
 Usually postmaster only gets double-bounces, stating ... but the bounce
 bounced. ... in the very beginning of the mail.
 
 What makes you assume _qmail_ (and it is qmail handling the bounce,
 vdelivermail only exits '100' to tell qmail delivery agent to bounce)
 doubles the bounce?
 --
 Pit
 
 




Re: [vchkpw] vdelivermail and Delivered-To

2003-03-05 Thread Claudio Nieder
Hi,

 Delivered-To: [EMAIL PROTECTED]

when I noticed, and looked up the mailing list archive for a solution I
found only messages saying, that it has to be this way. Not beeing
convinced myself I modified vdelivermail for me. This should be the
needed patch against vpopmail 5.2.1:

 --- vdelivermail.c.orig Mon Dec  2 15:11:01 2002
 +++ vdelivermail.c  Tue Dec 10 15:22:51 2002
 @@ -824,12 +825,27 @@
  return(message_size);
  }
  
 +#define PATHSIZE (500)
 +
  char *maildir_to_email(char *maildir)
  {
   static char email[256];
 + static char pwd[PATHSIZE];
 + static char maildir_abs[PATHSIZE];
   int i, j=0;
 + int rc;
   char *pnt, *last;
  
 +if (maildir[0]!='/') {
 +   getcwd(pwd,PATHSIZE);
 +   rc=chdir(maildir);
 +   if (rc==0) {
 + getcwd(maildir_abs,PATHSIZE);
 +  maildir=(maildir_abs[0]);
 + strncat(maildir,/,PATHSIZE);
 +  chdir(pwd);
 +   }
 +}
  memset(email, 0, sizeof(email));
  for(last=NULL, pnt=maildir; (pnt=strstr(pnt,/Maildir/))!=NULL; pnt+=9 ){
  last = pnt;
 @@ -843,20 +859,23 @@
  
  for( i=(pnt-maildir); (i  1  *(pnt-1) != '/'); --pnt, --i);
  
 +last=pnt; /* last points to first character of user name */
 +
  for( ; (*pnt  *pnt != '/'  j  255); ++pnt) {
  email[j++] = *pnt;
  }
  
  email[j++] = '@';
  
 -for (last=NULL, pnt=maildir; (pnt=strstr(pnt, / DOMAINS_DIR /)); 
pnt+=strlen(/ DOMAI
 NS_DIR /)) {
 -last = pnt;
 -}
 +pnt=last-2;
 +/* pnt points to last character of domain directory */
  
 -if(!last) return ;
 +for (i=(pnt-maildir); (i1  *(pnt-1)!='/'); --pnt, --i) ;
  
 -for( pnt = last + 9; (*pnt  *pnt != '/'  j  255); ++pnt, ++j ) {
 -  email[j] = *pnt;
 +/* pnt points to first character of domain name */
 +
 +for( ; (*pnt  *pnt != '/'  j  255); ++pnt ) {
 +  email[j++] = *pnt;
  }
  
  email[j] = 0;

DISCLAIMER: It's some time ago when I did the patching and I am no more
sure this is the right version of the patch. Please verify yourself if
it does what you expect, and no harm.

claudio
-- 
Claudio Nieder  .  mailto:[EMAIL PROTECTED]  .  http://www.inodes.ch
 iNodes AG  .  Friesenbergstrasse 3  .  CH-8055 Zürich  .  +41 43 960 0066





Re: [vchkpw] vdelivermail and Delivered-To

2003-03-05 Thread Flavio Curti
hi

On Wed, Mar 05, 2003 at 07:32:01PM +0100, Claudio Nieder wrote:
 when I noticed, and looked up the mailing list archive for a solution I
 found only messages saying, that it has to be this way. Not beeing

   well, i'm no-way convinced by this as well. imho this breaks a lot of
stuff. (Serialmail for example, which relies on the Delivered-To: for
the redelivery of the mail).
imho according to envelopes(5):

   When a message is delivered by qmail to a single local
recipient, qmail-local records the recipient in Delivered-To
and the envelope sender in Return-Path.  It uses Delivered-To to
detect mail forwarding loops.

   so, [EMAIL PROTECTED] clearly is not the reciepient. (maildirsmtp will issue a 
RCPT TO: [EMAIL PROTECTED] in the SMTP conversation, which will lead to a 
Relaying Denied error)


 convinced myself I modified vdelivermail for me. This should be the
 needed patch against vpopmail 5.2.1:

   thank you for the patch, will this patch make it into the vpopmail
release?? 

thank you  greetz

flavio

--
http://no-way.org/~fcu/



Re: [vchkpw] vdelivermail problem?

2003-02-11 Thread Bill Shupp
On Monday, February 10, 2003, at 08:50  AM, Dzuy Nguyen wrote:

Juraj Hantak wrote:

Hi all,
I have a problem with vdelivermail it is not correctly proceeding
.qmail- files.
Imagine situation you have a domain called test.com. Do you want to
forward the whole domain everything@test.com into address
[EMAIL PROTECTED] and the address should be proceed acording its .qmail
file. {local deliverded and forwarded to external address}
do you have in
.qmail-default
| path to vdelivermail vdelivermail '' [EMAIL PROTECTED]
and there is a file called
.qmail-john
[EMAIL PROTECTED]
path to domain/test.com/john/Maildir/
there is a mailbox [EMAIL PROTECTED]
And the behaviour is now:
when you send mail directly to [EMAIL PROTECTED] its correctly proceed and
is local delivered and a copy is forwarded to external address.
But when you send mail to [EMAIL PROTECTED] its only localy delivered it is
not forwarded to external mail address.
Can somebody help me with this problem, I have tested the stable
 5.2.1  version and developement  5.3.14


The correct thing to do is put the external email address in the 
vdelivermail line, like so:

| /home/vpopmail/bin/vdelivermail '' [EMAIL PROTECTED]

.qmal files in the domain directory are for qmail-local processing, NOT 
vdelivermail.  This is why the setup you described fails.  vdelivermail 
checks for a vpasswd entry for john since test.com is the local domain. 
 It does NOT look at .qmail files in the domain's directory, just 
.qmail files in the user's directory.

 Best regards
 Juraj Hantak


There is a bug in vdelivermail since 5.2 which I identified and 
reported.  I'm
surprised it didn't make it to 5.3 development releases.  Basically, 
forward and
keeps a copy works fine, but forward alone does not.  Please check the 
archive
for details of the problem.

I assume you are referring to this message:

http://www.mail-archive.com/vchkpw@inter7.com/msg11007.html

See the argument above.  The same logic applies, and it's not a bug.

Regards,

Bill Shupp





Re: [vchkpw] vdelivermail problem?

2003-02-11 Thread Dzuy Nguyen
Bill Shupp wrote:

On Monday, February 10, 2003, at 08:50  AM, Dzuy Nguyen wrote:


Juraj Hantak wrote:


Hi all,
I have a problem with vdelivermail it is not correctly proceeding
.qmail- files.
Imagine situation you have a domain called test.com. Do you want to
forward the whole domain everything@test.com into address
[EMAIL PROTECTED] and the address should be proceed acording its .qmail
file. {local deliverded and forwarded to external address}
do you have in
.qmail-default
| path to vdelivermail vdelivermail '' [EMAIL PROTECTED]
and there is a file called
.qmail-john
[EMAIL PROTECTED]
path to domain/test.com/john/Maildir/
there is a mailbox [EMAIL PROTECTED]
And the behaviour is now:
when you send mail directly to [EMAIL PROTECTED] its correctly proceed and
is local delivered and a copy is forwarded to external address.
But when you send mail to [EMAIL PROTECTED] its only localy delivered it is
not forwarded to external mail address.
Can somebody help me with this problem, I have tested the stable
 5.2.1  version and developement  5.3.14



The correct thing to do is put the external email address in the 
vdelivermail line, like so:

| /home/vpopmail/bin/vdelivermail '' [EMAIL PROTECTED]

.qmal files in the domain directory are for qmail-local processing, NOT 
vdelivermail.  This is why the setup you described fails.  vdelivermail 
checks for a vpasswd entry for john since test.com is the local domain. 
 It does NOT look at .qmail files in the domain's directory, just .qmail 
files in the user's directory.

 Best regards
 Juraj Hantak



There is a bug in vdelivermail since 5.2 which I identified and 
reported.  I'm
surprised it didn't make it to 5.3 development releases.  Basically, 
forward and
keeps a copy works fine, but forward alone does not.  Please check the 
archive
for details of the problem.


I assume you are referring to this message:

http://www.mail-archive.com/vchkpw@inter7.com/msg11007.html


Bill, the message above was unrelated to this problem.  I was looking for
ways to make alias user to get the spam checking.  I didn't say it was a bug.
BTW, I still have not found a suitable solution for qmail/vpopmail/spamassassin
to play nice with each other.

The bug I was refering to was mentioned in a thread months ago.  It involves
.qmail file in the user's directory.  If it's fixed, then I apologized.


See the argument above.  The same logic applies, and it's not a bug.

Regards,

Bill Shupp











Re: [vchkpw] vdelivermail problem?

2003-02-11 Thread Bill Shupp
On Tuesday, February 11, 2003, at 08:07  AM, Dzuy Nguyen wrote:


Bill, the message above was unrelated to this problem.  I was looking 
for
ways to make alias user to get the spam checking.  I didn't say it was 
a bug.
BTW, I still have not found a suitable solution for 
qmail/vpopmail/spamassassin
to play nice with each other.

A patch to vdelivermail was sent to the list last week.  I hope to test 
it today and integrate it into 5.3.17 if all goes well.

The bug I was refering to was mentioned in a thread months ago.  It 
involves
.qmail file in the user's directory.  If it's fixed, then I apologized.

The only other mention I found in the archives was you referring to a 
bug that was *fixed* in 5.3.x... can you post the URL to the specific 
problem?

Regards,

Bill




Re: [vchkpw] vdelivermail problem?

2003-02-10 Thread Dzuy Nguyen
Juraj Hantak wrote:

Hi all,

I have a problem with vdelivermail it is not correctly proceeding
.qmail- files.

Imagine situation you have a domain called test.com. Do you want to
forward the whole domain everything@test.com into address
[EMAIL PROTECTED] and the address should be proceed acording its .qmail
file. {local deliverded and forwarded to external address}

do you have in
.qmail-default
| path to vdelivermail vdelivermail '' [EMAIL PROTECTED]


and there is a file called
.qmail-john
[EMAIL PROTECTED]
path to domain/test.com/john/Maildir/

there is a mailbox [EMAIL PROTECTED]


And the behaviour is now:
when you send mail directly to [EMAIL PROTECTED] its correctly proceed and
is local delivered and a copy is forwarded to external address.

But when you send mail to [EMAIL PROTECTED] its only localy delivered it is
not forwarded to external mail address.

Can somebody help me with this problem, I have tested the stable
 5.2.1  version and developement  5.3.14

 Best regards

 Juraj Hantak




There is a bug in vdelivermail since 5.2 which I identified and reported.  I'm
surprised it didn't make it to 5.3 development releases.  Basically, forward and
keeps a copy works fine, but forward alone does not.  Please check the archive
for details of the problem.






Re: [vchkpw] vdelivermail fails when alias line starting with | and containing /Maildir/

2002-10-23 Thread Bill Shupp
On Wednesday, October 23, 2002, at 05:28  AM, Anders Brander wrote:


Hi,

I think i've encountered a bug, vdelivermail seems to process the line:
|/do/deliver/to /home/vpopmail/domains/example.com/test1/Maildir/
wrongly. It deals with it like it's a /Maildir/-line, which is wrong.
It seems like vdelivermail checks for /Maildir/ anywhere in the line,
before it checks for a | at the start of the line. I've made a quick 
fix
to vdelivermail.c.

http://fmail.dk/stuff/vdeliver-command.diff

Please test and comment.

Looks good, I've added this.

Regards,

Bill Shupp