WebFaction
Community site: login faq

Looking to create a single mailbox with 15-20 aliases is there a way to do this at once or do I need to create each email address one at a time with the form?

asked 04 Mar '14, 16:01

blanco
213
accept rate: 0%


You can write a script that uses our control panel API to create your mailbox and email addresses: WebFaction API Documentation

Hope that helps!

permanent link

answered 04 Mar '14, 16:45

seanf
12.2k41836
accept rate: 37%

Thanks for the reply, is there an existing script around that you know of?

(04 Mar '14, 17:03) blanco

Not that I know of, but here's a quickie:

#!/bin/env/python

import xmlrpclib

USERNAME = 'your_panel_username'
PASSWORD = 'your_panel_password'

server = xmlrpclib.ServerProxy('https://api.webfaction.com/')
session_id, account = server.login(USERNAME, PASSWORD)

mailboxname = 'some_new_mailbox'

domainname = 'mydomain.com'

addresses = [
    'address1',
    'address2',
    'address3',
    ]

server.create_mailbox(session_id, mailboxname)

server.create_domain(session_id, domainname)

for address in addresses:
    newaddress = '%(address)s@%(domainname)s' % globals()
    server.create_email(session_id, newaddress, mailboxname)
(05 Mar '14, 01:36) seanf

All I actually had to do was RTFD that you pointed to. I got what I needed running quickly thanks!

(05 Mar '14, 13:32) blanco
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×260
×9

question asked: 04 Mar '14, 16:01

question was seen: 1,711 times

last updated: 05 Mar '14, 13:32

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM