Mailing List API

ZPillay

Verified User
Joined
Feb 17, 2006
Messages
10
Location
Rotterdam, Netherlands
Hi,

I've checked the www.directadmin.com/api.html but i can't seem to find any api features for the mailing list.

Is there a way to automaticly add people onto the mailing list via API or some other way using a form on the site?

If there is no API for it, can it be expected anytime soon? It would really help.

Kind regards,
 
Check this: http://www.directadmin.com/features.php?id=512

3. Mailing Lists

CMD_API_EMAIL_LIST
method can be GET or POST

action=create
domain=domain.com
name=list (do not include @domain.com).

action=delete
domain=domain.com
select0=list
(select1=list2) ..etc..

action=add
domain=domain.com
name=list
type=digest or list (one or the other, whichever you are adding to).
[email protected] (you can use comma sperated lists here)

action=view
domain=domain.com
name=list
returns: [email protected]&[email protected]&[email protected]..

action=modify
domain=domain.com
name=list
this will ouput a large number of settings.. too many to list here. Just run it to see what you get.

action=delete_subscriber or action=delete_subscriber_digest
domain=domain.com
name=list
[email protected]
([email protected], [email protected])..etc..

action=save
domain=domain.com
name=list
you'll nee to also include all of the parameters outputted from the action=modify result. Make any change with them, then save them.

domain=domain.com
(with nothing else)
returns a list of mailling lists in the format:
list=1:2&list2=4:2..etc...

where with 1:2 , the 1 is the number of subscribers, and the 2 is the number of digest subscribers.
 
The mailing list software is majordomo, and you can do just about everything by sending specially formatted emails to majordomo@${yourdomain}. If you do a web search for "majordomo commands", you will get a list of links showing how to handle a lot of the administative tasks you can do via email. Of course the DA api should work too.
 
From what I can tell, the DA API to set up mailing-lists is not good enough, and does not return all variables that can be set through the request-command 'newconfig'.

If I'm wrong, then there are some undocumentet features and/or inner workings of DA that takes care of things behind the scenes.

Like for example, sending the action = modify to get a list of all the API-commands to set up the list, does not show the 'moderate'-setting. Getting the current config from majordomo through the request-address however, shows it as being set to 'no'.

Due to this, I have no way of setting 'moderate' to 'yes' through the API, at least none that are documented in any way.
 
Last edited:
Any reason why modifying the text files with the addresses is not a good idea?
 
Any reason why modifying the text files with the addresses is not a good idea?

I'm not sure if this is directed at me, and if it is, I'm not sure what you mean. The API is supposed to keep you from worrying about text-files and configuration-files, and the mailing-list API doesn't do that.

From what I can see, the following majordomo-settings are not available/present by using the API:

administrivia, get_access, index_acces, info_access, intro_access, moderate, mungedomain, purge_received, strip, subscribe_policy, unsubscribe_policy, welcome, which_access, who_access

Some of these are set-able from the DA GUI however, so I'm not really sure what to make of it. The implementation seems kinda messy at this point.

I have quite a few existing lists I need to convert, and it seems I have to build my own config and mail it to majordomo's request-address instead of using the API. It's more work, but it'll work. It would be nice for the DA-team to have a proper API going though.
 
It wasn't necessarily directed at anyone. Config files aside, because yeah those would be a pain to parse, I was wondering if there was a reason to not modify the email list text files. Discussed in this thread were the possibility of using the DA API, as well as sending emails to the Majordomo listserv to subscribe people to the list. I was curious what the benefit was to using those methods vs. appending the new email address to the list... other than the fact that this is in DA's Scripting/API forum. :)
 
Note, I'm only answering the part of your post I want to answer ;) ...

You don't have to parse any config files to send an email to majordomo to configure it; Majordomo does it for you. Have you found and read majordomo documentation?

We used to run a majordomo list hosting company; we never created any kind of interface; we just supplied sample configuration documentation.

It worked.

But that was the good old days, back when the air was clean and sysadmins were sysadmins.

;)

Jeff
 
You don't have to parse any config files to send an email to majordomo to configure it; Majordomo does it for you. Have you found and read majordomo documentation?

My plan is to fetch various settings from an existing ezmlm-list, create the majordomo-list by API, fetch the current settings back from the API, then use those + other settings that aren't in the API to build the newconfig-mail that I send to majordomos request-address. Is there a better way to solve it that I've overlooked?
 
I don't know, because I've never made it complex. It takes about ten minutes to set up a list manually by editing the config file; I don't know why that's not easy enough.

Maybe I'm lost.

Jeff
 
I don't know, because I've never made it complex. It takes about ten minutes to set up a list manually by editing the config file; I don't know why that's not easy enough.

It's easy if it's one list, but I have a little over 50 lists in ezmlm-format that I need to convert over to majordomo, and I really don't want to re-write the settings from ezmlm manually for all those lists.. :)
 
Back
Top