List Info

Thread: Re: dbmail-export




Re: dbmail-export
country flaguser name
Netherlands
2007-07-18 02:46:49
Aaron Stone wrote:
> On Tue, 2007-07-17 at 18:29 +0800, zamri wrote:
>>
>> On 7/16/07, Paul J Stevens <paulnfg.nl> wrote:
>>         Jorge Bastos wrote:
>>         > Aaron,
>>         >
>>         > My suggesting is never run without
one, at least one
>>         argument, for all,
>>         > i woul'd say "--all-users"
or "--all" or similar.
>>         > What do you thing? 
>>         > I'm not making this as a rule, just a
sugestiong, tell me
>>         what you think.
>>         
>>         I agree here. Exporting all should never
occur by accident.
>>
>> Yes. It shouldn't.  
>>
>> Suggestion:
>>
>> dbmail-export = dbmail-export --help =
dbmail-export -h
>>
>> Export all users: dbmail-export --all =
dbmail-export -a (with a
>> confirmation) = dbmail-export --all = dbmail-export
-ay (without
>> confirmation) = dbmail-export --all --yes 
> 
> Thanks, unfortunately this would change existing
behavior. I need to
> preserve the basic syntax:
> 
>   User foo all mailboxes:
>     dbmail-export -u foo
>   User foo mailbox box:
>     dbmail-export -u foo -m box
>   User foo mailbox box dumped into file file:
>     dbmail-export -u foo -m box -o file
> 
> Since I think being able to dump users by pattern is
very useful,
> (thanks for the suggestion, Geir!), and "-u
*" comes for free at that
> point, adding a separate -a/--all seems redundant.
> 
> Now we have the possibilities of:
> 
>   All users:
>     dbmail-export -u *
>   All users mailboxes named spam:
>     dbmail-export -u * -m spam
>   Users starting with 'fo' mailboxes named spam dumped
into a single
> giant mbox file (think spam training corpus!):
>     dbmail-export -u fo* -m spam -o fo_spam
> 
> It might have been nice to require "-m *" or
"-m * -r" to dump all
> mailboxes, but that would break the old behavior of
dumping everything
> for the user if you didn't give a mailbox name.
> 
> Does all this seem reasonable? Please poke holes in the
syntax if you
> find something that doesn't make sense!

Please show me a *single* unix command that uses an asterisk
in it's 
*commandline syntax* where the globbing is not shell
related.

dbmail-export -u * will simply not work because of the
shell. At the very least 
you'll have to use dbmail-export -u '*' which is plain silly
imo.

My vote goes to --all-users or something similarly verbose
rather than allowing 
regex or glob pattern in the users matching. If people want
to dump based on a 
pattern they can write very simple scripts to do it for
them: that's why I made 
the output of dbmail-users -l machine readable. I just don't
see the usecase 
where this is useful.

I'd say: kiss, or if you can't stop yourself from doing
this: keep it out of the 
2.2 branch until it is well tested.

-- 
  
____________________________________________________________
____
   Paul Stevens                                      paul at
nfg.nl
   NET FACILITIES GROUP                     GPG/PGP:
1024D/11F8CD31
   The Netherlands________________________________http://www.nfg.nl
_______________________________________________
DBmail mailing list
DBmaildbmail.org
htt
ps://mailman.fastxs.nl/mailman/listinfo/dbmail

Re: dbmail-export
country flaguser name
United States
2007-07-18 11:55:22
On Wed, Jul 18, 2007, Paul J Stevens <paulnfg.nl> said:

> Aaron Stone wrote:
>> On Tue, 2007-07-17 at 18:29 +0800, zamri wrote:
>>>
>>> On 7/16/07, Paul J Stevens <paulnfg.nl> wrote:
>>>         Jorge Bastos wrote:
>>>         > Aaron,
>>>         >
>>>         > My suggesting is never run without
one, at least one
>>>         argument, for all,
>>>         > i woul'd say
"--all-users" or "--all" or similar.
>>>         > What do you thing? 
>>>         > I'm not making this as a rule,
just a sugestiong, tell me
>>>         what you think.
>>>         
>>>         I agree here. Exporting all should
never occur by accident.
>>>
>>> Yes. It shouldn't.  
>>>
>>> Suggestion:
>>>
>>> dbmail-export = dbmail-export --help =
dbmail-export -h
>>>
>>> Export all users: dbmail-export --all =
dbmail-export -a (with a
>>> confirmation) = dbmail-export --all =
dbmail-export -ay (without
>>> confirmation) = dbmail-export --all --yes 
>> 
>> Thanks, unfortunately this would change existing
behavior. I need to
>> preserve the basic syntax:
>> 
>>   User foo all mailboxes:
>>     dbmail-export -u foo
>>   User foo mailbox box:
>>     dbmail-export -u foo -m box
>>   User foo mailbox box dumped into file file:
>>     dbmail-export -u foo -m box -o file
>> 
>> Since I think being able to dump users by pattern
is very useful,
>> (thanks for the suggestion, Geir!), and "-u
*" comes for free at that
>> point, adding a separate -a/--all seems redundant.
>> 
>> Now we have the possibilities of:
>> 
>>   All users:
>>     dbmail-export -u *
>>   All users mailboxes named spam:
>>     dbmail-export -u * -m spam
>>   Users starting with 'fo' mailboxes named spam
dumped into a single
>> giant mbox file (think spam training corpus!):
>>     dbmail-export -u fo* -m spam -o fo_spam
>> 
>> It might have been nice to require "-m *"
or "-m * -r" to dump all
>> mailboxes, but that would break the old behavior of
dumping everything
>> for the user if you didn't give a mailbox name.
>> 
>> Does all this seem reasonable? Please poke holes in
the syntax if you
>> find something that doesn't make sense!
> 
> Please show me a *single* unix command that uses an
asterisk in it's 
> *commandline syntax* where the globbing is not shell
related.
>
> dbmail-export -u * will simply not work because of the
shell. At the
> very least you'll have to use dbmail-export -u '*'
which is plain silly
> imo.

I agree that it wasn't such a hot choice of characters, but
we've got the
same in dbmail-users for matching aliases and forwards. So
at least almost
no new code.
 
> My vote goes to --all-users or something similarly
verbose rather than
> allowing regex or glob pattern in the users matching.
If people want to
> dump based on a pattern they can write very simple
scripts to do it for
> them: that's why I made the output of dbmail-users -l
machine readable. I
> just don't see the usecase where this is useful.

The number of people who have posted incorrect SQL to do
simple
maintenance tasks is worrying. I think we should include
correct code for
those tasks wherever possible.

> I'd say: kiss, or if you can't stop yourself from doing
this: keep it
> out of the 2.2 branch until it is well tested.

Frankly, I'm fairly pleased with the state of dbmail-export
now. I think
it now does everything that people have been writing awkward
scripts to do
for a while.

Aaron
_______________________________________________
DBmail mailing list
DBmaildbmail.org
htt
ps://mailman.fastxs.nl/mailman/listinfo/dbmail

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )