mirror of
				https://github.com/Ylianst/MeshCentral.git
				synced 2025-03-09 15:40:18 +00:00 
			
		
		
		
	Sendmail fix, #3299
This commit is contained in:
		
							parent
							
								
									a8cba854de
								
							
						
					
					
						commit
						51744bb277
					
				
					 2 changed files with 8 additions and 3 deletions
				
			
		|  | @ -1606,6 +1606,11 @@ function CreateMeshCentralServer(config, args) { | |||
|                     obj.mailserver = require('./meshmail.js').CreateMeshMail(obj); | ||||
|                     obj.mailserver.verify(); | ||||
|                     if (obj.args.lanonly == true) { addServerWarning("SMTP server has limited use in LAN mode.", 18); } | ||||
|                 } else if (obj.config.sendmail != null) { | ||||
|                     // Sendmail server
 | ||||
|                     obj.mailserver = require('./meshmail.js').CreateMeshMail(obj); | ||||
|                     obj.mailserver.verify(); | ||||
|                     if (obj.args.lanonly == true) { addServerWarning("Sendmail has limited use in LAN mode.", 18); } | ||||
|                 } | ||||
| 
 | ||||
|                 // Setup the email server for each domain
 | ||||
|  |  | |||
|  | @ -56,9 +56,9 @@ module.exports.CreateMeshMail = function (parent, domain) { | |||
|         // Setup Sendmail
 | ||||
|         const nodemailer = require('nodemailer'); | ||||
|         var options = { sendmail: true }; | ||||
|         if (typeof obj.config.smtp.newline == 'string') { options.newline = obj.config.smtp.newline; } | ||||
|         if (typeof obj.config.smtp.path == 'string') { options.path = obj.config.smtp.path; } | ||||
|         if (Array.isArray(obj.config.smtp.args)) { options.args = obj.config.smtp.args; } | ||||
|         if (typeof obj.config.sendmail.newline == 'string') { options.newline = obj.config.sendmail.newline; } | ||||
|         if (typeof obj.config.sendmail.path == 'string') { options.path = obj.config.sendmail.path; } | ||||
|         if (Array.isArray(obj.config.sendmail.args)) { options.args = obj.config.sendmail.args; } | ||||
|         obj.smtpServer = nodemailer.createTransport(options); | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue