Changeset 3137


Ignore:
Timestamp:
04/13/12 11:57:28 (2 years ago)
Author:
squidly
Message:

Templating dovecot+Postifx + Bugfix

Location:
alternc/trunk
Files:
2 added
10 edited

Legend:

Unmodified
Added
Removed
  • alternc/trunk/debian/alternc.dirs

    r2997 r3137  
    99etc/postfix 
    1010etc/squirrelmail 
     11/etc/sudoers.d 
    1112usr/bin 
    1213usr/lib/alternc 
  • alternc/trunk/debian/alternc.postinst

    r2974 r3137  
    225225    # Update l18n files 
    226226    /usr/share/alternc/install/dopo.sh 
     227                 
     228                #sudo stuff allowing alterncpanel to use quota 
     229                if [ -d /etc/sudoers.d ]; then 
     230                        cp /etc/alternc/alternc-sudoers /etc/sudoers.d/alternc-sudoers 
     231                        chmod 0440 /etc/sudoers.d/alternc-sudoers 
     232                else 
     233                        echo "running an older version of sudo" 
     234                        echo "copy content of /usr/share/doc/aegir-provision/examples/example.sudoers into /etc/sudoers for aegir to run properly" 
     235          fi 
    227236 
    228237    # important: postinst gele sans ca 
  • alternc/trunk/debian/alternc.preinst

    r2949 r3137  
    66 
    77# Create AlternC Panel user for web server 
    8 addgroup --system --gid 1999 alterncpanel 
     8if ! getent group alterncpanel ; then 
     9        addgroup --system --gid 1999 alterncpanel 
     10fi 
     11if ! getent passwd alterncpanel ; then 
    912adduser --system --home "/etc/alternc/.alterncpanel" \ 
    1013  --disabled-password --uid 1999 --ingroup alterncpanel alterncpanel 
    11  
     14fi 
    1215case "$1" in 
    1316  install) 
  • alternc/trunk/debian/changelog

    r3132 r3137  
     1alternc (1.1+nmu2) stable; urgency=low 
     2 
     3  * Templating of dovecot and postfix 
     4        adding a view for dovecot usage (dovecot_view) 
     5        adding of user vmail dedicated to the mail system 
     6  * Bugfixes 
     7 
     8 -- root <root@debian-prime.in.nnx.com>  Sat, 03 Mar 2012 13:09:06 +0100 
     9 
    110alternc (1.1+nmu1) stable; urgency=low 
    211 
  • alternc/trunk/debian/control

    r3106 r3137  
    1111Architecture: all 
    1212Pre-depends: debconf (>= 0.5.00) | debconf-2.0 
    13 Depends: debianutils (>= 1.13.1), apache2-mpm-itk, libapache2-mod-php5, php5-mysql, phpmyadmin, postfix, proftpd-mod-mysql, proftpd-basic, squirrelmail, squirrelmail-locales, bind9, wget, rsync, quota, ca-certificates, locales, perl-suid, perl, postfix-mysql, wwwconfig-common, sasl2-bin, fam | gamin, libsasl2-modules, php5-cli, lockfile-progs (>= 0.1.9), gettext (>= 0.10.40-5), adduser, mysql-client, dnsutils, bash, acl, dovecot-common (>= 1:1.2.15), dovecot-imapd, dovecot-pop3d 
     13Depends: debianutils (>= 1.13.1), apache2-mpm-itk, libapache2-mod-php5, php5-mysql, phpmyadmin, postfix, proftpd-mod-mysql, proftpd-basic, squirrelmail, squirrelmail-locales, bind9, wget, rsync, quota, ca-certificates, locales, perl-suid, perl, postfix-mysql, wwwconfig-common, sasl2-bin, fam | gamin, libsasl2-modules, php5-cli, lockfile-progs (>= 0.1.9), gettext (>= 0.10.40-5), sudo, adduser, mysql-client, dnsutils, bash, acl, dovecot-common (>= 1:1.2.15), dovecot-imapd, dovecot-pop3d 
    1414Recommends: mysql-server, dovecot-managesieved, dovecot-sieve, dovecot-mysql 
    1515Conflicts: alternc-admintools, alternc-awstats (< 1.0), alternc-webalizer (<= 0.9.4), alternc-mailman (< 2.0), courier-authdaemon 
  • alternc/trunk/etc/alternc/templates/dovecot/dovecot-sql.conf

    r3005 r3137  
    117117#   user_query = SELECT home, 501 AS uid, 501 AS gid FROM users WHERE userid = '%u' 
    118118# 
    119 user_query = \ 
    120   SELECT concat(concat(%%ALTERNC_LOC%%, '/'), mailbox.path) AS home, domaines.compte AS uid, domaines.compte AS gid \ 
    121   FROM mailbox JOIN address ON address.id = mailbox.address_id JOIN domaines on domaines.id = address.domain_id WHERE '%u' IN (address.address, replace(address.address, '@', '_')) 
     119query = SELECT mailbox.path AS home, domaines.compte AS uid, domaines.compte AS gid FROM mailbox JOIN address ON address.id = mailbox.address_id JOIN domaines on domaines.id = address.domain_id WHERE address.address = '%n' 
    122120 
    123121# If you wish to avoid two SQL lookups (passdb + userdb), you can use 
     
    125123# also have to return userdb fields in password_query prefixed with "userdb_" 
    126124# string. For example: 
    127 password_query = \ 
    128   SELECT '%u' AS user, address.password, \ 
    129     concat(concat(%%ALTERNC_LOC%%, '/'), mailbox.path) AS userdb_home, domaines.compte AS userdb_uid, domaines.compte AS userdb_gid \ 
    130   FROM mailbox JOIN address ON address.id = mailbox.address_id JOIN domaines on domaines.id = address.domain_id WHERE '%u' IN (address.address, replace(address.address, '@', '_')) 
     125password_query = SELECT user, password, userdb_home, userdb_uid, userdb_gid,userdb_quota_rule FROM dovecot_view where user= '%u';  
    131126 
  • alternc/trunk/etc/alternc/templates/dovecot/dovecot.conf

    r2799 r3137  
    5151# matches the local IP (ie. you're connecting from the same computer), the 
    5252# connection is considered secure and plaintext authentication is allowed. 
    53 disable_plaintext_auth = no 
     53disable_plaintext_auth = yes 
    5454 
    5555# Should all IMAP and POP3 processes be killed when Dovecot master process 
     
    9393 
    9494# SSL/TLS support: yes, no, required. </usr/share/doc/dovecot-common/wiki/SSL.txt> 
    95 #ssl = yes 
     95ssl = required 
    9696 
    9797# PEM encoded X.509 SSL/TLS certificate and private key. They're opened before 
    9898# dropping root privileges, so keep the key file unreadable by anyone but 
    9999# root. 
    100 #ssl_cert_file = /etc/ssl/certs/dovecot.pem 
    101 ssl_cert_file = /etc/alternc/apache.pem 
    102 #ssl_key_file = /etc/ssl/private/dovecot.pem 
    103 ssl_key_file = /etc/alternc/apache.pem 
     100ssl_cert_file = /etc/ssl/certs/dovecot.pem 
     101#ssl_cert_file = /etc/alternc/apache.pem 
     102ssl_key_file = /etc/ssl/private/dovecot.pem 
     103#ssl_key_file = /etc/alternc/apache.pem 
    104104 
    105105# If key file is password protected, give the password here. Alternatively 
     
    247247# without a location setting. Default namespace is simply done by having a 
    248248# namespace with empty prefix. 
    249 namespace private { 
     249#namespace private { 
    250250   # Hierarchy separator to use. You should use the same separator for all 
    251251   # namespaces or some clients get confused. '/' is usually a good one. 
    252252   # The default however depends on the underlying mail storage format. 
    253    separator = .  
     253   # separator = .  
    254254 
    255255   # Prefix required to access this namespace. This needs to be different for 
    256256   # all namespaces. For example "Public/". 
    257    prefix = INBOX. 
     257   # prefix = INBOX. 
    258258 
    259259   # Physical location of the mailbox. This is in same format as 
     
    263263   # There can be only one INBOX, and this setting defines which namespace 
    264264   # has it. 
    265    inbox = yes 
     265   #inbox = yes 
    266266 
    267267   # If namespace is hidden, it's not advertised to clients via NAMESPACE 
     
    280280   # namespace handles them (empty prefix should always have this as "yes") 
    281281   #subscriptions = yes 
    282 } 
     282#} 
    283283 
    284284# Example shared namespace configuration 
     
    385385# Note that denying root logins is hardcoded to dovecot binary and can't 
    386386# be done even if first_valid_uid is set to 0. 
    387 first_valid_uid = 33 
    388 last_valid_uid = 33 
     387first_valid_uid = 2000 
     388last_valid_uid = 65000 
    389389 
    390390# Valid GID range for users, defaults to non-root/wheel. Users having 
     
    580580  # list of plugins to load. 
    581581  #mail_plugins =  
     582  mail_plugins = quota imap_quota  
    582583  #mail_plugin_dir = /usr/lib/dovecot/modules/imap 
    583584 
     
    699700  # list of plugins to load. 
    700701  #mail_plugins =  
     702  mail_plugins = quota  
    701703  #mail_plugin_dir = /usr/lib/dovecot/modules/pop3 
    702704 
     
    722724  # ManageSieve executable location. See IMAP's mail_executable above for 
    723725  # examples how this could be changed. 
    724   #mail_executable = /usr/lib/dovecot/managesieve 
     726  mail_executable = /usr/lib/dovecot/managesieve 
    725727 
    726728  # Maximum ManageSieve command line length in bytes. This setting is 
     
    762764  # Support for dynamically loadable plugins. mail_plugins is a space separated 
    763765  # list of plugins to load. 
    764   mail_plugins = sieve 
    765   mail_plugin_dir = /usr/lib/dovecot/modules/lda 
     766  mail_plugins = quota sieve 
     767  #mail_plugin_dir = /usr/lib/dovecot/modules/lda 
    766768 
    767769  # If user is over quota, return with temporary failure instead of 
     
    777779 
    778780  # Binary to use for sending mails. 
    779   sendmail_path = /usr/sbin/sendmail 
     781  #sendmail_path = /usr/sbin/sendmail 
    780782 
    781783  # Subject: header to use for rejection mails. You can use the same variables 
     
    796798 
    797799# Executable location 
    798 auth_executable = /usr/lib/dovecot/dovecot-auth 
     800#auth_executable = /usr/lib/dovecot/dovecot-auth 
    799801 
    800802# Set max. process size in megabytes. 
     
    893895  #   gss-spnego 
    894896  # NOTE: See also disable_plaintext_auth setting. 
    895   mechanisms = plain 
     897  mechanisms = plain login 
    896898 
    897899  # 
     
    10331035  # configuration files for more information how to do it. 
    10341036  # </usr/share/doc/dovecot-common/wiki/UserDatabase.Prefetch.txt> 
    1035   #userdb prefetch { 
    1036   #} 
     1037  userdb prefetch { 
     1038  } 
    10371039 
    10381040  # System users (NSS, /etc/passwd, or similiar). In many systems nowadays this 
     
    11011103  # requires roots. Note that this user is NOT used to access mails. 
    11021104  # That user is specified by userdb above. 
    1103   user = mail 
     1105  user = vmail 
    11041106 
    11051107  # Directory where to chroot the process. Most authentication backends don't 
     
    11281130      mode = 0666 
    11291131      # Default user/group is the one who started dovecot-auth (root) 
    1130       #user =  
     1132      user = vmail  
    11311133      #group =  
    11321134    } 
     
    11671169 
    11681170dict { 
    1169   #quota = mysql:/etc/dovecot/dovecot-dict-quota.conf 
     1171  quota = mysql:/etc/dovecot/dovecot-dict-quota.conf 
    11701172  #expire = db:/var/lib/dovecot/expire.db 
    11711173} 
     
    11931195  # userdb. It's also possible to give mailbox-specific limits, for example: 
    11941196  #   quota_rule = *:storage=1048576 
     1197     quota_rule = *:storage=100M 
    11951198  #   quota_rule2 = Trash:storage=102400 
    11961199  # User has now 1GB quota, but when saving to Trash mailbox the user gets 
     
    12101213  # Note that % needs to be escaped as %%, otherwise "% " expands to empty. 
    12111214  #   quota_warning = storage=95%% /usr/local/bin/quota-warning.sh 95 
     1215  #   quota_warning = storage=95%% /usr/local/bin/quota-warning.sh 95 
    12121216  #   quota_warning2 = storage=80%% /usr/local/bin/quota-warning.sh 80 
     1217     quota_warning = storage=80%% /usr/local/bin/quota-warning.sh 80 
    12131218  #quota = maildir 
     1219  quota = dict:user:proxy::quotadict 
    12141220 
    12151221  # ACL plugin. vfile backend reads ACLs from "dovecot-acl" file from maildir 
  • alternc/trunk/etc/alternc/templates/postfix/myalias.cf

    r2990 r3137  
    77hosts =%%dbhost%% 
    88dbname = %%dbname%% 
    9 query = select concat(if(isnull(mailbox.id), '', concat(address.address, '\n')), recipient.recipient) from recipient join address on address.id = recipient.address_id left outer join mailbox on mailbox.address_id = address.id where address.address='%s'; 
     9query = select concat( if(isnull(mailbox.id), '', concat(concat(address.address,'@',domaines.domaine), '\n')), recipient.recipients ) from recipient join address on address.id = re 
     10cipient.address_id left outer join mailbox on mailbox.address_id = address.id join domaines on domaines.id = address.domain_id where concat(address.address,'@',domaines.domaine)='% 
     11s'; 
     12  
    1013 
  • alternc/trunk/etc/alternc/templates/postfix/myvirtual.cf

    r2990 r3137  
    77hosts =%%dbhost%% 
    88dbname = %%dbname%% 
    9 select concat(path, '/Maildir/') from mailbox join address on address.id = mailbox.address_id where address.address='%s' 
     9query = select concat(path, '/Maildir/') from mailbox join address on address.id = mailbox.address_id join domaines on domaines.id = address.domain_id where concat(address.address, 
     10'@',domaines.domaine) ='%s'; 
    1011 
  • alternc/trunk/install/mysql.sql

    r3136 r3137  
    639639  KEY `uid` (`uid`) 
    640640) ENGINE=MyISAM  DEFAULT CHARSET=latin1; 
     641 
     642 
     643 
     644-- 
     645-- Structure de la vue `dovecot-view` 
     646-- 
     647 
     648CREATE VIEW `dovecot_view` AS 
     649SELECT concat(`address`.`address`,'@',`domaines`.`domaine`) AS `user`, 
     650concat('*:storage=',cast(`mailbox`.`quota` as char charset latin1),'M') AS `userdb_quota_rule`, 
     651`address`.`password` AS `password`, 
     652`mailbox`.`path` AS `userdb_home`, 
     653`domaines`.`compte` AS `userdb_uid`, 
     654`domaines`.`compte` AS `userdb_gid`, 
     655`mailbox`.`bytes` AS `quota_dovecot`, 
     656`mailbox`.`messages` AS `nb_messages`  
     657from ((`mailbox` 
     658join `address` on((`address`.`id` = `mailbox`.`address_id`)))  
     659join `domaines` on((`domaines`.`id` = `address`.`domain_id`))); 
     660 
Note: See TracChangeset for help on using the changeset viewer.