need help with this script creating email accounts

affandi

New member
Joined
Apr 25, 2017
Messages
2
Hi, I found this topic regarding email account creation:

http://forum.directadmin.com/showthread.php?t=14157

The problem is that the script doesn't work properly; it makes emails with a space between username and the domain for example:

user1 @domain.com instead of [email protected]

and also the output in etc/virtual/domain/passwd is wrong

instead of
user1:randompassword
user2:randompassword
it's like this:
user1
:randompassword
user2
:randompassword

Hope someone can help me out

Thanks
 
Hello,

I have this:

Code:
1:abLkWuQoCVw8c
2:abW2c7D2oryP2
3:ab7YIEOu6gjhs
4:abrTvWKeKI3dY
5:abd8hyCktvGuY
6:abJ5B8.0CtUiQ
7:abfREX.E/TGp6
8:abvGb6MuJHKD.
9:abbSB2b4aYewY
10:abSX8pTEdKy86

How does your file with names look like? Did you create it in Windows OS/Mac OS with their own line-breaks (\r\n)? If so you probably need to change line-breaks to Linux-native format (\n).
 
It works after using ascii transfer instead of binary.

But it only creates pop email accounts and not imap, so can't access it on webmail.

Do you know the fastest way to create a lot of imap accounts with this script or some other way around?

Thanks in advance
 
Actually the script is outdated, and it creates accounts for old version of dovecot I believe.

In directadmin POP and IMAP accounts are the same.

I'd rather run curl in a loop from command line to create all those accounts via API:

/CMD_API_POP?action=create&domain=domain.com&user=emailuser&passwd=password&quota=10

you need to pass headers for AUTH username/password too.

related: https://www.directadmin.com/features.php?id=229
 
Back
Top