Modified exim.pl blocks WebMail SMTP - can you help

locateMe

Verified User
Joined
Feb 12, 2004
Messages
44
I have just set up my server to host mail for a domain but I am not allowing SMTP access (the users will use their ISPs SMTP servers) but I do want to allow WebMail to send emails.

I found a thread at http://forum.directadmin.com/showthread.php?t=38252 that showed how to block SMTP by modding exim.pl and I implemented that and it runs great EXCEPT that webmail is being blocked from sending also

I am guessing that the user that is being used by Webmail is different these days (older thread) but how do I find out what the user is and so mod the changes to allow that user to send email?

Code:
if ((!$smtpallowed) && ($username ne "root") && ($username ne "diradmin")) { return "no"; }

Thanks!

Steve
 
Hello,

To disable SMTP for your customer without modifying exim.conf/exim.pl would be achieved with setting allowed number of emails to 1.

Related: http://help.directadmin.com/item.php?id=81

Note, disabling SMTP this way might block emails generated by PHP scripts.

I am guessing that the user that is being used by Webmail is different these days (older thread) but how do I find out what the user is and so mod the changes to allow that user to send email?

If you aren't using SMTP auth, then it might be webapps or unknown.
 
I actually have just 1 'customer' with 175 email mailboxes so the modded exim.pl was working rather nicely and I didn't trust the DA method as when I list my email mailboxes it shows 0/200 sent emails per mailbox and yet I know one of them sent out over 2000. I also had a ticket message that told me that my 'customer' had sent out 2870 messages - this message was generated because it exceed the limit of 500. How could it allow 2870 emails to be sent when the limit was 500? Anyway, I didn't trust the DA implementation after that so used the modded exim.pl instead :)

What has SMTP auth to do with WebMail? Does it send out email as the logged in user? I had assumed that it had it's own 'user'.
 
to be sent when the limit was 500?

You should always have the latest and actual version of exim.pl

Related:
http://help.directadmin.com/item.php?id=51
http://help.directadmin.com/item.php?id=447
http://help.directadmin.com/item.php?id=81


What has SMTP auth to do with WebMail? Does it send out email as the logged in user? I had assumed that it had it's own 'user'.

If to say about RoundCube, then I have the following settings:

PHP:
// ----------------------------------
// SMTP
// ----------------------------------

// SMTP server host (for sending mails).
// To use SSL/TLS connection, enter hostname with prefix ssl:// or tls://
// If left blank, the PHP mail() function is used
// Supported replacement variables:
// %h - user's IMAP hostname
// %n - http hostname ($_SERVER['SERVER_NAME'])
// %d - domain (http hostname without the first part)
// %z - IMAP domain (IMAP hostname without the first part)
// For example %n = mail.domain.tld, %d = domain.tld
$rcmail_config['smtp_server'] = 'localhost';

// SMTP port (default is 25; use 587 for STARTTLS or 465 for the
// deprecated SSL over SMTP (aka SMTPS))
$rcmail_config['smtp_port'] = 587;

// SMTP username (if required) if you use %u as the username Roundcube
// will use the current username for login
$rcmail_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
$rcmail_config['smtp_pass'] = '%p';

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

// Optional SMTP authentication identifier to be used as authorization proxy
$rcmail_config['smtp_auth_cid'] = null;

// Optional SMTP authentication password to be used for smtp_auth_cid
$rcmail_config['smtp_auth_pw'] = null;

you might want to check yours here /var/www/html/roundcubemail-0.8.5/config/main.inc.php

In this case all emails are sent through SMTP with user`s credentials. As an alternative you can made it to use PHP mail()
 
Thanks so much! I actually use Squirrelmail for the webmail but I found that I could enable 'Use Sendmail' in config.php and it worked right away

I appreciate your guidance

Steve
 
Old thread but some info for visitors. This way the mails that are send will not be calculated and the user can send as many mails as he wants.
 
Back
Top