Jump to content
Froxlor Forum
  • 0

Enable Auth on SMTP


elliotberg

Question

I'm trying to enable authentication for mail as we don't allow unauthenticated SMTP mail, or allow the www-data user to submit mail as it's a shared web server (hence running Froxlor). I've set the following in lib/classes/phpmailer/class.PHPMailer.php:

 

public $SMTPSecure = 'tls';
public $SMTPAuth = true;
public $Username = 'user@mydomain.not.real';
public $Password = 'thisisasecurestring';

 

but it still appears to be trying to use php's mail function, as I'm seeing these entries in the mail log when trying to send, and Froxlor's interface reports a failure:

 

postfix/sendmail[18871]: fatal: User www-data(33) is not allowed to submit mail

 

It means that whenever our support staff create customers or email accounts, they receive errors, and the interface doesn't handle it properly so you have to login again.

 

Can anyone point me in the right direction? We're running version 0.9.34, with a minor and completely unrelated local modification to allow all users to alias their domains to a domain owned by another user, as we run a Wordpress network but still want the customers to be able to manage their own email. It's a bit ugly, but shouldn't be causing any issues as far as this is concerned, and works fine.

 

Thanks in advance!

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

after every occurance of "new PHPMailer(true);", in these files:
 

/var/www/froxlor/lib/init.php:$mail = new PHPMailer(true);
/var/www/froxlor/lib/functions/output/function.dieWithMail.php: $_mail = new PHPMailer(true);
/var/www/froxlor/scripts/jobs/cron_usage_report.php:$mail = new PHPMailer(true);


do this:
 

$mail->isSMTP();                                      // Set mailer to use SMTP
$mail->Host = 'your-email-server.tld';                // Specify SMTP server
$mail->SMTPAuth = true;                               // Enable SMTP authentication
$mail->Username = 'username';                         // SMTP username
$mail->Password = 'password';                         // SMTP password
$mail->SMTPSecure = 'tls';                            // Enable TLS encryption, `ssl` also accepted
$mail->Port = 25;                                     // TCP port to connect to

Watch our in "dieWithMail()" as the variable there is called $_mail and not $mail

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...