Killing MailCatcher: Something's using port 1025
Solution 1
In OSX, run the following in a shell:
sudo lsof -nP -iTCP:1025 -sTCP:LISTEN
The expected output of this command is a process, which is listening on port 1025:
ruby 43841 youruserid 9u IPv4 0x6a1610da80bb9b4f 0t0 TCP 127.0.0.1:1025 (LISTEN)
In the output above, the 2nd value is the process ID. Then, to kill the offending process (substitute in the correct PID):
sudo kill 43841
Solution 2
MailCatcher launches both SMTP and HTTP servers.
When you start MailCatcher in a terminal you'll see the following output:
$ mailcatcher
Starting MailCatcher
==> smtp://127.0.0.1:1025
==> http://127.0.0.1:1080
*** MailCatcher runs as a daemon by default. Go to the web interface to quit.
See the last line in the output when starting MailCatcher?
If you attempt to start MailCatcher if it's already running you'll see:
$ mailcatcher
Starting MailCatcher
~~> ERROR: Something's using port 1025. Are you already running MailCatcher?
How to quit Mailcatcher:
-
Open the
http
url (http://127.0.0.1:1080) in your browser.Note: the port may be different than
1080
. If so, you'll have to use that port. If you don't know it, you'll have to use one of the other answers here to kill the running process. - In the top right corner of the page that opens, you'll see a "Quit" link.
Solution 3
If you are using linux, you should be able to see what program is using a certain port using the netstat command. To see if port 1025 is in use, run this from the command line:
$ netstat -tulpn | grep :1025
Here is a useful reference: http://www.cyberciti.biz/faq/what-process-has-open-linux-port/
Solution 4
I solved this by starting mailcatcher on a different port:
mailcatcher --smtp-port 1026
And changing the following in config/development.rb
config.action_mailer.smtp_settings = {
...
port: 1026,
...
}
Solution 5
get the process id's of the ports mailcatcher is using
lsof -i tcp:1080
lsof -i tcp:1025
kill em:
kill 37747
kill 35647
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Admin
Updated on January 15, 2021Comments
-
Admin over 3 years
I'm trying to run "foreman start" for a rails app however this error message is preventing me from running the foreman properly:
~~> ERROR: Something's using port 1025. Are you already running MailCatcher?
I've tried killing the PID, going to the web interface to quit the program and also...restarting the comp. Does anybody know how to remedy this?
Thanks
-
Admin almost 10 yearsI've executed the command with lsof|grep :1025. Killed th e PID with kill -9 PID. However I'm still getting the error. Thanks though!
-
Mattias almost 9 yearsWhat about if the process keeps rebooting with a new PID everytime you try to kill it? Any ideas?
-
Joseph Combs almost 9 yearsThen there is likely some other process running that is ensuring that mailcatcher is on if it is not already on.
-
Mattias almost 9 yearsYeah it seems like that was the case. Also the problem for me wasn't the mail catcher process but the code sending an email, but thanks anyway!
-
Muhammad Aamir Talib over 8 yearsUse quit option on top right in mail catcher browser window
-
fatuhoku about 8 yearsOnly this answer worked for me on Mac. Clicking 'Quit' from 127.0.0.1:1080 web interface simply didn't work for me on Mac.
-
Sasi varna kumar over 7 yearshow to quit if i cannot access the http url. (running in a remote server)
-
Sasi varna kumar over 7 yearsi found the answer
sudo lsof -nP -iTCP:1025 -sTCP:LISTEN
sudo kill <PID> -
Nick Res over 6 yearsI use the quit button and refresh the page, VIOLA it's still there running.
-
244an about 6 yearsI'm on Windows, it doesn't help with port
1026
or1027
etc. But it lead me in the right direction. Didn't think of just simply changing the port. It works with--smtp-port 30000
for me, Windows 7. Found it here block81.com/articles/test-emails-locally-with-mailcatcher