Extension development
Programmatic creation of local user account

Thanks.

The download is here:

http://community.pmail.com/files/folders/community_add-ons_for_mercury/entry30031.aspx

<P>Thanks. </P> <P>The download is here:</P> <P><A title="VBA functions for administration of Mercury/32" href="http://community.pmail.com/files/folders/community_add-ons_for_mercury/entry30031.aspx" mce_href="/files/folders/community_add-ons_for_mercury/entry30031.aspx">http://community.pmail.com/files/folders/community_add-ons_for_mercury/entry30031.aspx</A></P>

Hi everyone, I just recently setup for the first time setup Mercury 32's IMAP server. So far so good as I have "some" experience with mail servers and it seems to be working fine. I do a lot of software development and after googling for a couple hours could find no insight as to how one would go about pro-grammatically creating user accounts in Mercury 32. I haven't the slightest idea of how Mercury stores user account information on the back-end so I have come here to the official Mercury forum to find out if anyone has any ideas on how I could go about doing this. Thanks in advance for any responses!

Hi everyone, I just recently setup for the first time setup Mercury 32's IMAP server. So far so good as I have "some" experience with mail servers and it seems to be working fine. I do a lot of software development and after googling for a couple hours could find no insight as to how one would go about pro-grammatically creating user accounts in Mercury 32. I haven't the slightest idea of how Mercury stores user account information on the back-end so I have come here to the official Mercury forum to find out if anyone has any ideas on how I could go about doing this. Thanks in advance for any responses!

Peter has shared some code for how to interact programmatically with Mercury user accounts here:

http://community.pmail.com/files/folders/codesnippets/entry167.aspx

/Rolf

<p>Peter has shared some code for how to interact programmatically with Mercury user accounts here:</p><p>http://community.pmail.com/files/folders/codesnippets/entry167.aspx</p><p>/Rolf </p>

Thanks Peter, I'm not familiar with Delphi Pascal but can understand bits and pieces of the code. I'll take a closer look and let you know if I get stuck on something.

EDIT: I can see the code creates accounts but was wondering if a restart of Mercury was necessary for the new users to be added after the script completes.

<p>Thanks Peter, I'm not familiar with Delphi Pascal but can understand bits and pieces of the code. I'll take a closer look and let you know if I get stuck on something.</p><p>EDIT: I can see the code creates accounts but was wondering if a restart of Mercury was necessary for the new users to be added after the script completes. </p>

Mercury will need re-read the user list. You can do this by writing a message file in the queue directory with a command to maiser (the built-in mail server account).

The file should have the filename extention .101 and start with:

$$ admin@domain.com
maiser@domain.com

and a blank line.

The message should be:

PASSWORD mypassword
RELOAD USERS
EXIT

/Rolf 


<div style="font-family: Arial,Helvetica,sans-serif; font-size: 10pt; background-color: rgb(255, 255, 255); padding: 8px;"> <p>Mercury will need re-read the user list. You can do this by writing a message file in the queue directory with a command to maiser (the built-in mail server account).</p> <p>The file should have the filename extention .101 and start with:</p> <blockquote><i>$$ admin@domain.com maiser@domain.com </i></blockquote><p> and a blank line. </p><p>The message should be:</p> <blockquote><p><i>PASSWORD mypassword RELOAD USERS EXIT</i></p></blockquote> <p>/Rolf </p> <div> </div></div>

Perfect, that makes since. I was able to create that file and add to the queue directory but when it is picked up it doesn't process the command. I am not sure if it is because I didn't set the mail server password correctly (in Mercury I clicked on "Configuration > Mail server > General" and type in "AdminPasswords" then clicked edit and added the password "test123" to the first line for testing purposes and hit "Save") or because of some other issue.

My .101 file contains the following:

$$ admin@192.168.0.57
maiser@192.168.0.57

PASSWORD test123
RELOAD USERS
EXIT

I am using my local ip temporarily and set it in the Mercury core module "General" tab and added it to the list of local domains. Is there a log I should look at somewhere to see why the command wasn't processed?

Thanks for your continued help!

<p>Perfect, that makes since. I was able to create that file and add to the queue directory but when it is picked up it doesn't process the command. I am not sure if it is because I didn't set the mail server password correctly (in Mercury I clicked on "Configuration > Mail server > General" and type in "AdminPasswords" then clicked edit and added the password "test123" to the first line for testing purposes and hit "Save") or because of some other issue.</p><p>My .101 file contains the following:</p><p>$$ admin@192.168.0.57 maiser@192.168.0.57 PASSWORD test123 RELOAD USERS EXIT</p><p>I am using my local ip temporarily and set it in the Mercury core module "General" tab and added it to the list of local domains. Is there a log I should look at somewhere to see why the command wasn't processed?</p><p>Thanks for your continued help! </p>

