Maildrop deliver and quota work, but .mailfilter don't

View: New views
6 Messages — Rating Filter:   Alert me  

Maildrop deliver and quota work, but .mailfilter don't

by Num ber :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hello,

For begining i would like to excuse my self if my english is bad... i try to do the best and it's not enough..

I have a problem with maildrop, i use it for delivering mail and i have quota support, everything work exepting mail filter..

This is my configuration :

Every account was virtual (mysql) and in this directory :
/var/spool/postfix/virtual/domaine_name/account_name

-> eg : /var/spool/postfix/virtual/test.be/admin

This is my master.cf :
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -w 90 -d ${user}@${nexthop} ${extension} ${recipient} ${user} ${nexthop} ${sender}

-w 90 work for quota alert..

And i have this in main.cf :
virtual_transport = maildrop

Maildrop work fine :
[root@test admin]# maildrop -V9 -d admin@...
maildrop -V9 -d admin@...
maildrop: authlib: groupid=9000
maildrop: authlib: userid=9000
maildrop: authlib: logname=admin@..., home=/var/spool/postfix/virtual, mail=test.be/admin/
maildrop: Changing to /var/spool/postfix/virtual

I have a .mailfilter in /var/spool/postfix/virtual for everyone (i already read this .. )
and one in /var/spool/postfix/virtual/test.be/admin/ for admin user only

This is my /var/spool/postfix/virtual/test.be/admin/.mailfilter :

`test -d $HOME/.INBOX.LogWatch`

if ( $RETURNCODE == 1 )
{
    `maildirmake -f .INBOX.LogWatch $HOME/`
    `echo LogWatch>> $HOME/subscriptions`
}

if ( /^From: logwatch@.../ )
        to "$HOME/.INBOX.LogWatch"

And my /var/spool/postfix/virtual.mailfilter :

`[ -d $DEFAULT ] || (maildirmake $DEFAULT && maildirmake -f Spam $DEFAULT && maildirmake -f sent-mail $DEFAULT)`

`test -r $HOME/.mailfilter`

if( $RETURNCODE == 0 )
        {
        log "(==)  Including $HOME/.mailfilter"
                exception {
                        include $HOME/.mailfilter
                }
        }


But when it's enable mail never come even in INBOX ..

thanks for your help..



_________________________________________________________________
Changez votre Live en un clic !
http://get.live.com
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Courier-maildrop mailing list
Courier-maildrop@...
https://lists.sourceforge.net/lists/listinfo/courier-maildrop

Parent Message unknown Re: Maildrop deliver and quota work, but .mailfilter don't

by Num ber :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Sorry...

I reply to fast, it log but they never include .mailfilter because $HOME don't go to the user maildir :

(==) /var/spool/postfix/virtual
(==)  Including /var/spool/postfix/virtual/.mailfilter

$HOME = /var/spool/postfix/virtual/

What i need to use for they search in /var/spool/postfix/virtual/domaine/user/

yes.


----------------------------------------

