This patch: 1. Copies unsent messages to the outbox before attempting to deliver them with SMTP 2. Deletes those messages once they're sent, or leaves them if an error occured 3. Updates the message list to make it obvious when there are unsent messages in the outbox
47 lines
1.4 KiB
HTML
47 lines
1.4 KiB
HTML
{{ define "mbox-link" }}
|
|
{{ if not (.HasAttr "\\Noselect") }}
|
|
<a href="{{.URL}}" {{ if .Active }}class="active"{{ end }}>
|
|
{{- if eq .Name "INBOX" -}}
|
|
Inbox
|
|
{{- else -}}
|
|
{{ .Name }}
|
|
{{- end -}}
|
|
{{- if .HasAttr "\\HasChildren" }}/{{ end }}
|
|
|
|
{{ if eq .Name "Outbox" }}
|
|
{{ if and (ne .Total -1) (ne .Total 0) }}({{ .Total }} unsent){{ end }}
|
|
{{ else }}
|
|
{{ if and (ne .Unseen -1) (ne .Unseen 0) }}({{ .Unseen }}){{ end }}
|
|
{{ end }}
|
|
</a>
|
|
{{ else }}
|
|
<span class="noselect">
|
|
{{.Name}}{{- if .HasAttr "\\HasChildren" }}/{{ end }}
|
|
</span>
|
|
{{ end }}
|
|
{{ end }}
|
|
|
|
{{ define "aside" }}
|
|
<aside>
|
|
<!-- the logo image, dimensions 200x32 may be present or not -->
|
|
<a href="/compose" class="new
|
|
{{ if eq $.GlobalData.URL.Path "/compose" }}active{{ end }}
|
|
">Compose Mail</a>
|
|
{{ with .CategorizedMailboxes }}
|
|
{{ with .Common.Inbox }}{{ template "mbox-link" . }}{{ end}}
|
|
{{ with .Common.Drafts }}{{ template "mbox-link" . }}{{ end}}
|
|
{{ with .Common.Outbox }}{{ template "mbox-link" . }}{{ end}}
|
|
{{ with .Common.Sent }}{{ template "mbox-link" . }}{{ end}}
|
|
{{ with .Common.Junk }}{{ template "mbox-link" . }}{{ end}}
|
|
{{ with .Common.Trash }}{{ template "mbox-link" . }}{{ end}}
|
|
{{ with .Common.Archive }}{{ template "mbox-link" . }}{{ end}}
|
|
{{ if .Additional }}
|
|
<hr />
|
|
{{ range .Additional }}
|
|
{{ template "mbox-link" . }}
|
|
{{ end }}
|
|
{{ end }}
|
|
{{ end }}
|
|
</aside>
|
|
{{ end }}
|