zpush/owncloud: inject mail using 'sendmail' not SMTP

This commit is contained in:
Joshua Tauberer 2014-08-12 11:18:45 +00:00
parent 7b81ea1834
commit cf4f519cc0
3 changed files with 11 additions and 18 deletions

View file

@ -32,7 +32,7 @@ define('IMAP_FROM_LDAP_FROM', '#givenname #sn <#mail>');
define('IMAP_SENTFOLDER', '');
define('IMAP_INLINE_FORWARD', true);
define('IMAP_EXCLUDED_FOLDERS', '');
define('IMAP_SMTP_METHOD', 'smtp');
define('IMAP_SMTP_METHOD', 'sendmail');
global $imap_smtp_params;
$imap_smtp_params = array('host' => 'ssl://localhost', 'port' => 587, 'auth' => true, 'username' => 'imap_username', 'password' => 'imap_password');

View file

@ -38,16 +38,16 @@ if [ ! -f "/usr/local/lib/owncloud/config/config.php" ]; then
"memcached_servers" => array (
array('localhost', 11211),
),
'mail_smtpmode' => 'smtp',
'mail_smtpsecure' => 'tls',
'mail_from_address' => 'no-reply',
'mail_domain' => '$PRIMARY_HOSTNAME',
'mail_smtpmode' => 'sendmail',
'mail_smtpsecure' => '',
'mail_smtpauthtype' => 'LOGIN',
'mail_smtpauth' => true,
'mail_smtphost' => 'localhost',
'mail_smtpport' => '587',
'mail_smtpname' => 'no-reply@$PRIMARY_HOSTNAME',
'mail_smtppassword' => '$SECRET_PASSWORD',
'mail_smtpauth' => false,
'mail_smtphost' => '',
'mail_smtpport' => '',
'mail_smtpname' => '',
'mail_smtppassword' => '',
'mail_from_address' => 'owncloud',
'mail_domain' => '$PRIMARY_HOSTNAME',
'logtimezone' => '$TIMEZONE',
);
?>
@ -78,4 +78,4 @@ chmod -R 777 /usr/local/lib/owncloud/apps/mail/vendor/ezyang/htmlpurifier/librar
(crontab -u www-user -l; echo "*/15 * * * * php -f /usr/local/lib/owncloud/cron.php" ) | crontab -u www-user -
php5enmod imap
restart_service php5-fpm
restart_service php5-fpm

View file

@ -250,15 +250,11 @@ if [ -z "$STORAGE_ROOT" ]; then
chown $STORAGE_USER.$STORAGE_USER $STORAGE_ROOT/mailinabox.version
fi
# Generate a secret password to use with no-reply user (mainly for ownCloud SMTP atm)
SECRET_PASSWORD=$(dd if=/dev/random bs=20 count=1 2>/dev/null | base64 | fold -w 24 | head -n 1)
# Save the global options in /etc/mailinabox.conf so that standalone
# tools know where to look for data.
cat > /etc/mailinabox.conf << EOF;
STORAGE_USER=$STORAGE_USER
STORAGE_ROOT=$STORAGE_ROOT
SECRET_PASSWORD=$SECRET_PASSWORD
PRIMARY_HOSTNAME=$PRIMARY_HOSTNAME
PUBLIC_IP=$PUBLIC_IP
PUBLIC_IPV6=$PUBLIC_IPV6
@ -323,8 +319,5 @@ if [ -z "`tools/mail.py user`" ]; then
# Create an alias to which we'll direct all automatically-created administrative aliases.
tools/mail.py alias add administrator@$PRIMARY_HOSTNAME $EMAIL_ADDR
# Create an no-reply user to use with ownCloud
tools/mail.py user add no-reply@$PRIMARY_HOSTNAME $SECRET_PASSWORD
fi