> Date: Wed, 19 Mar 2008 08:35:46 -0300
> From: fcatunda@...
> To: number_85_@...
> Subject: Re: [maildropl] Maildrop deliver and quota work, but .mailfilter don't
>
> Your /var/spool/postfix/virtual/.mailfilter is including the user
> .mailfilter?
>
> Try to log step-by-step what is happening, log the result of your "ifs"
> to be sure that thos conditions are beeing satisfied.
>
> Your instalation looks fine to me, maybe you just mismatched some little
> thing!
>
> []'s, FMC!
>
> Num ber escreveu:
>> Hello,
>>
>> For begining i would like to excuse my self if my english is bad... i try to do the best and it's not enough..
>>
>> I have a problem with maildrop, i use it for delivering mail and i have quota support, everything work exepting mail filter..
>>
>> This is my configuration :
>>
>> Every account was virtual (mysql) and in this directory :
>> /var/spool/postfix/virtual/domaine_name/account_name
>>
>> -> eg : /var/spool/postfix/virtual/test.be/admin
>>
>> This is my master.cf :
>> maildrop  unix  -       n       n       -       -       pipe
>>   flags=DRhu user=vmail argv=/usr/bin/maildrop -w 90 -d ${user}@${nexthop} ${extension} ${recipient} ${user} ${nexthop} ${sender}
>>
>> -w 90 work for quota alert..
>>
>> And i have this in main.cf :
>> virtual_transport = maildrop
>>
>> Maildrop work fine :
>> [root@test admin]# maildrop -V9 -d admin@...
>> maildrop -V9 -d admin@...
>> maildrop: authlib: groupid=9000
>> maildrop: authlib: userid=9000
>> maildrop: authlib: logname=admin@..., home=/var/spool/postfix/virtual, mail=test.be/admin/
>> maildrop: Changing to /var/spool/postfix/virtual
>>
>> I have a .mailfilter in /var/spool/postfix/virtual for everyone (i already read this .. )
>> and one in /var/spool/postfix/virtual/test.be/admin/ for admin user only
>>
>> This is my /var/spool/postfix/virtual/test.be/admin/.mailfilter :
>>
>> `test -d $HOME/.INBOX.LogWatch`
>>
>> if ( $RETURNCODE == 1 )
>> {
>>     `maildirmake -f .INBOX.LogWatch $HOME/`
>>     `echo LogWatch>> $HOME/subscriptions`
>> }
>>
>> if ( /^From: logwatch@.../ )
>>         to "$HOME/.INBOX.LogWatch"
>>
>> And my /var/spool/postfix/virtual.mailfilter :
>>
>> `[ -d $DEFAULT ] || (maildirmake $DEFAULT && maildirmake -f Spam $DEFAULT && maildirmake -f sent-mail $DEFAULT)`
>>
>> `test -r $HOME/.mailfilter`
>>
>> if( $RETURNCODE == 0 )
>>         {
>>         log "(==)  Including $HOME/.mailfilter"
>>                 exception {
>>                         include $HOME/.mailfilter
>>                 }
>>         }
>>
>>
>> But when it's enable mail never come even in INBOX ..
>>
>> thanks for your help..
>>
>>
>>
>> _________________________________________________________________
>> Changez votre Live en un clic !
>> http://get.live.com
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________
>> Courier-maildrop mailing list
>> Courier-maildrop@...
>> https://lists.sourceforge.net/lists/listinfo/courier-maildrop
>>  
>

_________________________________________________________________
Envoyez vos voeux de façon originale grâce aux nombreuses solutions de Windows Live !
http://get.live.com
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Courier-maildrop mailing list
Courier-maildrop@...
https://lists.sourceforge.net/lists/listinfo/courier-maildrop

Re: Maildrop deliver and quota work, but .mailfilter don't

by "Fábio M. Catunda"-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

That's what I thought, I had this problem too!

To solve it, I just put an include line in
/var/spool/postfix/virtual/.mailfilter with some parameters, something
like this:

/^Delivered-To:.*/
getaddr($MATCH) =~ /^.*/;
MAILADDR = tolower($MATCH)
USER = `/bin/echo $MAILADDR | /usr/bin/cut -f1 -d'@'`
DOMAIN = `/bin/echo $MAILADDR | /usr/bin/cut -f2 -d'@'`

include "/var/virtual/$DOMAIN/$USER/.mailfilter"

The tolower() is optional and break the mail RFC, but I like it couse it
avoid the creation of - for exemple - an UsEr maildir!

I'm using postfix, thats why I search for "Delivered-To" and not
Envelope-To or something like this!

Probably there is a way to find USER and DOMAIN with some maildrop
regexp, but I'm no very good with it!

[]'s, FMC!

Num ber escreveu:

