Fix missing subject issues
parent
5a1d7c038d
commit
38cd67f881
|
@ -254,6 +254,8 @@ class ImapService extends EventEmitter {
|
||||||
.map(addressObj => addressObj.address)
|
.map(addressObj => addressObj.address)
|
||||||
|
|
||||||
const from = headerPart.from.flatMap(from => addressparser(from))
|
const from = headerPart.from.flatMap(from => addressparser(from))
|
||||||
|
|
||||||
|
// Specify default subject, in case none exists.
|
||||||
let subject = "No Subject"
|
let subject = "No Subject"
|
||||||
try {
|
try {
|
||||||
subject = headerPart.subject[0]
|
subject = headerPart.subject[0]
|
||||||
|
|
|
@ -33,6 +33,12 @@ router.get(
|
||||||
req.params.uid
|
req.params.uid
|
||||||
)
|
)
|
||||||
if (mail) {
|
if (mail) {
|
||||||
|
|
||||||
|
// Set a default subject if none is present
|
||||||
|
if (!mail.subject) {
|
||||||
|
mail.subject = 'No Subject'
|
||||||
|
}
|
||||||
|
|
||||||
// Emails are immutable, cache if found
|
// Emails are immutable, cache if found
|
||||||
res.set('Cache-Control', 'private, max-age=600')
|
res.set('Cache-Control', 'private, max-age=600')
|
||||||
res.render('mail', {
|
res.render('mail', {
|
||||||
|
|
Loading…
Reference in New Issue