# Update notes: # 1) atmail.conf needs to be updated manually # 2) if paths change, look at other conf files Summary: The @mail webmail adopted for Plesk Name: psa-atmail Version: 1.05 Release: 5 Epoch: 1 License: Apache 2.0 Group: Web URL: http://atmail.org/ Packager: Scott R. Shinn #Source0: atmailwebmaillite.tgz Source0: atmailopen.tgz Source1: atmail.conf Source2: atmail_vhost.conf Source3: create_db.sql.in Source4: atmailcom_vhost.conf Patch1: config-changes.patch Patch2: getmail-ie.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildArch: noarch Requires: psa >= 9.0 Requires: psa-php-configurator Requires(post): /sbin/chkconfig Requires(preun): /sbin/service, /sbin/chkconfig Requires(postun): /sbin/service %description @Mail provides a complete Webmail system for existing POP3/IMAP accounts. Use the software as a professional Webmail interface for existing customers and provide more then just standard Webmail. http://www.atmail.com %prep %setup -n atmailopen %patch1 -p1 %patch2 -p1 %build mv libs/Atmail/Config.php.default libs/Atmail/Config.php %install %{__rm} -rf %{buildroot} %{__mkdir} -p %{buildroot}/var/www/atmail/ %{__cp} -r * %{buildroot}/var/www/atmail/ %{__mkdir} -p %{buildroot}%{_sysconfdir}/psa-webmail/atmail/ %{__mkdir} -p %{buildroot}%{_sysconfdir}/psa-webmail/atmail/conf.d %{__mkdir} -p %{buildroot}%{_sysconfdir}/psa-webmail/atmailcom %{__mkdir} -p %{buildroot}%{_sysconfdir}/psa-webmail/atmailcom/conf.d %{__mkdir} -p %{buildroot}/var/log/atmail %{__install} -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/psa-webmail/atmail/atmail.conf %{__install} -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/psa-webmail/atmail/atmail_vhost.conf %{__install} -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/psa-webmail/atmail/create_db.sql.in %{__install} -m 0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/psa-webmail/atmailcom/atmailcom_vhost.conf %clean %{__rm} -rf %{buildroot} %post if [ $1 -lt 1 ]; then # Install Databases, Create User, Generate password atmail_password=`tr -dc "[:alnum:]" < /dev/urandom | head -c 16` cat /etc/psa-webmail/atmail/create_db.sql.in | sed -e "s|@ATMAIL_PASSWORD@|$atmail_password|g" | \ mysql -u admin -p`cat /etc/psa/.psa.shadow` cat /var/www/atmail/install/atmail.mysql | mysql -u admin -p`cat /etc/psa/.psa.shadow` atmail # This is an upgrade else /usr/local/psa/admin/bin/webmailmng --remove --name="atmail" cd /var/www/atmail /usr/local/psa/bin/php-cli -f upgrade.php >/dev/null fi # Register to plesk /usr/local/psa/admin/bin/webmailmng --install --name="atmail" # Plesk 9.2.3 backwards compatibility, this is a dirty check to see if we're on an older version if [ -d /etc/psa/webmail ]; then # Dirty check, if the file isnt there, we'll just blow everything away and re-link it if [ ! -f /etc/psa/webmail/atmail/.atmail.shadow ]; then if [ -d /etc/psa/webmail/atmail ]; then rm -rf /etc/psa/webmail/atmail fi if [ -d /etc/psa/webmail/atmailcom ]; then rm -rf /etc/psa/webmail/atmailcom fi ln -sf /etc/psa-webmail/atmail* /etc/psa/webmail/ fi fi %postun if [ $1 = 0 ]; then /usr/local/psa/admin/bin/webmailmng --remove --name="atmail" fi %files %defattr(-, root, root, 0755) %dir /var/www/atmail %dir /var/log/atmail /var/www/atmail/ #%attr(0710, apache,apache) /var/www/atmail/users/tmp /etc/psa-webmail/atmail/ /etc/psa-webmail/atmailcom/ %changelog * Mon Apr 30 2012 Scott R. Shinn - 1.05-2 - actually apply the config file patch * Fri Apr 20 2012 Scott R. Shinn - 1.05-1 - Update to 1.05 * Sun Sep 12 2010 Scott R. Shinn - 1.04-1 - Update to 1.04 * Wed Jan 13 2010 Scott R. Shinn - 1.03-6 - Fixed config files to use the plesk 9.2.3+ layout - Updated atmail code to look for password file in either /etc/psa or /etc/psa-webmail * Wed Jan 6 2010 Scott R. Shinn - 1.03-4 - Added Config-php-2.patch from Gazoo to adjust for the new paths in psa 9.2.3 - Because of a path change, this package now requires PSA 9.2.3 * Thu Dec 10 2009 Scott R. Shinn - 1.03-3 - Added patch from Gazoo (an unsung #plesk hero) for IE where special characters in the from/to/subject line would prevent IE from logging in. * Thu Aug 6 2009 Scott R. Shinn - 1.03-2 - changed to atmailopen - modified permissions on /var/www/atmail/users/tmp to 0710 * Thu Feb 26 2009 Scott R. Shinn - 1.02-2 - Initial update attempt