davmail service now copies properties file if it doesn't exist already

This commit is contained in:
Evie Litherland-Smith 2023-10-08 09:49:07 +01:00
parent f84084edcd
commit 9ce0fac4e9
3 changed files with 16 additions and 45 deletions

View file

@ -1,4 +1,4 @@
.PHONY: test build mu all .PHONY: test build mu
test: test:
sudo nixos-rebuild test --flake . sudo nixos-rebuild test --flake .
@ -14,11 +14,3 @@ mu:
--my-address=e.litherlandsmith@icloud.com \ --my-address=e.litherlandsmith@icloud.com \
--my-address=evie.litherland-smith@ukaea.uk \ --my-address=evie.litherland-smith@ukaea.uk \
--my-address=elitherl@jet.uk --my-address=elitherl@jet.uk
.davmail.properties:
touch $@
~/.davmail.properties: .davmail.properties
cp $? $@
all: mu ~/.davmail.properties

View file

@ -1,66 +1,39 @@
davmail.ssl.keystoreType= davmail.server=true
davmail.ssl.keystorePass= davmail.mode=O365Interactive
davmail.proxyPassword= davmail.url=https://outlook.office365.com/EWS/Exchange.asmx
davmail.oauth.tenantId= davmail.imapPort=1144
davmail.oauth.clientId=
davmail.smtpPort=1026 davmail.smtpPort=1026
davmail.caldavPort=1080
davmail.enableKeepAlive=true
davmail.logFilePath=/tmp/davmail.log
davmail.enableKerberos=false davmail.enableKerberos=false
davmail.folderSizeLimit=
davmail.forceActiveSyncUpdate=false davmail.forceActiveSyncUpdate=false
davmail.imapAutoExpunge=true davmail.imapAutoExpunge=true
davmail.useSystemProxies=false davmail.useSystemProxies=false
davmail.proxyUser=
davmail.caldavEditNotifications=false davmail.caldavEditNotifications=false
davmail.ssl.nosecuresmtp=false davmail.ssl.nosecuresmtp=false
davmail.caldavPastDelay=0 davmail.caldavPastDelay=0
davmail.ssl.keyPass=
log4j.logger.httpclient.wire=WARN log4j.logger.httpclient.wire=WARN
davmail.noProxyFor=
davmail.server=true
davmail.popMarkReadOnRetr=false davmail.popMarkReadOnRetr=false
davmail.ssl.nosecureimap=false davmail.ssl.nosecureimap=false
davmail.disableTrayActivitySwitch=true davmail.disableTrayActivitySwitch=true
davmail.caldavAutoSchedule=true davmail.caldavAutoSchedule=true
davmail.enableProxy=false davmail.enableProxy=false
davmail.proxyPort= davmail.smtpSaveInSent=false
davmail.logFileSize=
davmail.mode=O365Interactive
davmail.smtpSaveInSent=true
davmail.bindAddress=
davmail.ssl.nosecurepop=false davmail.ssl.nosecurepop=false
davmail.ssl.pkcs11Library=
log4j.rootLogger=WARN log4j.rootLogger=WARN
davmail.ssl.keystoreFile=
log4j.logger.davmail=DEBUG log4j.logger.davmail=DEBUG
davmail.ssl.clientKeystoreType=
davmail.clientSoTimeout=
davmail.ssl.pkcs11Config=
davmail.imapPort=1144
davmail.ssl.clientKeystorePass= davmail.ssl.clientKeystorePass=
davmail.url=https://outlook.office365.com/EWS/Exchange.asmx
log4j.logger.org.apache.http.conn.ssl=WARN log4j.logger.org.apache.http.conn.ssl=WARN
davmail.sentKeepDelay=0 davmail.sentKeepDelay=0
davmail.ssl.nosecureldap=false davmail.ssl.nosecureldap=false
davmail.imapAlwaysApproxMsgSize=true davmail.imapAlwaysApproxMsgSize=true
davmail.ssl.nosecurecaldav=false davmail.ssl.nosecurecaldav=false
davmail.popPort=
davmail.defaultDomain=
davmail.showStartupBanner=false davmail.showStartupBanner=false
log4j.logger.httpclient=WARN log4j.logger.httpclient=WARN
davmail.proxyHost=
davmail.ldapPort=
davmail.server.certificate.hash=
log4j.logger.org.apache.http.wire=WARN log4j.logger.org.apache.http.wire=WARN
davmail.disableGuiNotifications=true davmail.disableGuiNotifications=true
davmail.imapIdleDelay=
davmail.allowRemote=false
davmail.disableUpdateCheck=true davmail.disableUpdateCheck=true
log4j.logger.org.apache.http=WARN log4j.logger.org.apache.http=WARN
davmail.caldavPort=1080
davmail.enableKeepAlive=true
davmail.ssl.clientKeystoreFile=
davmail.logFilePath=/tmp/davmail.log
davmail.carddavReadPhoto=true davmail.carddavReadPhoto=true
davmail.keepDelay=30 davmail.keepDelay=30
davmail.oauth.redirectUri=
davmail.caldavAlarmSound=

View file

@ -217,7 +217,13 @@
Service = { Service = {
Environment = [ "PATH=/run/current-system/sw/bin/:$PATH" ]; Environment = [ "PATH=/run/current-system/sw/bin/:$PATH" ];
Restart = "always"; Restart = "always";
ExecStart = "${pkgs.davmail}/bin/davmail -notray"; ExecStartPre = with config.home; ''
/bin/sh -c "if [ ! -f ${homeDirectory}/.davmail.properties ]; then cp ${
./.davmail.properties
} ${homeDirectory}/.davmail.properties; fi"
'';
ExecStart =
"${pkgs.davmail}/bin/davmail -notray ${config.home.homeDirectory}/.davmail.properties";
}; };
Install.WantedBy = [ "default.target" ]; Install.WantedBy = [ "default.target" ];
}; };