> Sorry...
>
> I reply to fast, it log but they never include .mailfilter because $HOME don't go to the user maildir :
>
> (==) /var/spool/postfix/virtual
> (==)  Including /var/spool/postfix/virtual/.mailfilter
>
> $HOME = /var/spool/postfix/virtual/
>
> What i need to use for they search in /var/spool/postfix/virtual/domaine/user/
>
> yes.
>
>
> ----------------------------------------
>  
>> Date: Wed, 19 Mar 2008 08:35:46 -0300
>> From: fcatunda@...
>> To: number_85_@...
>> Subject: Re: [maildropl] Maildrop deliver and quota work, but .mailfilter don't
>>
>> Your /var/spool/postfix/virtual/.mailfilter is including the user
>> .mailfilter?
>>
>> Try to log step-by-step what is happening, log the result of your "ifs"
>> to be sure that thos conditions are beeing satisfied.
>>
>> Your instalation looks fine to me, maybe you just mismatched some little
>> thing!
>>
>> []'s, FMC!
>>
>> Num ber escreveu:
>>    
>>> Hello,
>>>
>>> For begining i would like to excuse my self if my english is bad... i try to do the best and it's not enough..
>>>
>>> I have a problem with maildrop, i use it for delivering mail and i have quota support, everything work exepting mail filter..
>>>
>>> This is my configuration :
>>>
>>> Every account was virtual (mysql) and in this directory :
>>> /var/spool/postfix/virtual/domaine_name/account_name
>>>
>>> -> eg : /var/spool/postfix/virtual/test.be/admin
>>>
>>> This is my master.cf :
>>> maildrop  unix  -       n       n       -       -       pipe
>>>   flags=DRhu user=vmail argv=/usr/bin/maildrop -w 90 -d ${user}@${nexthop} ${extension} ${recipient} ${user} ${nexthop} ${sender}
>>>
>>> -w 90 work for quota alert..
>>>
>>> And i have this in main.cf :
>>> virtual_transport = maildrop
>>>
>>> Maildrop work fine :
>>> [root@test admin]# maildrop -V9 -d admin@...
>>> maildrop -V9 -d admin@...
>>> maildrop: authlib: groupid=9000
>>> maildrop: authlib: userid=9000
>>> maildrop: authlib: logname=admin@..., home=/var/spool/postfix/virtual, mail=test.be/admin/
>>> maildrop: Changing to /var/spool/postfix/virtual
>>>
>>> I have a .mailfilter in /var/spool/postfix/virtual for everyone (i already read this .. )
>>> and one in /var/spool/postfix/virtual/test.be/admin/ for admin user only
>>>
>>> This is my /var/spool/postfix/virtual/test.be/admin/.mailfilter :
>>>
>>> `test -d $HOME/.INBOX.LogWatch`
>>>
>>> if ( $RETURNCODE == 1 )
>>> {
>>>     `maildirmake -f .INBOX.LogWatch $HOME/`
>>>     `echo LogWatch>> $HOME/subscriptions`
>>> }
>>>
>>> if ( /^From: logwatch@.../ )
>>>         to "$HOME/.INBOX.LogWatch"
>>>
>>> And my /var/spool/postfix/virtual.mailfilter :
>>>
>>> `[ -d $DEFAULT ] || (maildirmake $DEFAULT && maildirmake -f Spam $DEFAULT && maildirmake -f sent-mail $DEFAULT)`
>>>
>>> `test -r $HOME/.mailfilter`
>>>
>>> if( $RETURNCODE == 0 )
>>>         {
>>>         log "(==)  Including $HOME/.mailfilter"
>>>                 exception {
>>>                         include $HOME/.mailfilter
>>>                 }
>>>         }
>>>
>>>
>>> But when it's enable mail never come even in INBOX ..
>>>
>>> thanks for your help..
>>>
>>>
>>>
>>> _________________________________________________________________
>>> Changez votre Live en un clic !
>>> http://get.live.com
>>> -------------------------------------------------------------------------
>>> This SF.net email is sponsored by: Microsoft
>>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>> _______________________________________________
>>> Courier-maildrop mailing list
>>> Courier-maildrop@...
>>> https://lists.sourceforge.net/lists/listinfo/courier-maildrop
>>>  
>>>      
>
> _________________________________________________________________
> Envoyez vos voeux de façon originale grâce aux nombreuses solutions de Windows Live !
> http://get.live.com
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Courier-maildrop mailing list
> Courier-maildrop@...
> https://lists.sourceforge.net/lists/listinfo/courier-maildrop
>  


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Courier-maildrop mailing list
Courier-maildrop@...
https://lists.sourceforge.net/lists/listinfo/courier-maildrop

Re: Maildrop deliver and quota work, but .mailfilter don't

by Num ber :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
I just finish to work,

I try with log to watch what goes wrong..

I now have this :

(==) ok
(==)  Including /var/spool/postfix/virtual/soez.be/administrateur/.mailfilter

They found the .mailfilter, but they never include the file..

logfile maildrop.log

`[ -d $DEFAULT ] || (maildirmake $DEFAULT && maildirmake -f Spam $DEFAULT && maildirmake -f sent-mail $DEFAULT)`

`test -r $HOME/$DEFAULT.mailfilter`

log "(==) ok"

if( $RETURNCODE == 0 )
        {
        log "(==)  Including $HOME/$DEFAULT.mailfilter"
                exception {
                        include $HOME/$DEFAULT.mailfilter
                }
        }


et per user .mailfilter :

logfile maildrop.log