> Perfect, that makes since. I was able to create that file and add to the queue directory but when it is picked up it doesn't process the
> command. I am not sure if it is because I didn't set the mail server password correctly (in Mercury I clicked on "Configuration > Mail
> server > General" and type in "AdminPasswords" then clicked edit and added the password "test123" to the first line for testing purposes
> and hit "Save") or because of some other issue.
>
> My .101 file contains the following:
>
> $ admin@192.168.0.57
> maiser@192.168.0.57

The domain of maiser is the entry in Configuration | Mercury core | Internet name for this system.  If this does not match then this will be ignored.

When using literal addresses you need to enclose them in brackets in both the e-mail address and other entries in Mercury as well.

>
> PASSWORD test123
> RELOAD USERS
> EXIT
>
> I am using my local ip temporarily and set it in the Mercury core module "General" tab and added it to the list of local domains. Is
> there a log I should look at somewhere to see why the command wasn't processed?

 

<p>> Perfect, that makes since. I was able to create that file and add to the queue directory but when it is picked up it doesn't process the > command. I am not sure if it is because I didn't set the mail server password correctly (in Mercury I clicked on "Configuration > Mail > server > General" and type in "AdminPasswords" then clicked edit and added the password "test123" to the first line for testing purposes > and hit "Save") or because of some other issue. > > My .101 file contains the following: > > $ admin@192.168.0.57 > maiser@192.168.0.57 The domain of maiser is the entry in Configuration | Mercury core | Internet name for this system.  If this does not match then this will be ignored. When using literal addresses you need to enclose them in brackets in both the e-mail address and other entries in Mercury as well. > > PASSWORD test123 > RELOAD USERS > EXIT > > I am using my local ip temporarily and set it in the Mercury core module "General" tab and added it to the list of local domains. Is > there a log I should look at somewhere to see why the command wasn't processed? </p><p> </p>

I have a comprehensive VBA code module for user maintenance and message creating like:

Public Function Mercury32User_Create( _
  ByVal strUsername As String, _
  ByVal strUserPassword As String, _
  ByVal booAdminRights As Boolean, _
  Optional ByVal strUserFullName As String) As Variant

If someone could tell me, please, how to upload it to, say, the code snippets?

 

<P>I have a comprehensive VBA code module for user maintenance and message creating like:</P> <P>Public Function Mercury32User_Create( _   ByVal strUsername As String, _   ByVal strUserPassword As String, _   ByVal booAdminRights As Boolean, _   Optional ByVal strUserFullName As String) As Variant </P> <P>If someone could tell me, please, how to upload it to, say, the code snippets?</P> <P mce_keep="true"> </P>

Click Downloads from the top menu and select Community downloads / Add-ons for Mercury. Then click Upload and fill in the form.

/Rolf

<p>Click Downloads from the top menu and select Community downloads / Add-ons for Mercury. Then click Upload and fill in the form.</p><p>/Rolf </p>

Sorry, that's what I thought and have looked for, but nowhere I see an Upload button, link, or the like.

Could you be more specific please?

 /gustav

<p>Sorry, that's what I thought and have looked for, but nowhere I see an Upload button, link, or the like.</p><p>Could you be more specific please?</p><p> /gustav</p>

1. Be sure that you are signed in to the site.

2. Go to Community Downloads / Add-Ons for Mercury as previously described.

3. Look for the Upload button just above the table named "Files in this Folder".

/Rolf 

<p>1. Be sure that you are signed in to the site.</p><p>2. Go to Community Downloads / Add-Ons for Mercury as previously described.</p><p>3. Look for the Upload button just above the table named "Files in this Folder".</p><p>/Rolf </p>

Ah, sorry, was messing around in the Code Snippets area.

Thanks!

/gustav

<p>Ah, sorry, was messing around in the Code Snippets area.</p><p>Thanks!</p><p>/gustav</p>

OK, so I did - or at least I think so. There was a message about approval before it would be made visible but that's now a couple of days ago?

/gustav 

<p>OK, so I did - or at least I think so. There was a message about approval before it would be made visible but that's now a couple of days ago?</p><p>/gustav </p>

I'm ba'ack - approved the file.

Edit: Didn't verify if the file works as intended, but it looks ok. Pls note that if you fibble with the alias file, it has to be sorted (ascending order) 

<p>I'm ba'ack - approved the file.</p><p>Edit: Didn't verify if the file works as intended, but it looks ok. Pls note that if you fibble with the alias file, it has to be sorted (ascending order) </p>
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft