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:
sudo nixos-rebuild test --flake .
@ -14,11 +14,3 @@ mu:
--my-address=e.litherlandsmith@icloud.com \
--my-address=evie.litherland-smith@ukaea.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.ssl.keystorePass=
davmail.proxyPassword=
davmail.oauth.tenantId=
davmail.oauth.clientId=
davmail.server=true
davmail.mode=O365Interactive
davmail.url=https://outlook.office365.com/EWS/Exchange.asmx
davmail.imapPort=1144
davmail.smtpPort=1026
davmail.caldavPort=1080
davmail.enableKeepAlive=true
davmail.logFilePath=/tmp/davmail.log
davmail.enableKerberos=false
davmail.folderSizeLimit=
davmail.forceActiveSyncUpdate=false
davmail.imapAutoExpunge=true
davmail.useSystemProxies=false
davmail.proxyUser=
davmail.caldavEditNotifications=false
davmail.ssl.nosecuresmtp=false
davmail.caldavPastDelay=0
davmail.ssl.keyPass=
log4j.logger.httpclient.wire=WARN
davmail.noProxyFor=
davmail.server=true
davmail.popMarkReadOnRetr=false
davmail.ssl.nosecureimap=false
davmail.disableTrayActivitySwitch=true
davmail.caldavAutoSchedule=true
davmail.enableProxy=false
davmail.proxyPort=
davmail.logFileSize=
davmail.mode=O365Interactive
davmail.smtpSaveInSent=true
davmail.bindAddress=
davmail.smtpSaveInSent=false
davmail.ssl.nosecurepop=false
davmail.ssl.pkcs11Library=
log4j.rootLogger=WARN
davmail.ssl.keystoreFile=
log4j.logger.davmail=DEBUG
davmail.ssl.clientKeystoreType=
davmail.clientSoTimeout=
davmail.ssl.pkcs11Config=
davmail.imapPort=1144
davmail.ssl.clientKeystorePass=
davmail.url=https://outlook.office365.com/EWS/Exchange.asmx
log4j.logger.org.apache.http.conn.ssl=WARN
davmail.sentKeepDelay=0
davmail.ssl.nosecureldap=false
davmail.imapAlwaysApproxMsgSize=true
davmail.ssl.nosecurecaldav=false
davmail.popPort=
davmail.defaultDomain=
davmail.showStartupBanner=false
log4j.logger.httpclient=WARN
davmail.proxyHost=
davmail.ldapPort=
davmail.server.certificate.hash=
log4j.logger.org.apache.http.wire=WARN
davmail.disableGuiNotifications=true
davmail.imapIdleDelay=
davmail.allowRemote=false
davmail.disableUpdateCheck=true
log4j.logger.org.apache.http=WARN
davmail.caldavPort=1080
davmail.enableKeepAlive=true
davmail.ssl.clientKeystoreFile=
davmail.logFilePath=/tmp/davmail.log
davmail.carddavReadPhoto=true
davmail.keepDelay=30
davmail.oauth.redirectUri=
davmail.caldavAlarmSound=

View file

@ -217,7 +217,13 @@
Service = {
Environment = [ "PATH=/run/current-system/sw/bin/:$PATH" ];
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" ];
};