log "(==) include"

`test -d $HOME/$DEFAULT.INBOX.LogWatch

if ( $RETURNCODE == 1 )
{
    `maildirmake -f .INBOX.LogWatch $DEFAULT`
    `echo LogWatch >> $DEFAULT/subscriptions`
    log "Logwatch dpon't exist"
}

if ( /^From: logwatch@.../ ) {
        to "$DEFAULT/.INBOX.LogWatch"
        log moved"
}



Thanks for your help !!!



> Date: Wed, 19 Mar 2008 09:40:23 -0300

> From: fcatunda@...
> To: courier-maildrop@...
> Subject: Re: [maildropl] Maildrop deliver and quota work, but .mailfilter don't
>
> That's what I thought, I had this problem too!
>
> To solve it, I just put an include line in
> /var/spool/postfix/virtual/.mailfilter with some parameters, something
> like this:
>
> /^Delivered-To:.*/
> getaddr($MATCH) =~ /^.*/;
> MAILADDR = tolower($MATCH)
> USER = `/bin/echo $MAILADDR | /usr/bin/cut -f1 -d'@'`
> DOMAIN = `/bin/echo $MAILADDR | /usr/bin/cut -f2 -d'@'`
>
> include "/var/virtual/$DOMAIN/$USER/.mailfilter"
>
> The tolower() is optional and break the mail RFC, but I like it couse it
> avoid the creation of - for exemple - an UsEr maildir!
>
> I'm using postfix, thats why I search for "Delivered-To" and not
> Envelope-To or something like this!
>
> Probably there is a way to find USER and DOMAIN with some maildrop
> regexp, but I'm no very good with it!
>
> []'s, FMC!
>
> Num ber escreveu:
> > Sorry...
> >
> > I reply to fast, it log but they never include .mailfilter because $HOME don't go to the user maildir :
> >
> > (==) /var/spool/postfix/virtual
> > (==) Including /var/spool/postfix/virtual/.mailfilter
> >
> > $HOME = /var/spool/postfix/virtual/
> >
> > What i need to use for they search in /var/spool/postfix/virtual/domaine/user/
> >
> > yes.
> >
> >
> > ----------------------------------------
> >
> >> Date: Wed, 19 Mar 2008 08:35:46 -0300
> >> From: fcatunda@...
> >> To: number_85_@...
> >> Subject: Re: [maildropl] Maildrop deliver and quota work, but .mailfilter don't
> >>
> >> Your /var/spool/postfix/virtual/.mailfilter is including the user
> >> .mailfilter?
> >>
> >> Try to log step-by-step what is happening, log the result of your "ifs"
> >> to be sure that thos conditions are beeing satisfied.
> >>
> >> Your instalation looks fine to me, maybe you just mismatched some little
> >> thing!
> >>
> >> []'s, FMC!
> >>
> >> Num ber escreveu:
> >>
> >>> Hello,
> >>>
> >>> For begining i would like to excuse my self if my english is bad... i try to do the best and it's not enough..
> >>>
> >>> I have a problem with maildrop, i use it for delivering mail and i have quota support, everything work exepting mail filter..
> >>>
> >>> This is my configuration :
> >>>
> >>> Every account was virtual (mysql) and in this directory :
> >>> /var/spool/postfix/virtual/domaine_name/account_name
> >>>
> >>> -> eg : /var/spool/postfix/virtual/test.be/admin
> >>>
> >>> This is my master.cf :
> >>> maildrop unix - n n - - pipe
> >>> flags=DRhu user=vmail argv=/usr/bin/maildrop -w 90 -d ${user}@${nexthop} ${extension} ${recipient} ${user} ${nexthop} ${sender}
> >>>
> >>> -w 90 work for quota alert..
> >>>
> >>> And i have this in main.cf :
> >>> virtual_transport = maildrop
> >>>
> >>> Maildrop work fine :
> >>> [root@test admin]# maildrop -V9 -d admin@...
> >>> maildrop -V9 -d admin@...
> >>> maildrop: authlib: groupid=9000
> >>> maildrop: authlib: userid=9000
> >>> maildrop: authlib: logname=admin@..., home=/var/spool/postfix/virtual, mail=test.be/admin/
> >>> maildrop: Changing to /var/spool/postfix/virtual
> >>>
> >>> I have a .mailfilter in /var/spool/postfix/virtual for everyone (i already read this .. )
> >>> and one in /var/spool/postfix/virtual/test.be/admin/ for admin user only
> >>>
> >>> This is my /var/spool/postfix/virtual/test.be/admin/.mailfilter :
> >>>
> >>> `test -d $HOME/.INBOX.LogWatch`
> >>>
> >>> if ( $RETURNCODE == 1 )
> >>> {
> >>> `maildirmake -f .INBOX.LogWatch $HOME/`
> >>> `echo LogWatch>> $HOME/subscriptions`
> >>> }
> >>>
> >>> if ( /^From: logwatch@.../ )
> >>> to "$HOME/.INBOX.LogWatch"
> >>>
> >>> And my /var/spool/postfix/virtual.mailfilter :
> >>>
> >>> `[ -d $DEFAULT ] || (maildirmake $DEFAULT && maildirmake -f Spam $DEFAULT && maildirmake -f sent-mail $DEFAULT)`
> >>>
> >>> `test -r $HOME/.mailfilter`
> >>>
> >>> if( $RETURNCODE == 0 )
> >>> {
> >>> log "(==) Including $HOME/.mailfilter"
> >>> exception {
> >>> include $HOME/.mailfilter
> >>> }
> >>> }
> >>>
> >>>
> >>> But when it's enable mail never come even in INBOX ..
> >>>
> >>> thanks for your help..
> >>>
> >>>
> >>>
> >>> _________________________________________________________________
> >>> Changez votre Live en un clic !
> >>> http://get.live.com
> >>> -------------------------------------------------------------------------
> >>> This SF.net email is sponsored by: Microsoft
> >>> Defy all challenges. Microsoft(R) Visual Studio 2008.
> >>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> >>> _______________________________________________
> >>> Courier-maildrop mailing list
> >>> Courier-maildrop@...
> >>> https://lists.sourceforge.net/lists/listinfo/courier-maildrop
> >>>
> >>>
> >
> > _________________________________________________________________
> > Envoyez vos voeux de façon originale grâce aux nombreuses solutions de Windows Live !
> > http://get.live.com
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by: Microsoft
> > Defy all challenges. Microsoft(R) Visual Studio 2008.
> > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> > _______________________________________________
> > Courier-maildrop mailing list
> > Courier-maildrop@...
> > https://lists.sourceforge.net/lists/listinfo/courier-maildrop
> >
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Courier-maildrop mailing list
> Courier-maildrop@...
> https://lists.sourceforge.net/lists/listinfo/courier-maildrop


Les partager, au lieu de les laisser au fin fond d'un fichier... Qu'allez-vous faire de vos photos ?
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Courier-maildrop mailing list
Courier-maildrop@...
https://lists.sourceforge.net/lists/listinfo/courier-maildrop

Parent Message unknown Re: Maildrop deliver and quota work, but .mailfilter don't

by Num ber :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Thanks,

But, that don't work, i don't understand :

`test -r $DEFAULT.mailfilter`

if( $RETURNCODE == 0 )
        {
        log "(==)  Including $HOME/$DEFAULT.mailfilter"
}

And on the log file "(==) Including ..." was write, it means he pass the test...
If he pass the test why they don't include file ?

The file exist, and have read permission...

I realy don't understand...


----------------------------------------

> Date: Wed, 19 Mar 2008 15:25:47 -0300
> From: fcatunda@...
> To: number_85_@...
> Subject: Re: [maildropl] Maildrop deliver and quota work,  but .mailfilter don't
>
> Thats pretty weird.
>
> Anyway, maybe... I'm telling JUST MAYBE ... maildrop might be running in
> a chroot jail together with postfix, in this case the correct path is
> just /virtual/soez/administrateur/
>
> Try to include with this path!
>
> Good luck!
>
> Num ber escreveu:
>> I just finish to work,
>>
>> I try with log to watch what goes wrong..
>>
>> I now have this :
>>
>> (==) ok
>> (==)  Including
>> /var/spool/postfix/virtual/soez.be/administrateur/.mailfilter
>>
>> They found the .mailfilter, but they never include the file..
>>
>> logfile maildrop.log
>>
>> `[ -d $DEFAULT ] || (maildirmake $DEFAULT && maildirmake -f Spam
>> $DEFAULT && maildirmake -f sent-mail $DEFAULT)`
>>
>> `test -r $HOME/$DEFAULT.mailfilter`
>>
>> log "(==) ok"
>>
>> if( $RETURNCODE == 0 )
>>         {
>>         log "(==)  Including $HOME/$DEFAULT.mailfilter"
>>                 exception {
>>                         include $HOME/$DEFAULT.mailfilter
>>                 }
>>         }
>>
>>
>> et per user .mailfilter :
>>
>> logfile maildrop.log
>>
>> log "(==) include"
>>
>> `test -d $HOME/$DEFAULT.INBOX.LogWatch
>>
>> if ( $RETURNCODE == 1 )
>> {
>>     `maildirmake -f .INBOX.LogWatch $DEFAULT`
>>     `echo LogWatch>> $DEFAULT/subscriptions`
>>     log "Logwatch dpon't exist"
>> }
>>
>> if ( /^From: logwatch@.../ ) {
>>         to "$DEFAULT/.INBOX.LogWatch"
>>         log moved"
>> }
>>
>>
>>
>> Thanks for your help !!!
>>
>>
>> ------------------------------------------------------------------------
>>> Date: Wed, 19 Mar 2008 09:40:23 -0300
>>> From: fcatunda@...
>>> To: courier-maildrop@...
>>> Subject: Re: [maildropl] Maildrop deliver and quota work, but
>> .mailfilter don't
>>>
>>> That's what I thought, I had this problem too!
>>>
>>> To solve it, I just put an include line in
>>> /var/spool/postfix/virtual/.mailfilter with some parameters, something
>>> like this:
>>>
>>> /^Delivered-To:.*/
>>> getaddr($MATCH) =~ /^.*/;
>>> MAILADDR = tolower($MATCH)
>>> USER = `/bin/echo $MAILADDR | /usr/bin/cut -f1 -d'@'`
>>> DOMAIN = `/bin/echo $MAILADDR | /usr/bin/cut -f2 -d'@'`
>>>
>>> include "/var/virtual/$DOMAIN/$USER/.mailfilter"
>>>
>>> The tolower() is optional and break the mail RFC, but I like it
>> couse it
>>> avoid the creation of - for exemple - an UsEr maildir!
>>>
>>> I'm using postfix, thats why I search for "Delivered-To" and not
>>> Envelope-To or something like this!
>>>
>>> Probably there is a way to find USER and DOMAIN with some maildrop
>>> regexp, but I'm no very good with it!
>>>
>>> []'s, FMC!
>>>
>>> Num ber escreveu:
>>>> Sorry...
>>>>
>>>> I reply to fast, it log but they never include .mailfilter because
>> $HOME don't go to the user maildir :
>>>>
>>>> (==) /var/spool/postfix/virtual
>>>> (==) Including /var/spool/postfix/virtual/.mailfilter
>>>>
>>>> $HOME = /var/spool/postfix/virtual/
>>>>
>>>> What i need to use for they search in
>> /var/spool/postfix/virtual/domaine/user/
>>>>
>>>> yes.
>>>>
>>>>
>>>> ----------------------------------------
>>>>
>>>>> Date: Wed, 19 Mar 2008 08:35:46 -0300
>>>>> From: fcatunda@...
>>>>> To: number_85_@...
>>>>> Subject: Re: [maildropl] Maildrop deliver and quota work, but
>> .mailfilter don't
>>>>>
>>>>> Your /var/spool/postfix/virtual/.mailfilter is including the user
>>>>> .mailfilter?
>>>>>
>>>>> Try to log step-by-step what is happening, log the result of your
>> "ifs"
>>>>> to be sure that thos conditions are beeing satisfied.
>>>>>
>>>>> Your instalation looks fine to me, maybe you just mismatched some
>> little
>>>>> thing!
>>>>>
>>>>> []'s, FMC!
>>>>>
>>>>> Num ber escreveu:
>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> For begining i would like to excuse my self if my english is
>> bad... i try to do the best and it's not enough..
>>>>>>
>>>>>> I have a problem with maildrop, i use it for delivering mail and
>> i have quota support, everything work exepting mail filter..
>>>>>>
>>>>>> This is my configuration :
>>>>>>
>>>>>> Every account was virtual (mysql) and in this directory :
>>>>>> /var/spool/postfix/virtual/domaine_name/account_name
>>>>>>
>>>>>> -> eg : /var/spool/postfix/virtual/test.be/admin
>>>>>>
>>>>>> This is my master.cf :
>>>>>> maildrop unix - n n - - pipe
>>>>>> flags=DRhu user=vmail argv=/usr/bin/maildrop -w 90 -d
>> ${user}@${nexthop} ${extension} ${recipient} ${user} ${nexthop} ${sender}
>>>>>>
>>>>>> -w 90 work for quota alert..
>>>>>>
>>>>>> And i have this in main.cf :
>>>>>> virtual_transport = maildrop
>>>>>>
>>>>>> Maildrop work fine :
>>>>>> [root@test admin]# maildrop -V9 -d admin@...
>>>>>> maildrop -V9 -d admin@...
>>>>>> maildrop: authlib: groupid=9000
>>>>>> maildrop: authlib: userid=9000
>>>>>> maildrop: authlib: logname=admin@...,
>> home=/var/spool/postfix/virtual, mail=test.be/admin/
>>>>>> maildrop: Changing to /var/spool/postfix/virtual
>>>>>>
>>>>>> I have a .mailfilter in /var/spool/postfix/virtual for everyone
>> (i already read this .. )
>>>>>> and one in /var/spool/postfix/virtual/test.be/admin/ for admin
>> user only
>>>>>>
>>>>>> This is my /var/spool/postfix/virtual/test.be/admin/.mailfilter :
>>>>>>
>>>>>> `test -d $HOME/.INBOX.LogWatch`
>>>>>>
>>>>>> if ( $RETURNCODE == 1 )
>>>>>> {
>>>>>> `maildirmake -f .INBOX.LogWatch $HOME/`
>>>>>> `echo LogWatch>> $HOME/subscriptions`
>>>>>> }
>>>>>>
>>>>>> if ( /^From: logwatch@.../ )
>>>>>> to "$HOME/.INBOX.LogWatch"
>>>>>>
>>>>>> And my /var/spool/postfix/virtual.mailfilter :
>>>>>>
>>>>>> `[ -d $DEFAULT ] || (maildirmake $DEFAULT && maildirmake -f Spam
>> $DEFAULT && maildirmake -f sent-mail $DEFAULT)`
>>>>>>
>>>>>> `test -r $HOME/.mailfilter`
>>>>>>
>>>>>> if( $RETURNCODE == 0 )
>>>>>> {
>>>>>> log "(==) Including $HOME/.mailfilter"
>>>>>> exception {
>>>>>> include $HOME/.mailfilter
>>>>>> }
>>>>>> }
>>>>>>
>>>>>>
>>>>>> But when it's enable mail never come even in INBOX ..
>>>>>>
>>>>>> thanks for your help..
>>>>>>
>>>>>>
>>>>>>
>>>>>> _________________________________________________________________
>>>>>> Changez votre Live en un clic !
>>>>>> http://get.live.com
>>>>>>
>> -------------------------------------------------------------------------
>>>>>> This SF.net email is sponsored by: Microsoft
>>>>>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>>>>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>>>>> _______________________________________________
>>>>>> Courier-maildrop mailing list
>>>>>> Courier-maildrop@...
>>>>>> https://lists.sourceforge.net/lists/listinfo/courier-maildrop
>>>>>>
>>>>>>
>>>>
>>>> _________________________________________________________________
>>>> Envoyez vos voeux de façon originale grâce aux nombreuses
>> solutions de Windows Live !
>>>> http://get.live.com
>>>>
>> -------------------------------------------------------------------------
>>>> This SF.net email is sponsored by: Microsoft
>>>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>>> _______________________________________________
>>>> Courier-maildrop mailing list
>>>> Courier-maildrop@...
>>>> https://lists.sourceforge.net/lists/listinfo/courier-maildrop
>>>>
>>>
>>>
>>>
>> -------------------------------------------------------------------------
>>> This SF.net email is sponsored by: Microsoft
>>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>>> _______________________________________________
>>> Courier-maildrop mailing list
>>> Courier-maildrop@...
>>> https://lists.sourceforge.net/lists/listinfo/courier-maildrop
>>
>> ------------------------------------------------------------------------
>> Les partager, au lieu de les laisser au fin fond d'un fichier...
>> Qu'allez-vous faire de vos photos ?
>> ------------------------------------------------------------------------
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Courier-maildrop mailing list
>> Courier-maildrop@...
>> https://lists.sourceforge.net/lists/listinfo/courier-maildrop
>>  
>

