disable LPART ...
dormant
+ giveaway LPART OWNER
help
list
new [-n COUNT] [-GENOPTS] [-RECOPTS] [RECIP]
my ($lpart, $expire, $recip, $comment) = @$r;
Odin::print_columns $lpart => 24, $recip => 32, $comment => 0;
}
+} elsif ($op eq "giveaway") {
+ @ARGV >= 2 or Odin::fail "usage: giveaway OWNER LPART ...";
+ my $owner = shift @ARGV;
+ my @l = @ARGV;
+ getpwnam $owner or Odin::fail "unknown user `$owner'";
+ my %r = (owner => $owner);
+ Odin::modify_redir $dom, %r, @l;
} elsif ($op eq "reserved") {
@ARGV and Odin::fail "usage: reserved";
for my $r (Odin::redir_query Odin::open_db, $dom, $Odin::WHO,
while (@l < $n) {
my $l = Odin::gen_redir_name $db, $gen;
insert_record $db, "odin_mailredir",
- lpart => $l, dom => $dom, owner => $WHO, st => 'live',
+ lpart => $l, dom => $dom, st => 'live',
+ owner => $WHO, creator => $WHO,
recip => $r->{recip} // qualify_recip $Odin::WHO,
expire => $r->{expire} // -1,
comment => $r->{comment} // "";
(lpart varchar(64) not null,
dom varchar(128) not null,
owner varchar(64) not null,
+ creator varchar(64) not null,
recip text not null default '',
expire bigint not null,
st varchar(16) not null default 'live',
--- /dev/null
+/* -*-sql-*-
+ *
+ * Plain old SQL for setting up the tables for Odin mail redirection.
+ */
+
+begin;
+alter table odin_mailredir add column creator varchar(64);
+update odin_mailredir set creator = owner where creator is null;
+alter table odin_mailredir alter column creator set not null;
+commit;