New open source project (Postfix-qreject)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
22 messages Options
12
Reply | Threaded
Open this post in threaded view
|

New open source project (Postfix-qreject)

Egoitz Aurrekoetxea Aurre
Hi mates!!

As I said I was working on a postfix policy for rejecting mail at smtp
time when users are overquota or entering mail is bigger than free
available space in mailbox...

And here is the result http://open.nht-norwick.com/postfix-qreject.html

I hope you find it useful :)

Bye!!!

Reply | Threaded
Open this post in threaded view
|

Re: New open source project (Postfix-qreject)

Patrick Ben Koetter
* [hidden email] <[hidden email]>:
> Hi mates!!
>
> As I said I was working on a postfix policy for rejecting mail at smtp
> time when users are overquota or entering mail is bigger than free
> available space in mailbox...
>
> And here is the result http://open.nht-norwick.com/postfix-qreject.html

Not Found

The requested URL /postfix-qreject.html was not found on this server.

>
> I hope you find it useful :)
>
> Bye!!!
>

--
The Book of Postfix
<http://www.postfix-book.com>
saslfinger (debugging SMTP AUTH):
<http://postfix.state-of-mind.de/patrick.koetter/saslfinger/>
Reply | Threaded
Open this post in threaded view
|

Re: New open source project (Postfix-qreject)

Gerard Seibert-5
On Fri, 6 Jun 2008 09:03:22 +0200
Patrick Ben Koetter <[hidden email]> wrote:

[snip]
 
> > And here is the result
> > http://open.nht-norwick.com/postfix-qreject.html
>
> Not Found
>
> The requested URL /postfix-qreject.html was not found on this server.

It is working fine here.


--
Gerard

I never take work home with me; I always leave it in some bar along the
way.
Reply | Threaded
Open this post in threaded view
|

Re: New open source project (Postfix-qreject)

Patrick Ben Koetter
* Gerard Seibert <[hidden email]>:

> On Fri, 6 Jun 2008 09:03:22 +0200
> Patrick Ben Koetter <[hidden email]> wrote:
>
> [snip]
>  
> > > And here is the result
> > > http://open.nht-norwick.com/postfix-qreject.html
> >
> > Not Found
> >
> > The requested URL /postfix-qreject.html was not found on this server.
>
> It is working fine here.

It does, now.

p@rick

--
The Book of Postfix
<http://www.postfix-book.com>
saslfinger (debugging SMTP AUTH):
<http://postfix.state-of-mind.de/patrick.koetter/saslfinger/>
Reply | Threaded
Open this post in threaded view
|

Re: New open source project (Postfix-qreject)

Egoitz Aurrekoetxea Aurre
The A record of open.... was pointing to an incorrect ip... I have fixed
at half past nine more or less... or perhaps a bit more but is solved
now and now should work without problems

Sorry ;-)
Patrick Ben Koetter wrote:

> * Gerard Seibert <[hidden email]>:
>  
>> On Fri, 6 Jun 2008 09:03:22 +0200
>> Patrick Ben Koetter <[hidden email]> wrote:
>>
>> [snip]
>>  
>>    
>>>> And here is the result
>>>> http://open.nht-norwick.com/postfix-qreject.html
>>>>        
>>> Not Found
>>>
>>> The requested URL /postfix-qreject.html was not found on this server.
>>>      
>> It is working fine here.
>>    
>
> It does, now.
>
> p@rick
>
>  

Reply | Threaded
Open this post in threaded view
|

Re: New open source project (Postfix-qreject)

Goralski Nicolas
In reply to this post by Egoitz Aurrekoetxea Aurre

On Jun 6, 2008, at 9:05 AM, [hidden email] wrote:

> Hi mates!!
>
> As I said I was working on a postfix policy for rejecting mail at smtp
> time when users are overquota or entering mail is bigger than free
> available space in mailbox...
>
> And here is the result http://open.nht-norwick.com/postfix- 
> qreject.html
>
> I hope you find it useful :)
>
> Bye!!!
>


Hi, here i'm using lmtpd from pll.sf.net that handle overquota and  
keep mails
for a time (as you wish, to me it's 7 days). Before to send an email  
of overquota.

Everytime someone is overquota, lmtpd deliver an email to the user and  
tell
him that he is overquota.

Regards
Reply | Threaded
Open this post in threaded view
|

Re: New open source project (Postfix-qreject)

Egoitz Aurrekoetxea Aurre
No, I don't want to keep mails because that could increase deferred queue
significantly... I want to reject mail at smtp time... and I do too the
quotawarn messages, that's ok, but I don't want to do backscattering or
keeping mails in queue...  that's what we get with postfix-quotareject


>
> Hi, here i'm using lmtpd from pll.sf.net that handle overquota and
> keep mails
> for a time (as you wish, to me it's 7 days). Before to send an email
> of overquota.
>
> Everytime someone is overquota, lmtpd deliver an email to the user and
> tell
> him that he is overquota.
>
> Regards
>


Reply | Threaded
Open this post in threaded view
|

Re: New open source project (Postfix-qreject)

Wietse Venema
In reply to this post by Egoitz Aurrekoetxea Aurre
[hidden email]:
> Hi mates!!
>
> As I said I was working on a postfix policy for rejecting mail at smtp
> time when users are overquota or entering mail is bigger than free
> available space in mailbox...
>
> And here is the result http://open.nht-norwick.com/postfix-qreject.html
>
> I hope you find it useful :)

my $consulta02= "select buzon from dirbuzon where direccion="."'$recipiente'";

You may want to use $dbh02->quote($recipiente) instead of the raw
recipient address, to avoid SQL injection. Even if you only accept
recipient addresses that are known to exist, an attacker can still
send arbitrary text be in an address extension, if the MTA has a
non-empty recipient_delimiter configured.

        Wietse

Reply | Threaded
Open this post in threaded view
|

Re: New open source project (Postfix-qreject)

MrC-7
> [hidden email]:
> Hi mates!!
>
> As I said I was working on a postfix policy for rejecting mail at smt
> time when users are overquota or entering mail is bigger than free
> available space in mailbox...
>
> And here is the result http://open.nht-norwick.com/postfix-qreject.html
>
> I hope you find it useful :)

Perhaps it would be good to check your return value from:

   chdir($dirmaildir);

MrC
Reply | Threaded
Open this post in threaded view
|

Re: New open source project (Postfix-qreject)

Egoitz Aurrekoetxea Aurre
In reply to this post by Wietse Venema
Wietse Venema wrote:

> [hidden email]:
>  
>> Hi mates!!
>>
>> As I said I was working on a postfix policy for rejecting mail at smtp
>> time when users are overquota or entering mail is bigger than free
>> available space in mailbox...
>>
>> And here is the result http://open.nht-norwick.com/postfix-qreject.html
>>
>> I hope you find it useful :)
>>    
>
> my $consulta02= "select buzon from dirbuzon where direccion="."'$recipiente'";
>
> You may want to use $dbh02->quote($recipiente) instead of the raw
> recipient address, to avoid SQL injection. Even if you only accept
> recipient addresses that are known to exist, an attacker can still
> send arbitrary text be in an address extension, if the MTA has a
> non-empty recipient_delimiter configured.
>
> Wietse
>
>  
Hi Wietse!!!

I see, I'll check this of course. Thanks a lot :)

bye!!!
Reply | Threaded
Open this post in threaded view
|

Re: New open source project (Postfix-qreject)

Egoitz Aurrekoetxea Aurre
In reply to this post by MrC-7
MrC wrote:
[hidden email]
Hi mates!!

As I said I was working on a postfix policy for rejecting mail at smt
time when users are overquota or entering mail is bigger than free
available space in mailbox...

And here is the result http://open.nht-norwick.com/postfix-qreject.html

I hope you find it useful :) 
    

Perhaps it would be good to check your return value from:

   chdir($dirmaildir);

MrC
  

Hi MrC!!

Sorry mate what did you mean?  it justs "moves"  postfix-qreject to that directory for being able to find maildirsize file... explain it please, and if it's necessary I'll take a look at it...

Thanks a lot
:-)

Bye!!
Reply | Threaded
Open this post in threaded view
|

Re: New open source project (Postfix-qreject)

mouss-2
Egoitz Aurrekoetxea wrote:

> MrC wrote:
>>> [hidden email]:
>>> Hi mates!!
>>>
>>> As I said I was working on a postfix policy for rejecting mail at smt
>>> time when users are overquota or entering mail is bigger than free
>>> available space in mailbox...
>>>
>>> And here is the result http://open.nht-norwick.com/postfix-qreject.html
>>>
>>> I hope you find it useful :)    
>>
>> Perhaps it would be good to check your return value from:
>>
>>    chdir($dirmaildir);
>>
>> MrC
>>  
>
> Hi MrC!!
>
> Sorry mate what did you mean?  it justs "moves"  postfix-qreject to
> that directory for being able to find maildirsize file... explain it
> please, and if it's necessary I'll take a look at it...