_________________________________________________________________
Changez votre Live en un clic !
http://get.live.com
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Courier-maildrop mailing list
Courier-maildrop@...
https://lists.sourceforge.net/lists/listinfo/courier-maildrop

Parent Message unknown Re: Maildrop deliver and quota work, but .mailfilter don't

by Num ber :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


After some test :

This is my .mailfilter in /var/spool/postfix/virtual/

___________________________________________________________________
logfile maildrop.log

`[ -d $DEFAULT ] || (maildirmake $DEFAULT && maildirmake -f Spam $DEFAULT && maildirmake -f sent-mail $DEFAULT)`


TEST = `pwd`

log "(==) $TEST"
log "(==) $HOME"
log "(==) $DEFAULT"

`test -r $DEFAULT.mailfilter`

log "(==) $RETURNCODE "

if( $RETURNCODE == 0 )
        {

        log "(==)  Including $DEFAULT.mailfilter"

                exception {
                        include $DEFAULT.mailfilter
                }

        }
______________________________________________________________________

The right :
[root@soez virtual]# ls -la
total 80
drwxr-xr-x  3 vmail vmail  4096 mar 20 10:48 .
drwxr-xr-x 17 root  root   4096 jan 18 16:26 ..
-rw-------  1 vmail vmail 18164 mar 20 10:39 maildrop.log
-rw-------  1 vmail vmail   457 mar 20 10:22 .mailfilter
drwx------  4 vmail vmail  4096 jan 21 16:47 domaine

