mirror of
				https://github.com/Crazyco-xyz/48hr.email.git
				synced 2025-11-04 07:16:32 +01:00 
			
		
		
		
	Fix missing subject issues
This commit is contained in:
		
							parent
							
								
									5a1d7c038d
								
							
						
					
					
						commit
						38cd67f881
					
				
					 2 changed files with 8 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -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…
	
	Add table
		
		Reference in a new issue