# Possible security question

**URL:** <https://discourse.mailinabox.email/t/possible-security-question/8339>\
**Category:** Help with Setup/Upgrade\
**Created:** [August 20, 2021, 4:03pm UTC](https://discourse.mailinabox.email/t/possible-security-question/8339 "2021-08-20T16:03:11Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![miabatf2f10](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/m/9fc348/32.png) [@miabatf2f10](https://discourse.mailinabox.email/u/miabatf2f10)\
**Post date:** [August 20, 2021, 4:03pm UTC](https://discourse.mailinabox.email/t/possible-security-question/8339/1 "2021-08-20T16:03:11Z")

</div>

Hi Team,

I have been running MIAB for a few years. I am learning Python recently and trying to test a snip of email related code. What surprised me is that I can just send and receive without any user/pass authentication. Is this a normal behavior with any mail server setup, like gmail, etc ?  
It can not send email to other domains and it prompts “relay denied”.  
It doesn’t work with sender email from other domains.  
It only work between local domain for both sender and receiver.

Should I worry about this being used by remote parties? Thanks!

* * *

from email.mime.text import MIMEText  
msg = MIMEText(“Hi There”)  
msg[‘Subject’] = “A Test Message”  
msg[‘From’] = ‘John kim [john.kim@abc.com](mailto:john.kim@abc.com)’  
msg[‘To’] = ‘Pikcarass [pik.cara@abc.com](mailto:pik.cara@abc.com)’

msg.as\_string()  
import smtplib  
s = smtplib.SMTP(‘[box.abc.com](http://box.abc.com)’)  
s.sendmail(‘john.kim@abc.com’,[‘pik.cara@abc.com’],msg.as\_string())

---

<div class="post-metadata">

**Author:** ![JoshData](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/joshdata/32/2153_2.png) [@JoshData](https://discourse.mailinabox.email/u/JoshData)\
**Post date:** [August 20, 2021, 9:47pm UTC](https://discourse.mailinabox.email/t/possible-security-question/8339/2 "2021-08-20T21:47:27Z")

</div>

Hi @miabatf2f10.

This is exactly how other servers send email to you. If emailing you required a username/password, you would never receive any mail. 🙂

---

<div class="post-metadata">

**Author:** ![miabatf2f10](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/m/9fc348/32.png) [@miabatf2f10](https://discourse.mailinabox.email/u/miabatf2f10)\
**Post date:** [August 21, 2021, 1:49pm UTC](https://discourse.mailinabox.email/t/possible-security-question/8339/3 "2021-08-21T13:49:29Z")

</div>

Hi Josh,

If I know two email addresses within one email domain, I can essentially spam them each other remotely?

For example, I know there’s [jacob@cisco.com](mailto:jacob@cisco.com) and there’s [peter@cisco.com](mailto:peter@cisco.com); I then, can remotely use tools similar to above python script, or even a telnet session, to [box.cisco.com](http://box.cisco.com) and send email to them from each other?

or, even, from [maxist@abc.com](mailto:maxist@abc.com) to [peter@cisco.com](mailto:peter@cisco.com) ? This is supposed to work?  
Then, it would be part of venue for spam, is it not?

Please enlighten a bit on this further.  
Thanks Josh!

---

<div class="post-metadata">

**Author:** ![openletter](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/o/f1d935/32.png) [@openletter](https://discourse.mailinabox.email/u/openletter)\
**Post date:** [August 21, 2021, 2:02pm UTC](https://discourse.mailinabox.email/t/possible-security-question/8339/4 "2021-08-21T14:02:51Z")

</div>

I’m not a developer and you’ve provided scarce details for anyone who is not a developer to understand even what you are doing.

Is this some sort of code being executed from MiaB server?

---

<div class="post-metadata">

**Author:** ![miabatf2f10](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/m/9fc348/32.png) [@miabatf2f10](https://discourse.mailinabox.email/u/miabatf2f10)\
**Post date:** [August 21, 2021, 2:28pm UTC](https://discourse.mailinabox.email/t/possible-security-question/8339/5 "2021-08-21T14:28:12Z")

</div>

It’s executed from a laptop.

---

<div class="post-metadata">

**Author:** ![openletter](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/o/f1d935/32.png) [@openletter](https://discourse.mailinabox.email/u/openletter)\
**Post date:** [August 21, 2021, 2:36pm UTC](https://discourse.mailinabox.email/t/possible-security-question/8339/6 "2021-08-21T14:36:26Z")

</div>

Is the laptop running MiaB?

---

<div class="post-metadata">

**Author:** ![KiekerJan](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/kiekerjan/32/2339_2.png) [@KiekerJan](https://discourse.mailinabox.email/u/KiekerJan)\
**Post date:** [August 21, 2021, 3:24pm UTC](https://discourse.mailinabox.email/t/possible-security-question/8339/7 "2021-08-21T15:24:28Z")

</div>

As Josh already stated, this is how it is supposed to work. Note however, that mail does not necessarily be delivered in your inbox.  
When I tried this, my email first got greylisted, so i had to try again. After that, there are a number of checks. For instance, the spam score for my attempt was:

```auto
X-Spam-Status: Yes, score=20.2 required=5.0 tests=DMARC_FAIL_QUARANTINE,	FROM_ADDR_WS,FSL_BULK_SIG,KHOP_HELO_FCRDNS,MISSING_DATE,MISSING_MID,	PYZOR_CHECK,SPF_FAIL,TO_EQ_FM_DOM_SPF_FAIL

```

A score of 20 is very much above the threshold of 5. This is all because my home computer does not have a trusted ip. Measures surrounding SPF, DKIM are all ignored. Probably my home ip is on a list of less trusted ips, etc. A remote mail server has to have all of that in place before the mail is delivered to your inbox.

> [@openletter](#):
>
> Is this some sort of code being executed from MiaB server?

No, this is a bit of Python code that implements a very simple remote mail server. It tries to deliver an email to the MiaB at [box.abc.com](http://box.abc.com) It can be run on any computer connected to the internet.

---

<div class="post-metadata">

**Author:** ![openletter](https://discourse.mailinabox.email/letter_avatar_proxy/v4/letter/o/f1d935/32.png) [@openletter](https://discourse.mailinabox.email/u/openletter)\
**Post date:** [August 21, 2021, 4:00pm UTC](https://discourse.mailinabox.email/t/possible-security-question/8339/8 "2021-08-21T16:00:14Z")

</div>

So, this isn’t something that has to do with the MiaB server. What you are accomplishing with your code can be accomplished from any server with an SMTP server. In Linux you can accomplish the same by just installing `postfix` and using `sendmail` from command line, or even add the `mail` package which is slightly more user friendly.

Since this is a very old issue related to email infrastructure, many protections have been created that are both local policies and published standards.

You might want to spend some time understanding how a mail message makes its way through an MiaB server, if you are desiring to understand mail infrastructure, as most modern standards are implemented, with few exceptions.

---

<div class="post-metadata">

**Author:** ![andrew](https://discourse.mailinabox.email/user_avatar/discourse.mailinabox.email/andrew/32/1449_2.png) [@andrew](https://discourse.mailinabox.email/u/andrew)\
**Post date:** [August 23, 2021, 4:01am UTC](https://discourse.mailinabox.email/t/possible-security-question/8339/9 "2021-08-23T04:01:51Z")

</div>

> [@openletter](#):
>
> In Linux you can accomplish the same by just installing `postfix` and using `sendmail` from command line, or even add the `mail` package which is slightly more user friendly.

You can even send email using “telnet” and just typing (by hand) the SMTP lines, and the email headers, and so on. Back in the old days, it used to be a quick way to send a test message - you only needed to type the ELHO and TO lines, the message, and a final dot. 😁

You can still do that, but not many servers will accept it. Alas, now email is untrusting and so (for practical purposes) encryption and lots of extra stuff is required … too much for anyone to calculate and type by hand.

But to [miabatf2f10](https://discourse.mailinabox.email/u/miabatf2f10)’s point, within a trusted network this trusting & unverified method might reasonably still work. Would depend on the mail server setup.

---

<div class="post-metadata">

**Author:** ![system](https://discourse.mailinabox.email/uploads/default/original/2X/4/4d0933d13c456b7e57f296aa6cc344525b6f0c70.png) [@system](https://discourse.mailinabox.email/u/system)\
**Post date:** [August 30, 2021, 4:02am UTC](https://discourse.mailinabox.email/t/possible-security-question/8339/10 "2021-08-30T04:02:33Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
