Author Topic: How to prevent a email from sending when the account is disabled.  (Read 3689 times)

Offline xXxbigdogXx

  • Jr. Member
  • **
  • Posts: 13
Hi. I have a question not much of an issue however I don't know where questions could go.

I have just solved a problem which was a simple fix. Now I got a new problem.

How exactly can I take away a user's permission to send an email when they user gets their account disabled or gets banned? When I disabled a test user account they were able to still send as many emails as they wanted before they logged out.

I run hMailServer RoundCube and Wamp Server (Apache, PHP, MySQL)

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,856
Re: How to prevent a email from sending when the account is disabled.
« Reply #1 on: May 03, 2016, 08:08:00 AM »
I have never used hmailserver but do you require smtp authenticaiton to send email? if so then I'm suprised that hmailserver allows disabled users to send email. (the users are disabled on hmailserver right?)
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and moreā€¦

Offline xXxbigdogXx

  • Jr. Member
  • **
  • Posts: 13
Re: How to prevent a email from sending when the account is disabled.
« Reply #2 on: May 06, 2016, 08:34:05 PM »
I'm running all of the default settings for hmailserver, I do not know about SMTP authentication.

When the user is logged in whilst the account is enabled. when the account gets disabled the whilst the user is still logged in they can  still send emails.

I disable them just before the mail is sent while a authenticated session is active, I need a way for the session to refresh so it can reauthenticate. I cannot find a plugin with that purpose.

Offline xXxbigdogXx

  • Jr. Member
  • **
  • Posts: 13
Re: How to prevent a email from sending when the account is disabled.
« Reply #3 on: May 07, 2016, 01:11:43 PM »
I have used a topic from hmailserver to solve my problem, https://www.hmailserver.com/forum/viewtopic.php?t=18194. I have enabled SMTP authentication and specified the authentication in roundcube/config/defaults.inc.php

@line 238 TO @line 248

// SMTP username (if required) if you use %u as the username Roundcube
// will use the current username for login
$config['smtp_user'] = '%u';

// SMTP password (if required) if you use %p as the password Roundcube
// will use the current user's password for login
$config['smtp_pass'] = '%p';

// SMTP AUTH type (DIGEST-MD5, CRAM-MD5, LOGIN, PLAIN or empty to use
// best server supported one)
$config['smtp_auth_type'] = 'LOGIN';

Thank you.