]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Configure mailer spool for tools
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Sun, 27 Jan 2019 23:46:11 +0000 (00:46 +0100)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Sun, 27 Jan 2019 23:46:11 +0000 (00:46 +0100)
Fixes https://git.immae.eu/mantisbt/view.php?id=104

nixops/modules/websites/tools/diaspora/diaspora.nix
nixops/modules/websites/tools/git/mantisbt/mantisbt.nix
nixops/modules/websites/tools/mastodon/mastodon.nix
nixops/modules/websites/tools/tools/ttrss.nix
nixops/modules/websites/tools/tools/wallabag.nix

index 765c0a51ad2a8c5f09a92d5d1b9b36f1c9df0ca3..74be4fe998b19445a80b99962d672759cd201fde 100644 (file)
@@ -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'
index c6c3bff60ea5a31c8bb553753046210f6907a8bb..b1837eb49e2f09a4c587b1fe55a3a24acd538076 100644 (file)
@@ -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';
index 770aa2cb5b584cf3157ae92a7116206a4a032c85..8650ee310b860e9e28e5d6780b60b421c69aa771 100644 (file)
@@ -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
index 95cca9d68f819eb20860874e0f102304abf2081d..9e6f98d4be435f3243dada8138660c710e72893c 100644 (file)
@@ -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');
index 4bda8089a5d3df7c196a25e4f5f71209478defaf..1c08bbf63baabfafc74a0ef7279e896b0bbffffd 100644 (file)
@@ -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
         '';
     };