mail is not working on my PC - email

Tried to send an email to myself in a bash script from Ubuntu (12.04) command line, it will not send. I even used wireshark to snoop traffic on port 25, don't even see tcp session got established.
mail -s "Subject" xxxxx#yahoo.com < msg.txt
It's supposed to be very simple: just find the server from the email address (xxxxx#yahoo.com), set up a TCP connection and follow the SMTP protocol. It doesn't even try to establish an TCP connection.
Any ideas? Thanks.

use the sendmail program. It's a lot simpler :)
sudo apt-get install sendmail
sudo sendmailconfig
echo testmail | sendmail address#gmail.com

Related

sending email to smtp server in docker

I have just installed a docker image of inbucket (http://www.inbucket.org/). It is working ok and I can see in the docker command prompt that smtp is listening on TCP4 0.0.0.0.10025 and pop3 listening on TCP4 0.0.0.0.10110.
I can also access the web interface for the application on localhost:9000 so everything seems to be working ok.
I haven't used docker before so I'm unsure what email address I need to send it to so the docker smtp server will pick it up. I have tried addressed such as anyone#inbucket.com, anyone#inbucket.local, anyone#inbucket.org but I keep getting invalid address returned messages.
How should docker mailboxes work?

How to specify port number when sending mail with postfix?

I've uncommented the 'submission' line in master.cf and I can 'telnet example.com 587' on my mail server with no problem but how do I send mail from the command line of the client to the postfix server over port 587?
My server is hosted as a digitalocean droplet (centos instance) on the internet and my client is my home laptop.
Each time I try to deliver a message with the 'mail user#example.com' command I instantly receive a rejection message because my isp blocks port 25.
Any help greatly appreciated :)
mail command will drop the mail to the SMTP server running on your home laptop and the SMTP server running on your home laptop is not configured i guess. So it is trying to deliver the mail by doing an MX lookup (i.e to port 25 of your MX server). If you want to do any smtp tests please try using swaks tool.
# For eg. to authenticate and send mail from your mail server, you will have to use
swaks -f you#example.com -t someone#yahoo.com -s example.com -p 587 --auth-user you#example.com --auth-pass somepass
# -f from
# -t to
# -s server
# -p port
# --auth-user username
# --auth-pass password
More info here Hope that helps.

Nagios check_email_delivery plugin not resolving cnames

I'm using the Nagios plugin check_email_delivery to monitor email, and to check software statuses in some cases. We're now moving all of our internal mail servers to Office 365 and have discovered that this command:
./check_imap_receive_epn -H outlook.office365.com -U user#example.com -P password --ssl -s SUBJECT -s $ARG1$ -w 1200 -c 1800
Results in:
IMAP RECEIVE CRITICAL - Could not connect to outlook.office365.com port 993: IO::Socket::INET6 configuration failederror:00000000:lib(0):func(0):reason(0) at ./check_imap_receive_epn line 93.
HOWEVER! Resolving the cname to an IP address seems to work. Example:
./check_imap_receive_epn -H 157.56.239.201 -U user#example.com -P password --ssl -s SUBJECT -s $ARG1$ -w 1200 -c 1800
With a result of:
IMAP RECEIVE OK - 5 seconds, 1 found, 1 deleted
I think the issue is caused here:
my $socket = IO::Socket::SSL->new(PeerAddr=>"$imap_server:$imap_port", %ssl_args);
Where $imap_server isn't resolving correctly. Any suggestions? >.<
because IO::Socket::INET6 is installed IO::Socket::SSL will use this as base class.
IO::Socket::INET6 tries to get an IPv6 address first (e.g. DNS AAAA record), while ping etc often try IPv4 only (there is usually a ping6 to for IPv6). So if your IPv6 setup is broken you might not realize it with IPv4-only tools. Please check:
dig outlook.office365.com AAAA - this should give you IPv6 addresses.
If you don't have IPv6 it should give no records at all and NOERROR, but some broken resolvers return NXDOMAIN instead
if you get an IPv6 address try to connect to it, e.g.
perl -MIO::Socket::INET6 -e 'IO::Socket::INET6->new("[2a01:111:f400:9800::6]:993") or die $!'
If you get an error your IPv6 setup is broken, e.g. the resolver returns IPv6 records even you cannot reach hosts by IPv6

Cannot get irssi to work on Bluehost dedicated IP address

I am trying to get irssi to work over SSH on my Bluehost dedicated IP server.
Bluehost support says port 6667 is open, but you have to have an app listening to it, so running nc -l on the server and then telnet'ing in works, but if I run irssi on the server then it can't connect to freenode.net - it says the connection timed out.
If you do nmap -v -sT then you see the 6667/TCP port, but it's listed as closed.
How can get irssi to run using an ssh shell on Bluehost?
It Would be great to have under a Screen session you could re-login to from anywhere.
Make sure that you ask them if 6667 is open outbound TCP and UDP.
Sometimes they can mistake it for inbound or only open TCP for example. You can telnet to your IRC host on port 6667 even if something is not listening on the Bluehost side, assuming IRC is up and accepting connections, and Bluehost has the port opened, a telnet from your Bluehost account to the IRC server will work fine.

TCP/IP default port for sending console messages?

Is there a dedicated port (lower than 1024) specifically for clients to send text based console output to a server? I've googled extensively but to no avail. What's the best port (lower than 1024) for sending text based console output if any?
A port is just a number. You can see well known port assignments in /etc/services.
You need a server application to be listening on the given port to accept your input. There are number of remote terminal protocols and their implementations, among which are Telnet (port 23) and Secure Shell, or SSH (port 22).
The simplest way to test your socket client is to setup netcat on the server to listen on whatever port you want (port is 777 in the example bellow), and then try to connect to it from somewhere else:
server:~# nc -l -p 777
then
client:~$ nc server 777
Note that on Unix you normally need super-user (root) rights to bind "privileged", i.e. bellow 1024, ports.
I'm going to use telnet (port 23) since that's closest to what I want. Sending console messages to a server from a client. okey dokey thanks!