if you rely on chdir() to suceed, then you should check the return value.

but why chdir at all?
>
> Thanks a lot
> :-)
>
> Bye!!
>

Reply | Threaded
Open this post in threaded view
|

Re: New open source project (Postfix-qreject)

Wietse Venema
In reply to this post by Egoitz Aurrekoetxea Aurre
Egoitz Aurrekoetxea:
[ Charset ISO-8859-1 unsupported, converting... ]

> MrC wrote:
> >> [hidden email]:
> >> Hi mates!!
> >>
> >> As I said I was working on a postfix policy for rejecting mail at smt
> >> time when users are overquota or entering mail is bigger than free
> >> available space in mailbox...
> >>
> >> And here is the result http://open.nht-norwick.com/postfix-qreject.html
> >>
> >> I hope you find it useful :)
> >>    
> >
> > Perhaps it would be good to check your return value from:
> >
> >    chdir($dirmaildir);
> >
> > MrC
> >  
>
> Hi MrC!!
>
> Sorry mate what did you mean?  it justs "moves"  postfix-qreject to that
> directory for being able to find maildirsize file... explain it please,
> and if it's necessary I'll take a look at it...

What should the program do if chdir() fails?

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: New open source project (Postfix-qreject)

Egoitz Aurrekoetxea Aurre
In reply to this post by mouss-2

> if you rely on chdir() to suceed, then you should check the return value.
>
> but why chdir at all?
>>
>> Thanks a lot
>> :-)
>>
>> Bye!!
>>
>

I assume chdir normally unless could only fail if directory doesn't
exist... well... when postfix-qreject fails for whatever reason...
postfix return 4.3.5 Server Configuration Problem... so when mail were
going to enter to that recipient if it's listed in dirbuzon table and
maildir directory is wrong it should return a 4.3.5, because it's bad
entered in mysql table... but now in the other hand imagine that you
have some recipients wich are not listed in dirbuzon table... well
rejection at smtp time won't be working for them... postfix-qreject
won't check them... but there won't be any 4.3.5 or any error, when that
recipient not listed in dirbuzon table reaches it's quota limit, mail
will be queued with temporary failure : user is overquota... so... if
the a recipient exists but is not listed in dirbuzon table... just
doesn't happen nothing.


why chdir? well mainly because it's what I found when was doing this
code... for nothing at all :-) ; but well it seems to work nice... :-)




Reply | Threaded
Open this post in threaded view
|

Re: New open source project (Postfix-qreject)

Egoitz Aurrekoetxea Aurre
In reply to this post by Wietse Venema

> What should the program do if chdir() fails?
>
> Wietse
>  

Nothing specially I think perhaps is good to fail with a 4.3.5 error for
admin to know something has happened with that row of dirbuzon table...
assuming it just fails because directory entered in dirbuzon table it's
wrong entered in the table; well could happen too that postfix-qreject
not to have permission to access to maildir of the user... but that's
another thing IMHO the user should take account, and in the doc I say
postfix-qreject should run as user used to deliver mail (and this user
should have permissions). Or do you think, Wietse, Mouss is something
wrong using chdir? I think it's ok, why not?


Reply | Threaded
Open this post in threaded view
|

Re: New open source project (Postfix-qreject)

Victor Duchovni
On Sat, Jun 07, 2008 at 11:24:23PM +0200, Egoitz Aurrekoetxea wrote:

> should have permissions). Or do you think, Wietse, Mouss is something
> wrong using chdir? I think it's ok, why not?

THere is something wrong with making system-calls that can fail and
not checking the results. If you expect to reliable code for use
by others, you must understand this, and never fail to check and
take appropriate action.

--
        Viktor.

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the "Reply-To" header.

To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:
<mailto:[hidden email]?body=unsubscribe%20postfix-users>

If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.
Reply | Threaded
Open this post in threaded view
|

Re: New open source project (Postfix-qreject)

mouss-2
In reply to this post by Egoitz Aurrekoetxea Aurre
Egoitz Aurrekoetxea wrote:

>
>> if you rely on chdir() to suceed, then you should check the return
>> value.
>>
>> but why chdir at all?
>>>
>>> Thanks a lot
>>> :-)
>>>
>>> Bye!!
>>>
>>
>
> I assume chdir normally unless could only fail if directory doesn't
> exist...