And my per user .mailfilter in /var/spool/postfix/virtual/domaine/user/.mailfiter

_______________________________________________________________________
logfile maildroperso.log

log "(==) included"

`test -d $HOME/$DEFAULT.INBOX.LogWatch

if ( $RETURNCODE == 1 )
{
    `maildirmake -f .INBOX.LogWatch $DEFAULT`
    `echo LogWatch>> $DEFAULT/subscriptions`
}

if ( /^From: logwatch@.../ ) {
        to "$DEFAULT/.INBOX.LogWatch"
        log "On change"
}
_______________________________________________________________________

When i send a mail, the general .mailfiter is read and on the logfile(maildrop.log ) i have this :

(==) /var/spool/postfix/virtual                     # The pwd path
(==) /var/spool/postfix/virtual                     # $HOME path
(==) soez.be/administrateur/                     # $DEFAULT path
(==) 0                                                           # $RETURNCODE of test -r domaine/administrateur/.mailfilter
(==)  Including domaine/user/.mailfilter     #A test to see if they pass the test
 
After that i know they found the per user .mailfiter who have this right :

[root@soez virtual]# ls -la domaine/user/
total 220
drwx------ 9 vmail vmail  4096 mar 20 10:26 .
drwx------ 4 vmail vmail  4096 jan 21 16:47 ..
drwx------ 2 vmail vmail 12288 mar 20 10:25 cur
-rw------- 1 vmail vmail   204 mar 20 10:25 dovecot.index
-rw------- 1 vmail vmail 29696 mar 20 10:25 dovecot.index.cache
-rw------- 1 vmail vmail 55748 mar 20 10:26 dovecot.index.log
-rw------- 1 vmail vmail   544 mar 20 10:25 dovecot-uidlist
drwx------ 5 vmail vmail  4096 jan 17 17:03 .Drafts
drwx------ 5 vmail vmail  4096 mar 20 10:22 .Junk
-rw-r----- 1 vmail vmail  3704 mar 20 10:25 maildirsize
-rw------- 1 vmail vmail   307 mar 20 10:25 .mailfilter                       <--------
drwx------ 2 vmail vmail  4096 mar 20 10:25 new
drwx------ 5 vmail vmail  4096 fév 27 10:19 .Sent
-rw------- 1 vmail vmail    29 mar 19 13:18 subscriptions
drwx------ 2 vmail vmail  4096 mar 20 10:25 tmp
drwx------ 5 vmail vmail  4096 mar 20 10:26 .Trash

I try to log anything from the per user .mailfiter but i can't...

Maildrop ignore the file ?
Or maybe the include was't correct ?

maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -w 90 -d ${user}@${nexthop} ${extension} ${recipient} ${user} ${nexthop} ${sender}


I don't need -m or -M flag ?

Thanks for your help if thing we are on the good way...



_________________________________________________________________
Vous partez ? Emmenez vos amis avec vous !
http://www.windowslivemobile.msn.com/nl-be
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Courier-maildrop mailing list
Courier-maildrop@...
https://lists.sourceforge.net/lists/listinfo/courier-maildrop
LightInTheBox - Buy quality products at wholesale price!