# Virtualmin 'Testing Mode" for the complete newbie

**URL:** <https://forum.virtualmin.com/t/virtualmin-testing-mode-for-the-complete-newbie/127847>\
**Category:** Blue Skies\
**Created:** [July 12, 2024, 1:51am UTC](https://forum.virtualmin.com/t/virtualmin-testing-mode-for-the-complete-newbie/127847 "2024-07-12T01:51:01Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![calport](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/calport/32/44_2.png) [@calport](https://forum.virtualmin.com/u/calport)\
**Post date:** [July 12, 2024, 1:51am UTC](https://forum.virtualmin.com/t/virtualmin-testing-mode-for-the-complete-newbie/127847/1 "2024-07-12T01:51:01Z")

</div>

We should consider offering a 'Testing Mode" in Virtualmin which makes adoption of Virtualmin easy for the complete newbie - and this newbie will likely not be from US / UK or other developed nation of the world, but from new and hitherto underserved areas. Our friend @Alaaeddine.benabid fits the profile of the next set of Virtualmin users. One must admire him for sticking it out despite all the difficulties that he has had with his server; and such difficulties can be made avoidable for all future users of Virtualmin by offering a testing mode with the following changes and enhancements:

1. DNS and mail relaying is offered out of the box in test mode
2. disable other php execution modes - offer just php-fpm in test mode. Other execution modes can be applied only when test mode is disabled.
3. in php, disable mail(). This can be enabled only when test mode is disabled.
4. add mail rate limit option for a virtual server in the Edit Virtual Server screen so that it is not overlooked

These changes come immediately to the mind. A few more could be added to the list to make Virtualmin testing mode offer a very secure and spammer-proof sandbox type environment for complete newbies to get started with Virtualmin.

Let a Virtualmin newbie made a conscious decision to switch off testing mode and put his system in production mode to access those features of Virtualmin which could get him into trouble if he deviates from default without understanding what he is doing.

---

<div class="post-metadata">

**Author:** ![Joe](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/joe/32/9_2.png) [@Joe](https://forum.virtualmin.com/u/Joe)\
**Post date:** [July 12, 2024, 2:08am UTC](https://forum.virtualmin.com/t/virtualmin-testing-mode-for-the-complete-newbie/127847/2 "2024-07-12T02:08:36Z")

</div>

Of these, _only_ disabling features in PHP-FPM might help with the case in question. But, it’d also require disabling `exec`, `shell_exec`, and maybe some others, since PHP can send mail many ways. And, it might not help, it depends on how mail is being sent; it doesn’t have to be sent via PHP, but that’s one possibility.

Rate limiting would delay the inevitable, perhaps, but based on past topics, the problem won’t be solved, and so port 25 will end up blocked anyway.

Anyway, I think we should allow more configuration of PHP-FPM, such as disabling some features. Right now, it requires manual configuration, I think.

---

<div class="post-metadata">

**Author:** ![Alaaeddine.benabid](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/alaaeddine.benabid/32/12094_2.png) [@Alaaeddine.benabid](https://forum.virtualmin.com/u/Alaaeddine.benabid)\
**Post date:** [July 12, 2024, 3:21am UTC](https://forum.virtualmin.com/t/virtualmin-testing-mode-for-the-complete-newbie/127847/3 "2024-07-12T03:21:47Z")

</div>

i go to run this solution tankyou very much

---

<div class="post-metadata">

**Author:** ![Alaaeddine.benabid](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/alaaeddine.benabid/32/12094_2.png) [@Alaaeddine.benabid](https://forum.virtualmin.com/u/Alaaeddine.benabid)\
**Post date:** [July 12, 2024, 3:24am UTC](https://forum.virtualmin.com/t/virtualmin-testing-mode-for-the-complete-newbie/127847/4 "2024-07-12T03:24:24Z")

</div>

Dear Mr Joe my problem if it is I want to clarify I do not know how people have total access to send emails are they going through fixed mail and even if I delete all the boxes there is still access with these people and I am sure that it is not among my users or my clients it is almost pirates who can access my server so that they can use it without my permission

---

<div class="post-metadata">

**Author:** ![jimr1](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/jimr1/32/14173_2.png) [@jimr1](https://forum.virtualmin.com/u/jimr1)\
**Post date:** [July 12, 2024, 5:44am UTC](https://forum.virtualmin.com/t/virtualmin-testing-mode-for-the-complete-newbie/127847/5 "2024-07-12T05:44:49Z")

</div>

> [@Joe](#):
>
> But, it’d also require disabling `exec`, `shell_exec`, and maybe some others,

and of course the php web site code may contain it’s own function to access the system directly, I have written a version of exec that suits my needs and won’t be disabled unless you know the function name. So they could still get in with disabling all the ‘known’ functions. I have tested this out, and with a custom function you can still get in. With code I have written you would have to disable

1. proc\_open
2. fwrite
3. fclose
4. stream\_get\_contents
5. proc\_close

but there are bound to be other methods to achieve this, maybe a full code review is a better option in this case rather than making stabs in the dark as to how the attacker is gaining access

---

<div class="post-metadata">

**Author:** ![Joe](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/joe/32/9_2.png) [@Joe](https://forum.virtualmin.com/u/Joe)\
**Post date:** [July 12, 2024, 5:46am UTC](https://forum.virtualmin.com/t/virtualmin-testing-mode-for-the-complete-newbie/127847/6 "2024-07-12T05:46:41Z")

</div>

It may or may not be a solution. It is _one_ of many ways someone can send mail.

---

<div class="post-metadata">

**Author:** ![Joe](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/joe/32/9_2.png) [@Joe](https://forum.virtualmin.com/u/Joe)\
**Post date:** [July 12, 2024, 5:47am UTC](https://forum.virtualmin.com/t/virtualmin-testing-mode-for-the-complete-newbie/127847/7 "2024-07-12T05:47:48Z")

</div>

And, by the time you disable all of that, most apps won’t work anymore.

If a user can execute arbitrary code, they can send mail.

So, if you have an abusive user, you need to remove that user.

---

<div class="post-metadata">

**Author:** ![Joe](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/joe/32/9_2.png) [@Joe](https://forum.virtualmin.com/u/Joe)\
**Post date:** [July 12, 2024, 5:51am UTC](https://forum.virtualmin.com/t/virtualmin-testing-mode-for-the-complete-newbie/127847/8 "2024-07-12T05:51:37Z")

</div>

> [@Alaaeddine.benabid](#):
>
> it is almost pirates who can access my server so that they can use it without my permission

You should find that out, by looking at logs. I don’t know why you’ve historically refused to do that. But, it’s the first place to look.

If you don’t see it in the mail log (or the journal for the `postfix` unit), then you need to look in the access and error logs for your websites. You also need to audit what code is being run.

If you can’t find it in the logs, you can use wireshark (`tshark` on the command line) to watch for traffic to port 25 outside of your server.

But, you need to figure out _what_ is happening before you can fix it. You’re just doing a bunch of random things with no reason to believe they’ll do anything useful.

---

<div class="post-metadata">

**Author:** ![jimr1](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/jimr1/32/14173_2.png) [@jimr1](https://forum.virtualmin.com/u/jimr1)\
**Post date:** [July 12, 2024, 5:52am UTC](https://forum.virtualmin.com/t/virtualmin-testing-mode-for-the-complete-newbie/127847/9 "2024-07-12T05:52:17Z")

</div>

> [@Joe](#):
>
> So, if you have an abusive user, you need to remove that user.

It may not be the user, they be unaware this is happening, it maybe badly written code that needs to be removed or reviewed and altered to be secure

---

<div class="post-metadata">

**Author:** ![Joe](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/joe/32/9_2.png) [@Joe](https://forum.virtualmin.com/u/Joe)\
**Post date:** [July 12, 2024, 5:55am UTC](https://forum.virtualmin.com/t/virtualmin-testing-mode-for-the-complete-newbie/127847/10 "2024-07-12T05:55:27Z")

</div>

To be clear, if it’s not your users, then it’s almost certainly some web application you’re running that’s allowing mail to be sent. It may have other exploit code in place, like a web shell or cron jobs to reinstall their exploits if you happen to stumble on some of the files.

---

<div class="post-metadata">

**Author:** ![Joe](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/joe/32/9_2.png) [@Joe](https://forum.virtualmin.com/u/Joe)\
**Post date:** [July 12, 2024, 5:58am UTC](https://forum.virtualmin.com/t/virtualmin-testing-mode-for-the-complete-newbie/127847/11 "2024-07-12T05:58:43Z")

</div>

Yes, but, until @Alaaeddine.benabid puts forth some effort to figure out what’s happening, we’re all just guessing.

---

<div class="post-metadata">

**Author:** ![calport](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/calport/32/44_2.png) [@calport](https://forum.virtualmin.com/u/calport)\
**Post date:** [July 12, 2024, 6:09am UTC](https://forum.virtualmin.com/t/virtualmin-testing-mode-for-the-complete-newbie/127847/12 "2024-07-12T06:09:35Z")

</div>

Yes, let’s keep this thread about the ‘Testing Mode’ idea, we already have one for Aladdin’s magic LAMP server. 😀

---

<div class="post-metadata">

**Author:** ![Stegan](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/stegan/32/6860_2.png) [@Stegan](https://forum.virtualmin.com/u/Stegan)\
**Post date:** [July 12, 2024, 9:17am UTC](https://forum.virtualmin.com/t/virtualmin-testing-mode-for-the-complete-newbie/127847/13 "2024-07-12T09:17:32Z")

</div>

> [@calport](#):
>
> newbie will likely not be from US / UK or other developed nation of the world,

I don’t like this rather jingoistic assumption ☹ there are many people in those excluded dominions that would consider themselves far better/equal/developed.

Sure there are “newbies” and different classification of newbie (I was one once - new to Webmin/Virtualmin for sure, but not to system admin (now 40+ yeas) and over 10 years _retired_)

I would be far more worried about putting these excluded foreigners off using & learning Webmin/Virtualmin.

We will be suggesting an exam or test next? Issuing some certificate of competence perhaps?

Is it worth all the time + effort?

---

<div class="post-metadata">

**Author:** ![jimdunn](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/jimdunn/32/3487_2.png) [@jimdunn](https://forum.virtualmin.com/u/jimdunn)\
**Post date:** [July 12, 2024, 9:32am UTC](https://forum.virtualmin.com/t/virtualmin-testing-mode-for-the-complete-newbie/127847/14 "2024-07-12T09:32:07Z")

</div>

I remember when I first installed Virtualmin (coming from Plesk a long time ago)… and how I wished for videos that would walk me thru things. I guess I’m at fault, after all this time and I’ve not made any videos. But this testing mode sounds interesting.

---

<div class="post-metadata">

**Author:** ![calport](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/calport/32/44_2.png) [@calport](https://forum.virtualmin.com/u/calport)\
**Post date:** [July 12, 2024, 10:12am UTC](https://forum.virtualmin.com/t/virtualmin-testing-mode-for-the-complete-newbie/127847/15 "2024-07-12T10:12:25Z")

</div>

> [@Stegan](#):
>
> I don’t like this rather jingoistic assumption

I do apologise. You are right, of course - a newbie to Virtualmin might not be a newbie to systems adminstration. I come from a nation with a large population and a part of my work involves getting underserved geographies online - not only here but also in places like Sub-Saharan Africa. It is in this context that I say that the next crop of Virtualmin and Cloudmin users will come from these areas.

---

<div class="post-metadata">

**Author:** ![Alaaeddine.benabid](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/alaaeddine.benabid/32/12094_2.png) [@Alaaeddine.benabid](https://forum.virtualmin.com/u/Alaaeddine.benabid)\
**Post date:** [July 12, 2024, 2:37pm UTC](https://forum.virtualmin.com/t/virtualmin-testing-mode-for-the-complete-newbie/127847/16 "2024-07-12T14:37:49Z")

</div>

@Joe  
tell me mr joe how to download the newspaper of 7/6/24 it is the day my server was hacked

---

<div class="post-metadata">

**Author:** ![Alaaeddine.benabid](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/alaaeddine.benabid/32/12094_2.png) [@Alaaeddine.benabid](https://forum.virtualmin.com/u/Alaaeddine.benabid)\
**Post date:** [July 12, 2024, 2:41pm UTC](https://forum.virtualmin.com/t/virtualmin-testing-mode-for-the-complete-newbie/127847/17 "2024-07-12T14:41:03Z")

</div>

@calport Tell me my brother how to launch the test mode and will it help me to know the exact anomaly?

---

<div class="post-metadata">

**Author:** ![jimr1](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/jimr1/32/14173_2.png) [@jimr1](https://forum.virtualmin.com/u/jimr1)\
**Post date:** [July 12, 2024, 2:42pm UTC](https://forum.virtualmin.com/t/virtualmin-testing-mode-for-the-complete-newbie/127847/18 "2024-07-12T14:42:35Z")

</div>

You have been told loads of times, in different threads, on how to do that. If your not comfortable doing that employ someone who is

---

<div class="post-metadata">

**Author:** ![Alaaeddine.benabid](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/alaaeddine.benabid/32/12094_2.png) [@Alaaeddine.benabid](https://forum.virtualmin.com/u/Alaaeddine.benabid)\
**Post date:** [July 12, 2024, 4:55pm UTC](https://forum.virtualmin.com/t/virtualmin-testing-mode-for-the-complete-newbie/127847/19 "2024-07-12T16:55:21Z")

</div>

Mr thank you for your efforts but the problem is that it is that I am bad but I am here to understand with the help of people on the forum and understand and thank you another time

---

<div class="post-metadata">

**Author:** ![Joe](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/joe/32/9_2.png) [@Joe](https://forum.virtualmin.com/u/Joe)\
**Post date:** [July 12, 2024, 7:30pm UTC](https://forum.virtualmin.com/t/virtualmin-testing-mode-for-the-complete-newbie/127847/20 "2024-07-12T19:30:56Z")

</div>

I told you what logs to look at.

There is a log viewer for Virtualmin domains websites (both access and error logs) in the Logs and Reports menu for each domain.

There are multiple ways to view the mail log, and it depends on your OS and version as to which one you need to use. You may have a `/var/log/mail.log` or you may have a `/var/log/maillog` or you may need to look at `journalctl -u postfix`. With the journal you can specify a date. With the log files, you may need to unzip rotated out older logs.

There is a log viewer in Webmin that will allow you to view either log files (System Logs) or journalctl output (System Log Viewer), but for precise control of `journalctl`, you need to use the command line tool. I’m not going to tell you how to use `journalctl`, because it is well-documented.

[Next page](https://forum.virtualmin.com/t/virtualmin-testing-mode-for-the-complete-newbie/127847.md?page=2)
