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