From 591ebd877b8d5465da95fd7e212da5ef747944ca Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Mon, 28 Jan 2019 00:46:11 +0100 Subject: [PATCH] Configure mailer spool for tools Fixes https://git.immae.eu/mantisbt/view.php?id=104 --- nixops/modules/websites/tools/diaspora/diaspora.nix | 4 ++-- .../modules/websites/tools/git/mantisbt/mantisbt.nix | 4 ++-- nixops/modules/websites/tools/mastodon/mastodon.nix | 7 ++++--- nixops/modules/websites/tools/tools/ttrss.nix | 5 ----- nixops/modules/websites/tools/tools/wallabag.nix | 10 +++++++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/nixops/modules/websites/tools/diaspora/diaspora.nix b/nixops/modules/websites/tools/diaspora/diaspora.nix index 765c0a5..74be4fe 100644 --- a/nixops/modules/websites/tools/diaspora/diaspora.nix +++ b/nixops/modules/websites/tools/diaspora/diaspora.nix @@ -69,10 +69,10 @@ let mail: enable: true sender_address: 'diaspora@immae.eu' - method: 'smtp' + method: 'sendmail' smtp: - host: 'mail.immae.eu' sendmail: + location: '/run/wrappers/bin/sendmail' admins: account: "ismael" podmin_email: 'diaspora@immae.eu' diff --git a/nixops/modules/websites/tools/git/mantisbt/mantisbt.nix b/nixops/modules/websites/tools/git/mantisbt/mantisbt.nix index c6c3bff..b1837eb 100644 --- a/nixops/modules/websites/tools/git/mantisbt/mantisbt.nix +++ b/nixops/modules/websites/tools/git/mantisbt/mantisbt.nix @@ -30,8 +30,8 @@ let $g_allow_anonymous_login = ON; $g_anonymous_account = 'anonymous'; - $g_phpMailer_method = PHPMAILER_METHOD_SMTP; - $g_smtp_host = 'mail.immae.eu'; + $g_phpMailer_method = PHPMAILER_METHOD_SENDMAIL; + $g_smtp_host = 'localhost'; $g_smtp_username = '''; $g_smtp_password = '''; $g_webmaster_email = 'webmaster@immae.eu'; diff --git a/nixops/modules/websites/tools/mastodon/mastodon.nix b/nixops/modules/websites/tools/mastodon/mastodon.nix index 770aa2c..8650ee3 100644 --- a/nixops/modules/websites/tools/mastodon/mastodon.nix +++ b/nixops/modules/websites/tools/mastodon/mastodon.nix @@ -84,10 +84,9 @@ let VAPID_PRIVATE_KEY=${env.vapid.private} VAPID_PUBLIC_KEY=${env.vapid.public} - SMTP_SERVER=mail.immae.eu - SMTP_PORT=587 + SMTP_DELIVERY_METHOD=sendmail SMTP_FROM_ADDRESS=notifications@mastodon.immae.eu - SMTP_DELIVERY_METHOD=smtp + SENDMAIL_LOCATION="/run/wrappers/bin/sendmail" PAPERCLIP_ROOT_PATH=${varDir} STREAMING_CLUSTER_NUM=1 @@ -115,6 +114,8 @@ let cp -a $mastodon $out cd $out chmod u+rwX . public + chmod -R u+rwX config/ + sed -i -e 's@^end$@ config.action_mailer.sendmail_settings = { location: ENV.fetch("SENDMAIL_LOCATION", "/usr/sbin/sendmail") }\nend@' config/environments/production.rb RAILS_ENV=production ${gems}/bin/rails assets:precompile rm -rf tmp/cache ln -sf ../../../../../../../${varDir}/tmp/cache tmp diff --git a/nixops/modules/websites/tools/tools/ttrss.nix b/nixops/modules/websites/tools/tools/ttrss.nix index 95cca9d..9e6f98d 100644 --- a/nixops/modules/websites/tools/tools/ttrss.nix +++ b/nixops/modules/websites/tools/tools/ttrss.nix @@ -97,11 +97,6 @@ let define('REG_NOTIFY_ADDRESS', 'outils@immae.eu'); define('REG_MAX_USERS', 10); - define('SMTP_SERVER', 'mail.immae.eu:25'); - define('SMTP_LOGIN', '''); - define('SMTP_PASSWORD', '''); - define('SMTP_SECURE', 'tls'); - define('SMTP_FROM_NAME', 'Tiny Tiny RSS'); define('SMTP_FROM_ADDRESS', 'outils@immae.eu'); define('DIGEST_SUBJECT', '[tt-rss] New headlines for last 24 hours'); diff --git a/nixops/modules/websites/tools/tools/wallabag.nix b/nixops/modules/websites/tools/tools/wallabag.nix index 4bda808..1c08bbf 100644 --- a/nixops/modules/websites/tools/tools/wallabag.nix +++ b/nixops/modules/websites/tools/tools/wallabag.nix @@ -17,8 +17,8 @@ let database_socket: null database_charset: utf8 domain_name: https://tools.immae.eu/wallabag - mailer_transport: smtp - mailer_host: mail.immae.eu + mailer_transport: sendmail + mailer_host: 127.0.0.1 mailer_user: null mailer_password: null locale: fr @@ -55,6 +55,10 @@ let ldap_email_attribute: mail ldap_name_attribute: cn ldap_enabled_attribute: null + services: + swiftmailer.mailer.default.transport: + class: Swift_SendmailTransport + arguments: ['/run/wrappers/bin/sendmail -bs'] ''; webappDir = composerEnv.buildPackage rec { packages = { @@ -172,7 +176,7 @@ let ; Needed to avoid clashes in browser cookies (same domain) php_value[session.name] = WallabagPHPSESSID - php_admin_value[open_basedir] = "${basedir}:/tmp" + php_admin_value[open_basedir] = "/run/wrappers/bin/sendmail:${basedir}:/tmp" php_value[max_execution_time] = 300 ''; }; -- 2.41.0