you're assuming too much. try
# man chdir
and look at the "ERRORS" section, and this will only give you info about
one particular system.

Always check the return value of system calls.
   
http://sunsite.uakom.sk/sunworldonline/swol-08-1998/swol-08-security.html



> well... when postfix-qreject fails for whatever reason... postfix
> return 4.3.5 Server Configuration Problem... so when mail were going
> to enter to that recipient if it's listed in dirbuzon table and
> maildir directory is wrong it should return a 4.3.5, because it's bad
> entered in mysql table... but now in the other hand imagine that you
> have some recipients wich are not listed in dirbuzon table... well
> rejection at smtp time won't be working for them... postfix-qreject
> won't check them... but there won't be any 4.3.5 or any error, when
> that recipient not listed in dirbuzon table reaches it's quota limit,
> mail will be queued with temporary failure : user is overquota...
> so... if the a recipient exists but is not listed in dirbuzon table...
> just doesn't happen nothing.
>
>
> why chdir? well mainly because it's what I found when was doing this
> code... for nothing at all :-) ; but well it seems to work nice... :-)


there is absoluetly no reason to chdir before opening a file.
Reply | Threaded
Open this post in threaded view
|

Re: New open source project (Postfix-qreject)

Egoitz Aurrekoetxea Aurre

>
>
> you're assuming too much. try
> # man chdir
> and look at the "ERRORS" section, and this will only give you info
> about one particular system.
>
> Always check the return value of system calls.
>    
> http://sunsite.uakom.sk/sunworldonline/swol-08-1998/swol-08-security.html
>

Ok I'll check it then; I was answering before... because perhaps you see
chdir is not apropiate there for some reason (and I wanted to know why,
just for learning :-) )... but I'll take this into account and will do
something with it :-)

Wietse I'm looking at

$dbh02->quote(

Thanks mates  ;-)

bye!!!



>
>
>> well... when postfix-qreject fails for whatever reason... postfix
>> return 4.3.5 Server Configuration Problem... so when mail were going
>> to enter to that recipient if it's listed in dirbuzon table and
>> maildir directory is wrong it should return a 4.3.5, because it's bad
>> entered in mysql table... but now in the other hand imagine that you
>> have some recipients wich are not listed in dirbuzon table... well
>> rejection at smtp time won't be working for them... postfix-qreject
>> won't check them... but there won't be any 4.3.5 or any error, when
>> that recipient not listed in dirbuzon table reaches it's quota limit,
>> mail will be queued with temporary failure : user is overquota...
>> so... if the a recipient exists but is not listed in dirbuzon
>> table... just doesn't happen nothing.
>>
>>
>> why chdir? well mainly because it's what I found when was doing this
>> code... for nothing at all :-) ; but well it seems to work nice... :-)
>
>
> there is absoluetly no reason to chdir before opening a file.
Well I suppose is one way for staying in the proper directory... just
one way...




Reply | Threaded
Open this post in threaded view
|

Re: New open source project (Postfix-qreject)

Wietse Venema
In reply to this post by Egoitz Aurrekoetxea Aurre
Egoitz Aurrekoetxea:
>
> > What should the program do if chdir() fails?
> >
> > Wietse
> >  
>
> Nothing specially I think perhaps is good to fail with a 4.3.5 error for
> admin to know something has happened with that row of dirbuzon table...

Then YOUR PROGRAM should examine the result from chdir().

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: New open source project (Postfix-qreject)

Egoitz Aurrekoetxea Aurre
Wietse Venema wrote:
Egoitz Aurrekoetxea:
  
What should the program do if chdir() fails?

	Wietse
  
      
Nothing specially I think perhaps is good to fail with a 4.3.5 error for 
admin to know something has happened with that row of dirbuzon table... 
    

Then YOUR PROGRAM should examine the result from chdir().

	Wietse
  
Hi mates :-)

Well I have fixed about the chdir call, and have done something like open(QF, '<', "$dirmaildir/$quotafile") or die $!; this way I don't need any chdir... and about dbh quote, nice idea Wietse :-)    I love doing and thinking in paranoid way :-)  this way the all a user can do or obtain is an empty set from mysql :-) :-)  very nice lol, I liked a lot that idea. I'm gonna check again and do some tests with this changes, and too  recheck all code to see if there's something more I think I should check his behaviour too, and on Monday or Tuesday (at most)  I'll upload changes.

Zenkzzzz!!!!!!!!!!!


Bye!!!
12