[GH-ISSUE #43] Error starting mailserver #29

Closed
opened 2026-02-25 23:39:39 +03:00 by kerem · 5 comments
Owner

Originally created by @sutidor on GitHub (Sep 19, 2022).
Original GitHub issue: https://github.com/HaschekSolutions/opentrashmail/issues/43

I get an error starting mailserver on port 25, even though I chose a different port.
Google says, it is because it is being started as non-privileged user nginx.
su - nginx -s /bin/ash -c 'cd /var/www/opentrashmail/python;python mailserver.py'

Originally created by @sutidor on GitHub (Sep 19, 2022). Original GitHub issue: https://github.com/HaschekSolutions/opentrashmail/issues/43 I get an error starting mailserver on port 25, even though I chose a different port. Google says, it is because it is being started as non-privileged user nginx. ` su - nginx -s /bin/ash -c 'cd /var/www/opentrashmail/python;python mailserver.py' `
kerem closed this issue 2026-02-25 23:39:39 +03:00
Author
Owner

@geek-at commented on GitHub (Sep 30, 2022):

is this via docker or without?

<!-- gh-comment-id:1263348544 --> @geek-at commented on GitHub (Sep 30, 2022): is this via docker or without?
Author
Owner

@ghost commented on GitHub (Oct 4, 2022):

Starting via docker

Starting Open Trashmail
 [+] Starting php
 [+] Starting nginx
 [+] Setting up config.ini
   [i] Using default dateformat
 [+] Starting Mailserver
[i] Starting Mailserver on port 25
Traceback (most recent call last):
  File "mailserver.py", line 173, in <module>
    server = CustomSMTPServer(('0.0.0.0', port), None) # use your public IP here
  File "/usr/lib/python2.7/smtpd.py", line 285, in __init__
    self.bind(localaddr)
  File "/usr/lib/python2.7/asyncore.py", line 342, in bind
    return self.socket.bind(addr)
  File "/usr/lib/python2.7/socket.py", line 228, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 13] Permission denied
<!-- gh-comment-id:1267127339 --> @ghost commented on GitHub (Oct 4, 2022): Starting via docker ``` Starting Open Trashmail [+] Starting php [+] Starting nginx [+] Setting up config.ini [i] Using default dateformat [+] Starting Mailserver [i] Starting Mailserver on port 25 Traceback (most recent call last): File "mailserver.py", line 173, in <module> server = CustomSMTPServer(('0.0.0.0', port), None) # use your public IP here File "/usr/lib/python2.7/smtpd.py", line 285, in __init__ self.bind(localaddr) File "/usr/lib/python2.7/asyncore.py", line 342, in bind return self.socket.bind(addr) File "/usr/lib/python2.7/socket.py", line 228, in meth return getattr(self._sock,name)(*args) socket.error: [Errno 13] Permission denied ```
Author
Owner

@geek-at commented on GitHub (Oct 5, 2022):

cannor reproduce @KaygorodovIS

c-2:~# docker run --rm -it -p 25:25 -p 80:80 hascheksolutions/opentrashmail
Unable to find image 'hascheksolutions/opentrashmail:latest' locally
latest: Pulling from hascheksolutions/opentrashmail
a0d0a0d46f8b: Already exists
9739eed0d16c: Pull complete
bf75f35cdd0e: Pull complete
4f4fb700ef54: Pull complete
b710e1f64215: Pull complete
afade6c83762: Pull complete
ef1dc70c5b8a: Pull complete
e77fa79d2a99: Pull complete
f6f837fb8be4: Pull complete
Digest: sha256:1d0b985feb62ee0b32d637b813fa2f4faf13c4abdb4df3ab66d3b77a190277e0
Status: Downloaded newer image for hascheksolutions/opentrashmail:latest
Starting Open Trashmail
 [+] Starting php
 [+] Starting nginx
 [+] Setting up config.ini
   [i] Using default dateformat
 [+] Starting Mailserver
[i] Starting Mailserver on port 25
[i] Ready to receive Emails

are you by any chance running non-privileged? because that would mean you can't open ports below 1024

<!-- gh-comment-id:1267922543 --> @geek-at commented on GitHub (Oct 5, 2022): cannor reproduce @KaygorodovIS ``` c-2:~# docker run --rm -it -p 25:25 -p 80:80 hascheksolutions/opentrashmail Unable to find image 'hascheksolutions/opentrashmail:latest' locally latest: Pulling from hascheksolutions/opentrashmail a0d0a0d46f8b: Already exists 9739eed0d16c: Pull complete bf75f35cdd0e: Pull complete 4f4fb700ef54: Pull complete b710e1f64215: Pull complete afade6c83762: Pull complete ef1dc70c5b8a: Pull complete e77fa79d2a99: Pull complete f6f837fb8be4: Pull complete Digest: sha256:1d0b985feb62ee0b32d637b813fa2f4faf13c4abdb4df3ab66d3b77a190277e0 Status: Downloaded newer image for hascheksolutions/opentrashmail:latest Starting Open Trashmail [+] Starting php [+] Starting nginx [+] Setting up config.ini [i] Using default dateformat [+] Starting Mailserver [i] Starting Mailserver on port 25 [i] Ready to receive Emails ``` are you by any chance running non-privileged? because that would mean you can't open ports below 1024
Author
Owner

@kobius77 commented on GitHub (Nov 29, 2022):

servus,

getting the same as @KaygorodovIS above - but since i'm root and am using -p 2525:25 -p 8099:80 privileges shouldn't be an issue, should they?

<!-- gh-comment-id:1331422922 --> @kobius77 commented on GitHub (Nov 29, 2022): servus, getting the same as @KaygorodovIS above - but since i'm root and am using `-p 2525:25 -p 8099:80` privileges shouldn't be an issue, should they?
Author
Owner

@geek-at commented on GitHub (Nov 30, 2022):

you're also getting permission denied error inside of python @drahdiwaberl ?

<!-- gh-comment-id:1331814928 --> @geek-at commented on GitHub (Nov 30, 2022): you're also getting permission denied error inside of python @drahdiwaberl ?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentrashmail#29
No description provided.