alterator-postfix-dovecot-0.7.1/000075500000000000000000000000001222302465500166465ustar00rootroot00000000000000alterator-postfix-dovecot-0.7.1/Makefile000064400000000000000000000017331222302465500203120ustar00rootroot00000000000000NAME=postfix-dovecot all: clean: #install: install-module install-data install-hook install: install-backend install-po install-ui install-data install-hook -include /usr/share/alterator/build/module.mak -include /usr/share/alterator/build/backend.mak -include /usr/share/alterator/build/po.mak -include /usr/share/alterator/build/ui2.mak -include ~/git/alterator/alterator/build/po.mak install-data: install -d $(datadir)/alterator-${NAME} cp -R data/* $(datadir)/alterator-${NAME}/ install-hook: install -Dpm755 scripts/postfix-hook-hostname $(sysconfdir)/hooks/hostname.d/22-postfix install -Dpm755 scripts/dovecot-hook-hostname $(sysconfdir)/hooks/hostname.d/23-dovecot install -Dpm755 scripts/hook-net-domain $(libexecdir)/alterator/hooks/net-domain.d/20-${NAME} install -Dpm644 scripts/alterator-postfix-dovecot-functions $(bindir)/alterator-postfix-dovecot-functions # install -Dpm755 scripts/postfix-submission $(sysconfdir)/control.d/facilities/postfix-submission # alterator-postfix-dovecot-0.7.1/applications/000075500000000000000000000000001222302465500213345ustar00rootroot00000000000000alterator-postfix-dovecot-0.7.1/applications/postfix-dovecot.desktop000064400000000000000000000003751222302465500260710ustar00rootroot00000000000000[Desktop Entry] Type=Application Categories=X-Alterator-Servers Terminal=false Name=Mail server Icon=mail X-Alterator-UI=html X-Alterator-URI=/postfix-dovecot X-Alterator-Weight=20 X-Alterator-Help=postfix-dovecot Name[ru]=Почтовый сервер alterator-postfix-dovecot-0.7.1/backend3/000075500000000000000000000000001222302465500203205ustar00rootroot00000000000000alterator-postfix-dovecot-0.7.1/backend3/postfix-dovecot000075500000000000000000000120131222302465500234000ustar00rootroot00000000000000#!/bin/sh po_domain="alterator-postfix-dovecot" alterator_api_version=1 . alterator-sh-functions . alterator-service-functions . alterator-postfix-dovecot-functions . shell-config write_limit_param() { local v="$(postconf_read "$1")" write_string_param "$1" "$(($v / 1048576))" } read_limit_param() { [ -z "$2" ] || postconf_write "$1" "$(($2 * 1048576))" } control_postfix() { if [ -n "$1" ]; then /usr/sbin/control postfix "$1" else /usr/sbin/control postfix fi } daemon_status() { test -n "$1" || return 1 if service_control "$1" is-enabled && service_control "$1" is-active; then return 0 fi return 1 } daemon_on() { test -n "$1" || return daemon_status "$1" && return 0 service_control "$1" on service_control "$1" start || : } daemon_off() { test -n "$1" || return service_control "$1" condstop service_control "$1" off } daemon_condreload() { test -n "$1" || return service_control "$1" condreload } domain_is_master() { [ "$(shell_config_get /etc/sysconfig/system SERVER_ROLE)" = "master" ] && return 0 || return 1 } on_message() { set | grep '^in_' >&2 echo >&2 case "$in_action" in type) write_type_item relayhost hostname write_type_item message_size_limit postfix-limit write_type_item domainlist hostname-list # write_type_item filtered_recipients hostname-list ;; list) case "$in__objects" in modes) write_enum_item relay "`_ "Relay"`" write_enum_item mx "`_ "MX"`" ;; esac ;; read) if [ "$(control_postfix)" != "local" ]; then write_bool_param postfix_daemon yes else write_bool_param postfix_daemon no fi if dovecot_read protocols | grep -qs '\bimap pop3 lmtp\b'; then ! daemon_status dovecot write_bool_param pop3_imap "$?" else write_bool_param pop3_imap no fi if [ -n "$(postconf_read relayhost)" ]; then write_string_param mode 'relay' else write_string_param mode 'mx' fi write_string_param relayhost "$(postconf_read relayhost)" write_string_param domainlist "$(cat "$MYDESTINATION" | tr '\n' ' ')" if [ -n "$(postconf_read relayhost)" ]; then write_string_param mode 'relay' else write_string_param mode 'mx' fi write_string_param relayhost "$(postconf_read relayhost)" write_string_param domainlist "$(cat "$MYDESTINATION" | tr '\n' ' ')" write_string_param rootmail "$(rootmail_read)" write_limit_param message_size_limit if [ "$(control_postfix)" = "filter" ]; then ! daemon_status spamd write_bool_param spamfilter "$?" else write_bool_param spamfilter no fi if postconf_has smtpd_client_restrictions reject_rbl_client ; then write_bool_param filter_senders yes else write_bool_param filter_senders no fi if grep -qs '\bREJECT\b' "$(list_name recipient)"; then write_bool_param filter_recipients yes write_string_param filtered_recipients "$(reject_list recipient | tr '\n' ' ')" else write_bool_param filter_recipients no fi write_string_param mynetworks "$(cat "$MYNETWORKS" | tr '\n' ' ')" [ "$(shell_config_get /etc/sysconfig/system SERVER_ROLE)" = "master" ] && write_bool_param domain_master true || write_bool_param domain_master false ;; write) case "$in_mode" in mx) postconf_write relayhost "" echo -n > "$MYDESTINATION" for i in $in_domainlist; do echo "$i" >> "$MYDESTINATION" done ;; relay) postconf_write relayhost "$in_relayhost" # echo -n > "$MYDESTINATION" ;; esac rootmail_write "$in_rootmail" read_limit_param message_size_limit "$in_message_size_limit" if test_bool "$in_filter_senders"; then postconf_restrict_on else postconf_restrict_off fi if test_bool "$in_filter_recipients"; then for i in $in_filtered_recipients; do reject_has "$(list_name recipient)" "$i" || reject_add "$(list_name recipient)" "$i" done else reject_clean "$(list_name recipient)" fi echo -n > "$MYNETWORKS" for i in $in_mynetworks; do echo "$i" >> "$MYNETWORKS" done if test_bool "$in_pop3_imap"; then dovecot_write protocols "imap pop3 lmtp" # dovecot_auth_write auth_mechanisms "plain login" daemon_condreload dovecot daemon_on dovecot else dovecot_write protocols "none" daemon_condreload dovecot fi if test_bool "$in_postfix_daemon"; then if test_bool "$in_spamfilter"; then daemon_on spamd if [ "$(control_postfix)" = "filter" ]; then daemon_condreload postfix else control_postfix filter fi else daemon_off spamd if [ "$(control_postfix)" != "server" ]; then control_postfix server /usr/sbin/control postfix-submission enable fi fi else if [ "$(control_postfix)" != "local" ]; then /usr/sbin/control postfix-submission disable control_postfix local daemon_off spamd fi fi ;; esac } message_loop # vim: set ts=4 sts=4 sw=4: alterator-postfix-dovecot-0.7.1/data/000075500000000000000000000000001222302465500175575ustar00rootroot00000000000000alterator-postfix-dovecot-0.7.1/data/dovecot/000075500000000000000000000000001222302465500212225ustar00rootroot00000000000000alterator-postfix-dovecot-0.7.1/data/dovecot/conf.d/000075500000000000000000000000001222302465500223715ustar00rootroot00000000000000alterator-postfix-dovecot-0.7.1/data/dovecot/conf.d/alterator.conf000064400000000000000000000013461222302465500252410ustar00rootroot00000000000000service auth { #postfix unix_listener auth-userdb { #mode = 0666 #user = #group = } unix_listener /var/spool/postfix/private/auth { group = postfix mode = 0660 user = postfix } user = dovecot } #postfix passdb { driver = ldap # Path for LDAP configuration file, see example-config/dovecot-ldap.conf args = /etc/dovecot/ldap.conf } # #userdb { # driver = prefetch #} userdb { driver = ldap args = /etc/dovecot/ldap.conf # Default fields can be used to specify defaults that LDAP may override #default_fields = home=/home/virtual/%u } #default_internal_user = dovecot disable_plaintext_auth = no auth_mechanisms = plain login mail_privileged_group = mail alterator-postfix-dovecot-0.7.1/data/dovecot/dovecot-openssl.cnf000064400000000000000000000007551222302465500250450ustar00rootroot00000000000000[ req ] default_bits = 1024 encrypt_key = yes distinguished_name = req_dn x509_extensions = cert_type prompt = no [ req_dn ] # country (2 letter code) #C=FI # State or Province Name (full name) #ST= # Locality Name (eg. city) #L=Helsinki # Organization (eg. company) #O=Dovecot # Organizational Unit Name (eg. section) OU=IMAP server # Common Name (*.example.com is also possible) CN=imap.example.com # E-mail contact emailAddress=postmaster@@domain@ [ cert_type ] nsCertType = server alterator-postfix-dovecot-0.7.1/data/dovecot/ldap.conf000064400000000000000000000003461222302465500230140ustar00rootroot00000000000000uris = ldap://localhost/ debug_level = 0 auth_bind = yes auth_bind_userdn = uid=%n,ou=People,@basedn@ base = @basedn@ user_attrs = homeDirectory=home,uidNumber=uid,gidNumber=gid user_filter = (&(objectClass=posixAccount)(uid=%n)) alterator-postfix-dovecot-0.7.1/data/postfix/000075500000000000000000000000001222302465500212535ustar00rootroot00000000000000alterator-postfix-dovecot-0.7.1/data/postfix/client_access000064400000000000000000000000001222302465500237630ustar00rootroot00000000000000alterator-postfix-dovecot-0.7.1/data/postfix/helo_access000064400000000000000000000000001222302465500234340ustar00rootroot00000000000000alterator-postfix-dovecot-0.7.1/data/postfix/ldap-aliases.cf000064400000000000000000000002571222302465500241300ustar00rootroot00000000000000server_host = localhost search_base = @basedn@ query_filter = (&(objectClass=posixGroup)(mail=%s)) result_attribute = memberUid result_format = %u@@domain@ #debuglevel = 4095 alterator-postfix-dovecot-0.7.1/data/postfix/ldap-users.cf000064400000000000000000000002171222302465500236440ustar00rootroot00000000000000server_host = localhost search_base = @basedn@ query_filter = (&(objectClass=posixAccount)(mail=%s)) result_attribute = uid #debuglevel = 4095 alterator-postfix-dovecot-0.7.1/data/postfix/mydestination000064400000000000000000000000111222302465500240550ustar00rootroot00000000000000@domain@ alterator-postfix-dovecot-0.7.1/data/postfix/recipient_access000064400000000000000000000000001222302465500244670ustar00rootroot00000000000000alterator-postfix-dovecot-0.7.1/data/postfix/sender_access000064400000000000000000000000001222302465500237650ustar00rootroot00000000000000alterator-postfix-dovecot-0.7.1/data/postfix/whitelist000064400000000000000000000000341222302465500232070ustar00rootroot00000000000000postmaster@ OK abuse@ OK alterator-postfix-dovecot-0.7.1/scripts/000075500000000000000000000000001222302465500203355ustar00rootroot00000000000000alterator-postfix-dovecot-0.7.1/scripts/alterator-postfix-dovecot-functions000064400000000000000000000131421222302465500274170ustar00rootroot00000000000000#!/bin/sh . alterator-sh-functions . alterator-service-functions . shell-quote . shell-config CONF_PREFIX=/etc/postfix MYDESTINATION=$CONF_PREFIX/mydestination MYNETWORKS=$CONF_PREFIX/mynetworks ACCESS_SUFFIX=_access ALIASES=$CONF_PREFIX/aliases DOVECOT_CONF=/etc/dovecot/dovecot.conf DOVECOT_AUTH_CONF=/etc/dovecot/conf.d/10-auth.conf DOVECOT_ALT_CONF=/etc/dovecot/conf.d/alterator.conf network_file=/etc/sysconfig/network ### postfix main.cf list attributes like smtpd_client_restrictions delim1_re='[[:space:]]\+' delim2_re='[[:space:]]*,[[:space:]]*' delim_re="\(^\|$delim1_re\|$delim2_re\)" end_delim_re="\($delim1_re\|$delim2_re\|$\)" value_re='[^[:space:],]\+' postconf_read() { /usr/sbin/postconf -h "$1" } postconf_write() { /usr/sbin/postconf -e "$1=$2" } postconf_has() { local name="$(quote_sed_regexp "$2")" postconf_read "$1"| grep -qs "${delim_re}$name${end_delim_re}" } postconf_cons() { printf '%s %s, %s' "$1" "$2" "$3" } postconf_skip() { local name="$(quote_sed_regexp "$2")" echo "$1" | sed -e "s/${delim_re}$name${end_delim_re}/\1/g" \ -e 's/^[[:space:]]*,[[:space:]]*//' } postconf_restrict_on() { local args= local v="$(postconf_read smtpd_helo_restrictions)" postconf_has smtpd_helo_restrictions reject_non_fqdn_hostname || v="$(echo "$v"|sed "s/${delim_re}permit${end_delim_re}/\1reject_non_fqdn_hostname, permit\2/")" postconf_has smtpd_helo_restrictions reject_invalid_hostname || v="$(echo "$v"|sed "s/${delim_re}permit${end_delim_re}/\1reject_invalid_hostname, permit\2/")" args="$args \"$(quote_shell smtpd_helo_restrictions=$v)\"" v="$(postconf_read smtpd_client_restrictions)" postconf_has smtpd_client_restrictions "reject_rbl_client zen.spamhaus.org" || v="$(echo "$v"|sed "s/${delim_re}permit${end_delim_re}/\1reject_rbl_client zen.spamhaus.org, permit\2/")" args="$args \"$(quote_shell smtpd_client_restrictions=$v)\"" v="$(postconf_read smtpd_sender_restrictions)" postconf_has smtpd_sender_restrictions reject_non_fqdn_sender || v="$(echo "$v"|sed "s/${delim_re}permit${end_delim_re}/\1reject_non_fqdn_sender, permit\2/")" postconf_has smtpd_sender_restrictions reject_unknown_sender_domain || v="$(echo "$v"|sed "s/${delim_re}permit${end_delim_re}/\1reject_unknown_sender_domain, permit\2/")" args="$args \"$(quote_shell smtpd_sender_restrictions=$v)\"" v="$(postconf_read smtpd_recipient_restrictions)" postconf_has smtpd_recipient_restrictions reject_non_fqdn_recipient || v="$(echo "$v"|sed "s/${delim_re}reject_unauth_destination${end_delim_re}/\1reject_non_fqdn_recipient, reject_unauth_destination\2/")" postconf_has smtpd_recipient_restrictions reject_unknown_recipient_domain || v="$(echo "$v"|sed "s/${delim_re}reject_unauth_destination${end_delim_re}/\1reject_unknown_recipient_domain, reject_unauth_destination\2/")" args="$args \"$(quote_shell smtpd_recipient_restrictions=$v)\"" eval /usr/sbin/postconf -e $args } postconf_restrict_off() { local args= local v="$(postconf_read smtpd_helo_restrictions)" v="$(postconf_skip "$v" reject_non_fqdn_hostname)" v="$(postconf_skip "$v" reject_invalid_hostname)" args="$args \"$(quote_shell smtpd_helo_restrictions=$v)\"" v="$(postconf_read smtpd_client_restrictions)" v="$(postconf_skip "$v" "reject_rbl_client zen.spamhaus.org")" args="$args \"$(quote_shell smtpd_client_restrictions=$v)\"" v="$(postconf_read smtpd_sender_restrictions)" v="$(postconf_skip "$v" reject_non_fqdn_sender)" v="$(postconf_skip "$v" reject_unknown_sender_domain)" args="$args \"$(quote_shell smtpd_sender_restrictions=$v)\"" v="$(postconf_read smtpd_recipient_restrictions)" v="$(postconf_skip "$v" reject_non_fqdn_recipient)" v="$(postconf_skip "$v" reject_unknown_recipient_domain)" args="$args \"$(quote_shell smtpd_recipient_restrictions=$v)\"" eval /usr/sbin/postconf -e $args } postconf_list() { test -n "$1" || return sed -e :a \ -e '$!{N; s/\n[ \t]\+/ /; s/\n#.*$//; s/\n[ \t]*$//; ba}' \ "$1" } list_name() { test -n "$1" || return echo "$CONF_PREFIX/$1$ACCESS_SUFFIX" } reject_list() { test -n "$1" || return postconf_list "$(list_name "$1")" | sed -e "/${delim_re}REJECT${end_delim_re}/!d" \ -e "s/^\([^[:space:]]\+\).*/\1/" } reject_has() { grep -qs "^$2[[:space:]]\+REJECT\b" "$1" } reject_add() { test -n "$1" -a -n "$2" || return echo -e "$2\tREJECT" >> "$1" } reject_clean() { test -n "$1" || return sed -i \ -e '/^#/b' \ -e '/^[ \t]*$/b' \ -e "/${delim_re}REJECT${end_delim_re}/d" \ "$1" } dovecot_write() { test -n "$1" -a -n "$2" || return if grep -qs "^[[:space:]]*#*[[:space:]]*$1\b" "$DOVECOT_CONF"; then sed -i \ -e "s/^[[:space:]]*#*[[:space:]]*$1[[:space:]]*=.*/$1 = $2/" \ "$DOVECOT_CONF" else echo "$1 = $2" >> "$DOVECOT_CONF" fi } dovecot_auth_write() { test -n "$1" -a -n "$2" || return if grep -qs "^[[:space:]]*#*[[:space:]]*$1\b" "$DOVECOT_AUTH_CONF"; then sed -i \ -e "s/^[[:space:]]*#*[[:space:]]*$1[[:space:]]*=.*/$1 = $2/" \ "$DOVECOT_AUTH_CONF" else echo "$1 = $2" >> "$DOVECOT_AUTH_CONF" fi } dovecot_read() { test -n "$1" || return sed -n \ -e "s/^[[:space:]]*$1[[:space:]]*=[[:space:]]*\([^#]\+\)/\1/p" \ "$DOVECOT_CONF" } dovecot_auth_read() { test -n "$1" || return sed -n \ -e "s/^[[:space:]]*$1[[:space:]]*=[[:space:]]*\([^#]\+\)/\1/p" \ "$DOVECOT_AUTH_CONF" } rootmail_read() { shell_config_get "$ALIASES" root ':[[:space:]]*' | head -n1 } rootmail_write() { test -n "$1" || return shell_config_set "$ALIASES" root "$1" ':[[:space:]]*' ': ' /usr/bin/newaliases } alterator-postfix-dovecot-0.7.1/scripts/dovecot-hook-hostname000075500000000000000000000022601222302465500245000ustar00rootroot00000000000000#!/bin/sh -f . alterator-service-functions . shell-config # if we are not server [ -f /etc/sysconfig/system ] || exit 0 . /etc/sysconfig/system [ "$SERVER_ROLE" = "master" ] || exit 0 CONFIG_FILES=' /etc/dovecot/dovecot.conf /etc/dovecot/dovecot-openssl.cnf /etc/dovecot/ldap.conf' if [ $# -eq 0 ]; then olddomain="" newdomain="$(shell_config_get /etc/sysconfig/network HOSTNAME)" [ -n "$newdomain" ] && newdomain="${newdomain#*.}" || newdomain="localdomain" else olddomain="${1#*.}" ; shift newdomain="${1#*.}" ; shift fi # host.domain.com => dc=host,dc=domain,dc=com host_2_dn() { echo "$1"|sed ' s/^/dc=/ s/\./,dc=/g' } olddn="$(host_2_dn "$olddomain")" newdn="$(host_2_dn "$newdomain")" [ -n "$newdomain" -a -n "$newdn" ] || exit dn_delim='\(^\|[^[:alnum:]=-]\|$\)' dns_delim='\(^\|[^[:alnum:].-]\|$\)' [ -n "$olddn" ] && sed -i \ -e "s/${dn_delim}${olddn}${dn_delim}/\1@basedn@\2/g" \ $CONFIG_FILES [ -n "$olddomain" ] && sed -i \ -e "s/${dns_delim}${olddomain}${dns_delim}/\1@domain@\2/g" \ $CONFIG_FILES sed -i -e "s/@basedn@/${newdn}/g" \ -e "s/@domain@/${newdomain}/g" \ $CONFIG_FILES service_control dovecot condreload alterator-postfix-dovecot-0.7.1/scripts/hook-net-domain000075500000000000000000000043421222302465500232570ustar00rootroot00000000000000#!/bin/sh -eu . alterator-postfix-dovecot-functions TEMPLATES_DIR=/usr/share/alterator-postfix-dovecot if [ -z "${new_server_role:-}" ]; then old_server_role="" new_server_role="$(shell_config_get /etc/sysconfig/system SERVER_ROLE)" fi [ -n "$new_server_role" -a "$new_server_role" != "$old_server_role" ] || exit 0 [ "$new_server_role" = "master" ] || exit 0 cp -Rb --suffix='.bak' "$TEMPLATES_DIR"/* /etc/ if postconf_read mynetworks | grep -qs '127\.0\.0\.1'; then postconf_read mynetworks > "$MYNETWORKS" fi echo "@domain@" > "$MYDESTINATION" # Init postfix config postconf_write smtpd_use_tls yes postconf_write smtpd_tls_auth_only yes postconf_write smtpd_tls_received_header yes postconf_write smtpd_tls_key_file "/var/lib/ssl/private/postfix.key" postconf_write smtpd_tls_cert_file "/var/lib/ssl/certs/postfix.cert" postconf_write smtpd_sasl_auth_enable yes postconf_write smtpd_sasl_tls_security_options 'noanonymous' postconf_write smtpd_sasl_security_options 'noanonymous, noplaintext' postconf_write mynetworks 'localhost, $myhostname, $config_directory/mynetworks' # postconf_write mynetworks '$config_directory/mynetworks' postconf_write smtpd_helo_restrictions 'check_recipient_access cdb:/etc/postfix/whitelist, permit_mynetworks, permit_sasl_authenticated, check_helo_access cdb:/etc/postfix/helo_access, permit' postconf_write smtpd_client_restrictions 'check_recipient_access cdb:/etc/postfix/whitelist, permit_mynetworks, permit_sasl_authenticated, check_client_access cdb:/etc/postfix/client_access, permit' postconf_write smtpd_sender_restrictions 'check_recipient_access cdb:/etc/postfix/whitelist, permit_mynetworks, permit_sasl_authenticated, check_sender_access cdb:/etc/postfix/sender_access, permit' postconf_write smtpd_recipient_restrictions 'check_recipient_access cdb:/etc/postfix/recipient_access, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, permit' postconf_write virtual_alias_maps 'ldap:/etc/postfix/ldap-aliases.cf, ldap:/etc/postfix/ldap-users.cf' postconf_write local_recipient_maps 'proxy:unix:passwd.byname $alias_maps ldap:/etc/postfix/ldap-users.cf' postconf_write smtpd_sasl_path private/auth postconf_write smtpd_sasl_type dovecot postconf_write mailbox_unpriv_delivery no ## alterator-postfix-dovecot-0.7.1/scripts/postfix-hook-hostname000075500000000000000000000022621222302465500245330ustar00rootroot00000000000000#!/bin/sh -f . alterator-service-functions . shell-config # if we are not server [ -f /etc/sysconfig/system ] || exit 0 . /etc/sysconfig/system [ "$SERVER_ROLE" = "master" ] || exit 0 CONFIG_FILES=' /etc/postfix/ldap-aliases.cf /etc/postfix/ldap-users.cf /etc/postfix/mydestination' if [ $# -eq 0 ]; then olddomain="" newdomain="$(shell_config_get /etc/sysconfig/network HOSTNAME)" [ -n "$newdomain" ] && newdomain="${newdomain#*.}" || newdomain="localdomain" else olddomain="${1#*.}" ; shift newdomain="${1#*.}" ; shift fi # host.domain.com => dc=host,dc=domain,dc=com host_2_dn() { echo "$1"|sed ' s/^/dc=/ s/\./,dc=/g' } olddn="$(host_2_dn "$olddomain")" newdn="$(host_2_dn "$newdomain")" [ -n "$newdomain" -a -n "$newdn" ] || exit dn_delim='\(^\|[^[:alnum:]=-]\|$\)' dns_delim='\(^\|[^[:alnum:].-]\|$\)' [ -n "$olddn" ] && sed -i \ -e "s/${dn_delim}${olddn}${dn_delim}/\1@basedn@\2/g" \ $CONFIG_FILES [ -n "$olddomain" ] && sed -i \ -e "s/${dns_delim}${olddomain}${dns_delim}/\1@domain@\2/g" \ $CONFIG_FILES sed -i -e "s/@basedn@/${newdn}/g" \ -e "s/@domain@/${newdomain}/g" \ $CONFIG_FILES service_control postfix condreload alterator-postfix-dovecot-0.7.1/scripts/postfix-submission000075500000000000000000000016731222302465500241570ustar00rootroot00000000000000#!/bin/sh . /etc/control.d/functions . alterator-service-functions CONFIG=/etc/postfix/master.cf new_summary "Postfix SMTP:587 server" is_submission_disabled='^#submission[[:space:]]+inet[[:space:]]+.*[[:space:]]+smtpd\>' disable_submission='s,^submission[[:space:]]\+inet[[:space:]]\+.*[[:space:]]\+smtpd\>,#&,' is_submission_enabled='^submission[[:space:]]+inet[[:space:]]+.*[[:space:]]+smtpd\>' enable_submission='s,^#\(submission[[:space:]]\+inet[[:space:]]\+.*[[:space:]]\+smtpd\>\),\1,' new_subst disabled "$is_submission_disabled" "$disable_submission" new_subst enabled "$is_smtp_submission" "$enable_submission" new_help disabled "Disable Postfix SMTP:587 service, see smtpd(8)" new_help enabled "Enable Postfix SMTP:587 service, see smtpd(8)" is_builtin_mode "$*" || [ "$*" != "`control_subst "$CONFIG" status`" ] || exit 0 control_subst "$CONFIG" "$*" || exit 1 is_builtin_mode "$*" || service_control postfix condreload || exit 0 alterator-postfix-dovecot-0.7.1/ui/000075500000000000000000000000001222302465500172635ustar00rootroot00000000000000alterator-postfix-dovecot-0.7.1/ui/postfix-dovecot/000075500000000000000000000000001222302465500224205ustar00rootroot00000000000000alterator-postfix-dovecot-0.7.1/ui/postfix-dovecot/ajax.scm000064400000000000000000000034601222302465500240520ustar00rootroot00000000000000(define-module (ui postfix-dovecot ajax) :use-module (alterator ajax) :use-module (alterator woo) :use-module (alterator effect) :export (init)) (define (ui-read) (form-update-value-list (woo-read-first "/postfix-dovecot")) (let* ((data (woo-read "/postfix-dovecot")) (domain_master (woo-get-option (car data) 'domain_master))) (form-update-visibility "nodomain_page" (not domain_master)) (form-update-activity "main_table" domain_master) (form-update-activity "postfix_daemon" domain_master) (form-update-activity "mode" domain_master) (form-update-activity "relayhost" domain_master) (form-update-activity "domainlist" domain_master) (form-update-activity "relay" domain_master) (form-update-activity "mx" domain_master) (form-update-activity "rootmail" domain_master) (form-update-activity "message_size_limit" domain_master) (form-update-activity "spamfilter" domain_master) (form-update-activity "filter_senders" domain_master) (form-update-activity "mynetworks" domain_master) (form-update-activity "filter_recipients" domain_master) (form-update-activity "filtered_recipients" domain_master) (form-update-activity "pop3_imap" domain_master) (form-update-activity "apply_button" domain_master))) (define (ui-write) (catch/message (lambda() (apply woo-write "/postfix-dovecot" 'language (form-value "language") (form-value-list)) (ui-read) (update-effect)))) (define (init) (form-update-enum "mode" (woo-list "/postfix-dovecot/modes" 'language (form-value "language"))) (ui-read) (effect-show "relay" "mode" "relay") (effect-show "mx" "mode" "mx") (effect-show "recipients" "filter_recipients" #t) (init-effect) (form-bind "apply_button" "click" ui-write)) alterator-postfix-dovecot-0.7.1/ui/postfix-dovecot/index.html000064400000000000000000000077431222302465500244300ustar00rootroot00000000000000

SMTP Server

  Enable SMTP server
Operational mode:
Upstream SMTP host:
Domain list:
  (Send all outgoing mail to specified server)
  (Accept mail for these domains)
 
Root mail alias:
  (Root mail goes to this mailbox)
Maximum message size (MB):
  (Maximum message size in megabytes)

Security

Filter spam
Filter senders
  Local networks:
Filter recipients
 
(Filtered recipients)

POP3/IMAP Server

Enable POP3/IMAP server