Closed ruandao closed 8 years ago
Ports < 1024 are 'privileged' on UNIX, so only the 'root' user can bind to them. You're trying to bind to the port as a regular user hence the EACCESS.
Typically Haraka would be started as root (by root) and would the drop privileges after it has opened the port to whatever user you set in config/smtp.ini
There are other workarounds if you don't have root access (it requires someone with root access to set this up for you though). See http://stackoverflow.com/questions/413807/is-there-a-way-for-non-root-processes-to-bind-to-privileged-ports-1024-on-l for details.
But I was run it use sudo
and not found any other program occupy the 25
port
What OS is this and what do you have in config/smtp.ini??
I use OS X 10.10.5 (14F27)
and never change config/smtp.ini
now
// config/smtp.ini
; address to listen on (default: all IPv6 and IPv4 addresses, port 25)
; use "[::0]:25" to listen on IPv6 and IPv4 (not all OSes)
;listen=[::0]:25
; Note you can listen on multiple IPs/ports using commas:
;listen=127.0.0.1:2529,127.0.0.2:2529,127.0.0.3:2530
; public IP address (default: none)
; If your machine is behind a NAT, some plugins (SPF, GeoIP) gain features
; if they know the servers public IP. If 'stun' is installed, Haraka will
; try to figure it out. If that doesn't work, set it here.
;public_ip=N.N.N.N
; Time in seconds to let sockets be idle with no activity
;inactivity_timeout=300
; Drop privileges to this user/group
;user=smtp
;group=smtp
; Don't stop Haraka if plugins fail to compile
;ignore_bad_plugins=0
; Run using cluster to fork multiple backend processes
;nodes=cpus
; Daemonize
;daemonize=true
;daemon_log_file=/var/log/haraka.log
;daemon_pid_file=/var/run/haraka.pid
; Spooling
; Save memory by spooling large messages to disk
;spool_dir=/var/spool/haraka
; Specify -1 to never spool to disk
; Specify 0 to always spool to disk
; Otherwise specify a size in bytes, once reached the
; message will be spooled to disk to save memory.
;spool_after=
No idea then - that would work on any other UNIX. This must be a quirk of OS X.
If you set listen=0.0.0.0:2525
in config/smtp.ini - will it start?
not, it still can't start, get the same error
my smtp.ini
(I uncomment and change it as the following line):
listen=[::0]:25
and change it to:
listen=0.0.0.0:25
was get the same result
but if I change it to port large than 1024, it run success. I think it should also be the privileged
problem.
Thanks.
Weird that it doesn't run under sudo though. I can find a few other nodejs projects reporting similar issues and using the firewall to redirect the ports instead.
Please let me know if you find a solution.
Can you try running:
sudo xcodebuild -license
And see if it helps?
On Oct 4, 2015, at 4:06 AM, Steve Freegard notifications@github.com wrote:
Weird that it doesn't run under sudo though. I can find a few other nodejs projects reporting similar issues and using the firewall to redirect the ports instead.
Please let me know if you find a solution.
— Reply to this email directly or view it on GitHub.
In fact i had been changed the file(/usr/local/Cellar/node/0.12.7/bin/node
)'s suid bit to -r-sr-xr-x
for convenient install global library but forget change the owner to root
.
And, now i change the owner to root
, it work.
It may not same with other people.
Node is not suid safe. You really shouldn't do that.
On Oct 4, 2015, at 7:28 PM, ruandao notifications@github.com wrote:
In fact i had been changed the file(/usr/local/Cellar/node/0.12.7/bin/node)'s suid bit to -r-sr-xr-x for convenient install global library but forget change the owner to root.
And, now i change the owner to root, it work.
It may not same with other people.
— Reply to this email directly or view it on GitHub.
Yes, thank you. I will change it back.
why this happen?
but, there was nothing occupy the 25 port