Mailing List Archive

Insert directly to mysql
Is there any documentation on what is actually inserted and created when the
dbmail-adduser program is ran. I would like to be able to add users via a
remote mysql connection and from what Ive seen of the db layout would is it
possible to just add the user,passwd and maxmail size via an insert
statement or is there additional info that should be added.

Thank You,
MM
Re: Insert directly to mysql [ In reply to ]
MBM> Is there any documentation on what is actually inserted and created when the
MBM> dbmail-adduser program is ran. I would like to be able to add users via a
MBM> remote mysql connection and from what Ive seen of the db layout would is it
MBM> possible to just add the user,passwd and maxmail size via an insert
MBM> statement or is there additional info that should be added.

The archives for the list should show several examples, posted about 2
weeks ago, of PHP code to do the required parts of adding a user. And
the mysql module of dbmail has all the insert statements.

If you use the MySQL interface to Postfix to control destination
domains as I do, you can add a domain to your mail server(s) with two
insert statements, as well. The first tells Postfix about it, the
second adds an alias to your postmaster account to the dbmail.aliases
table.

--
Best regards,
Jeff mailto:jeffb@espi.com
Re: Insert directly to mysql [ In reply to ]
Well i tried looking for the archives of dbmail but only found a raw archive
and jan/feb with a few threads. I have accomplished this through php by
just exec() the dbmail-adduser command righ now Im in the processes of
writing a vb front end that controls alot of other daemons running and want
to be able to supply a mysql insert statement that will insert whats needed.

Could you be kind and pass me the url of the archives if it is different
than than the raw archives so I may look through them.

Thank You,
MM
----- Original Message -----
From: "Jeff Brenton" <jeffb@espi.com>
To: "Michael B. McKinnon" <dbmail@dbmail.org>
Sent: Wednesday, March 06, 2002 12:29 AM
Subject: Re: [Dbmail] Insert directly to mysql


> MBM> Is there any documentation on what is actually inserted and created
when the
> MBM> dbmail-adduser program is ran. I would like to be able to add users
via a
> MBM> remote mysql connection and from what Ive seen of the db layout would
is it
> MBM> possible to just add the user,passwd and maxmail size via an insert
> MBM> statement or is there additional info that should be added.
>
> The archives for the list should show several examples, posted about 2
> weeks ago, of PHP code to do the required parts of adding a user. And
> the mysql module of dbmail has all the insert statements.
>
> If you use the MySQL interface to Postfix to control destination
> domains as I do, you can add a domain to your mail server(s) with two
> insert statements, as well. The first tells Postfix about it, the
> second adds an alias to your postmaster account to the dbmail.aliases
> table.
>
> --
> Best regards,
> Jeff mailto:jeffb@espi.com
>
> _______________________________________________
> Dbmail mailing list
> Dbmail@dbmail.org
> https://mailman.fastxs.nl/mailman/listinfo/dbmail
>
>
Re[2]: Insert directly to mysql [ In reply to ]
Here is the previously-posted response, from 28 January by Butch Evans:

You also have to create a mailbox. Here is what I use:
(PHP)
$query = "insert into user (userid,passwd,maxmail_size) ";
$query .= "values ('" . mysql_escape_string($login) . "',";
$query .= "'" . mysql_escape_string($password) . "',$mbsize)";
doinsert($query);

$uid = mysql_insert_id();
$query = "insert into aliases (alias,deliver_to,client_id) ";
$query .= "values ('" . mysql_escape_string($login) .
"@domain.com','$uid',0)";
doinsert($query);

$query = "insert into mailbox (owneridnr,name) values ($uid,'INBOX')";
doinsert($query);

$query = "insert into mailbox (owneridnr,name) values ($uid,'Sent')";
doinsert($query);

$query = "insert into mailbox (owneridnr,name) values ($uid,'Trash')";
doinsert($query);

(note that I also create a "Sent" and an "Trash" mailbox for my purposes)

--
Fight the Power
Dave Logan - Kentec Communications - Network Operations Center

"There is no right to fair use. Fair use is a defense against infringement."
- Preston Padden, head of government relations for Walt Disney Company

_______________________________________________
Dbmail mailing list
Dbmail@dbmail.org
https://mailman.fastxs.nl/mailman/listinfo/dbmail

--
Best regards,
Jeff mailto:jeffb@espi.com
Re: Re[2]: Insert directly to mysql [ In reply to ]
Thanks that should be a big help, I appreciate the repost.

MM
----- Original Message -----
From: "Jeff Brenton" <jeffb@espi.com>
To: "Michael B. McKinnon" <dbmail@dbmail.org>
Sent: Wednesday, March 06, 2002 12:52 AM
Subject: Re[2]: [Dbmail] Insert directly to mysql


> Here is the previously-posted response, from 28 January by Butch Evans:
>
> You also have to create a mailbox. Here is what I use:
> (PHP)
> $query = "insert into user (userid,passwd,maxmail_size) ";
> $query .= "values ('" . mysql_escape_string($login) . "',";
> $query .= "'" . mysql_escape_string($password) . "',$mbsize)";
> doinsert($query);
>
> $uid = mysql_insert_id();
> $query = "insert into aliases (alias,deliver_to,client_id) ";
> $query .= "values ('" . mysql_escape_string($login) .
> "@domain.com','$uid',0)";
> doinsert($query);
>
> $query = "insert into mailbox (owneridnr,name) values ($uid,'INBOX')";
> doinsert($query);
>
> $query = "insert into mailbox (owneridnr,name) values ($uid,'Sent')";
> doinsert($query);
>
> $query = "insert into mailbox (owneridnr,name) values ($uid,'Trash')";
> doinsert($query);
>
> (note that I also create a "Sent" and an "Trash" mailbox for my purposes)
>
> --
> Fight the Power
> Dave Logan - Kentec Communications - Network Operations Center
>
> "There is no right to fair use. Fair use is a defense against
infringement."
> - Preston Padden, head of government relations for Walt Disney Company
>
> _______________________________________________
> Dbmail mailing list
> Dbmail@dbmail.org
> https://mailman.fastxs.nl/mailman/listinfo/dbmail
>
> --
> Best regards,
> Jeff mailto:jeffb@espi.com
>
> _______________________________________________
> Dbmail mailing list
> Dbmail@dbmail.org
> https://mailman.fastxs.nl/mailman/listinfo/dbmail
>
>