Commit 28b096dcd1bded64d94d1a4bf59d6bdc474839ac
1 parent
2ace0960
Exists in
master
and in
90 other branches
switch to colab master branch
Showing
2 changed files
with
38 additions
and
18 deletions
Show diff stats
.mrconfig
| 1 | [.] | 1 | [.] |
| 2 | 2 | ||
| 3 | [colab] | 3 | [colab] |
| 4 | -checkout = git clone https://github.com/colab-community/colab.git --branch pypi | 4 | +checkout = git clone https://github.com/colab-community/colab.git |
| 5 | 5 | ||
| 6 | [mailman-api] | 6 | [mailman-api] |
| 7 | checkout = git clone https://github.com/TracyWebTech/mailman-api.git | 7 | checkout = git clone https://github.com/TracyWebTech/mailman-api.git |
vagrant.d/10-mailman-debian
| @@ -35,28 +35,18 @@ EOF | @@ -35,28 +35,18 @@ EOF | ||
| 35 | apt-get update | 35 | apt-get update |
| 36 | fi | 36 | fi |
| 37 | 37 | ||
| 38 | -# pre-configure postfix | 38 | +# pre-configure packages |
| 39 | 'debconf-set-selections' <<EOF | 39 | 'debconf-set-selections' <<EOF |
| 40 | postfix postfix/main_mailer_type select Internet Site | 40 | postfix postfix/main_mailer_type select Internet Site |
| 41 | + | ||
| 42 | +mailman mailman/site_languages multiselect pt_BR (Brasilian Portuguese) | ||
| 43 | +mailman mailman/default_server_language select pt_BR (Brasilian Portuguese) | ||
| 41 | EOF | 44 | EOF |
| 42 | 45 | ||
| 43 | apt-get install -qy postfix mailman mailman-api | 46 | apt-get install -qy postfix mailman mailman-api |
| 44 | 47 | ||
| 45 | LISTS_DOMAIN=lists.local | 48 | LISTS_DOMAIN=lists.local |
| 46 | - | ||
| 47 | -################################################################# | ||
| 48 | -# mailman-api configuration | ||
| 49 | -################################################################# | ||
| 50 | - | ||
| 51 | -# FIXME binding to 0.0.0.0 is too liberal | ||
| 52 | -cat > /etc/default/mailman-api <<EOF | ||
| 53 | -OPTIONS='--bind=0.0.0.0:8010' | ||
| 54 | -EOF | ||
| 55 | -service mailman-api restart | ||
| 56 | - | ||
| 57 | -if ! grep -q MAILMAN_API_URL /etc/colab/settings.yaml; then | ||
| 58 | - echo "MAILMAN_API_URL: 'http://localhost:8010'" >> /etc/colab/settings.yaml | ||
| 59 | -fi | 49 | +TEST_LISTS='list01 list02 list03' |
| 60 | 50 | ||
| 61 | ################################################################# | 51 | ################################################################# |
| 62 | # mailman configuration | 52 | # mailman configuration |
| @@ -78,21 +68,51 @@ mailman_config MTA None | @@ -78,21 +68,51 @@ mailman_config MTA None | ||
| 78 | mailman_config POSTFIX_STYLE_VIRTUAL_DOMAINS "['$LISTS_DOMAIN']" | 68 | mailman_config POSTFIX_STYLE_VIRTUAL_DOMAINS "['$LISTS_DOMAIN']" |
| 79 | mailman_config DEB_LISTMASTER "'vagrant@localhost.localdomain'" | 69 | mailman_config DEB_LISTMASTER "'vagrant@localhost.localdomain'" |
| 80 | 70 | ||
| 71 | +# create mailman's meta-list | ||
| 72 | +sudo -u list newlist --quiet mailman vagrant@localhost.localdomain "pass-mailman" | ||
| 73 | +service mailman restart | ||
| 74 | + | ||
| 81 | # create some sample lists | 75 | # create some sample lists |
| 82 | -for list in list01 list02 list03; do | 76 | +for list in $TEST_LISTS; do |
| 83 | if list_lists --bare | grep "$list"; then | 77 | if list_lists --bare | grep "$list"; then |
| 84 | echo "$list already exists ..." | 78 | echo "$list already exists ..." |
| 85 | else | 79 | else |
| 86 | - newlist "$list" vagrant@localhost.localdomain "pass-$list" | 80 | + sudo -u list newlist --quiet "$list" vagrant@localhost.localdomain "pass-$list" |
| 87 | echo 'vagrant@localhost.localdomain' | add_members -r - "$list" | 81 | echo 'vagrant@localhost.localdomain' | add_members -r - "$list" |
| 88 | fi | 82 | fi |
| 89 | done | 83 | done |
| 90 | 84 | ||
| 91 | ################################################################# | 85 | ################################################################# |
| 86 | +# mailman-api configuration | ||
| 87 | +################################################################# | ||
| 88 | + | ||
| 89 | +# FIXME binding to 0.0.0.0 is too liberal | ||
| 90 | +cat > /etc/default/mailman-api <<EOF | ||
| 91 | +OPTIONS='--bind=0.0.0.0:8010' | ||
| 92 | +EOF | ||
| 93 | +service mailman-api restart | ||
| 94 | + | ||
| 95 | +if ! grep -q MAILMAN_API_URL /etc/colab/settings.yaml; then | ||
| 96 | + echo "MAILMAN_API_URL: 'http://localhost:8010'" >> /etc/colab/settings.yaml | ||
| 97 | +fi | ||
| 98 | + | ||
| 99 | + | ||
| 100 | +################################################################# | ||
| 92 | # postfix configuration | 101 | # postfix configuration |
| 93 | ################################################################# | 102 | ################################################################# |
| 103 | + | ||
| 94 | postconf relay_domains="$LISTS_DOMAIN" | 104 | postconf relay_domains="$LISTS_DOMAIN" |
| 95 | postconf transport_maps=hash:/etc/postfix/transport | 105 | postconf transport_maps=hash:/etc/postfix/transport |
| 96 | echo "$LISTS_DOMAIN mailman:" > /etc/postfix/transport | 106 | echo "$LISTS_DOMAIN mailman:" > /etc/postfix/transport |
| 97 | postmap /etc/postfix/transport | 107 | postmap /etc/postfix/transport |
| 98 | service postfix restart | 108 | service postfix restart |
| 109 | + | ||
| 110 | +################################################################# | ||
| 111 | +# post a few message to each list | ||
| 112 | +################################################################# | ||
| 113 | + | ||
| 114 | +for list in $TEST_LISTS; do | ||
| 115 | + for i in $(seq 1 10); do | ||
| 116 | + (echo "this is a test ($i)") | mail -r vagrant@localhost.localdomain -s "test $i" "$list@lists.local" | ||
| 117 | + done | ||
| 118 | +done |