Possible to Send Email from Exchange Account via Mac Terminal? - macos

I would like to send an email from my Exchange email account via Mac Terminal. Is this possible, and if so, how would I go about doing so? I'm running OS X 10.10.5 and have my email set up on Microsoft Outlook 2011 for Mac. Thanks for the help!

Assuming you don't want to send email from your Outlook client for whatever reason, you'll need your user and pass in base64 handy to cut/past into the terminal. Go here for an example: How to test SMTP Auth using telnet
This comes with caveats. This is not SSL, so you're using SMTPS or StartTLS you'll need to do this all via OpenSSL s_client like this: Test SSL SMTP from command line
I've used these in the past and they work. If it doesn't work, you'll need to find out what SMTP connection strings are allowed. For clients I always ran SMTP Client Submission which listens on 587 and required STARTTLS prior to Auth. SMTPS on 465 was disabled...Lemme know if this works.
-Chase

Related

IRC Protocol - Registration to Server with Password

I'm trying to write a Python IRC script. It is not connecting to my UnrealIRCD server, so I tried it with TELNET:
telnet xx.xx.xx.xx 6667
Trying xx.xx.xx.xx...
Connected to xx.xx.xx.xx.
Escape character is '^]'.
PASS MYSERVERPASS
NICK MYNICKNAME
PING :7EF7F35D
USER MyUserName 8 * :MY REALNAME
After this connection, it doesn't accept the registration and times out. When I try to connect via telnet to an EFnet server, for instance, this process works fine.
So, does anyone have an idea what is wrong with the registration process?
Other clients and Eggdrop Bots can connect to the server with no problem. So I don't understand why these simple protocol commands are not working.
I assume this message was sent by the server:
PING :7EF7F35D
You have to reply to it, with this message:
PONG :7EF7F35D
(change the payload of the PONG to match the one in the PING)
This is probably required by the server to avoid attacks.

Add source computers public IP to email header with unix mail OS X

For security purposes we want to include the source computers public IP address in the header of any e-mails sent. I can easily find it and pop it in the body of the e-mail, but we sort of want some evidence that the e-mail itself originated from the same IP address.
I'm sending some system information via postfix mail command in terminal in OS X and at the moment I'm using Turbo SMTP as the SMTP server to do it.
Is there a way for me to do it from terminal or is it all down to the SMTP server if that data is sent in the header?
If so, might it be better to run my own SMTP server on a linux server which does send the public IP?
At the moment the header just includes the SMTP servers IP and my receiving e-mail servers IP.

What is the purpose of a SMTP VRFY Scanner?

I need some assistance with these type of scanners, there seem to be many of them on the web but I can't seem to find specific details of what they are meant to achieve.
I understand that they are communicating on the SMTP port, but I am not certain of what type of information they are trying to get.
The reason I ask this is because I am currently investigating a SMTP VRFY Scanner. I have made the scanner to connect to a windows xp system but it states
Waiting for SMTP banner
220 testing221 Microsoft ESMTP MAIL Service, Version: 6.0.2600.2180 ready at Sun, 27 Sep 2015 19:04:44 +0100
testing221 corresponds to the domain on the SMTP virtual server, on the xp system.
The SMTP VRFY command is intended to allow a sender to verify the correctness of an email address without actually sending an email.
This feature was abused by spammers very early on. As a result, most SMTP servers are configured to ignore the command.
They are effectively useless for the public internet these days. You will find very few, if any, domains configured to support the command.

How to setup a mail server?

I want anyone who send a email to test#example.com, and the server could get the mail and so I can use some server side scripting language like Ruby to parser the content of the email.
Ruby solution would be great.
If you've never set up an smtp server, and you're not willing to dig in and learn a lot, you might want to check out some of the services that offer this kind of ability. I have never used any of these, not sure about quality or pricing aspects.
cloudmailin
mailgun
dispatch
postmark
An alternative to setting up and configuring a mail server is to use a service such as sendgrid or postmark. You point your DNS mx records at them and they will turn inbound messages into JSON documents and post them to you
You can install qmail on your server, and configure it to pipe incoming mail to your domain to the STDIN of your ruby script.
If you haven't done so already, create an MX record for your domain that points to your mailserver's IP. Then, login to the server as root, then install qmail by following the instructions at http://lifewithqmail.org/lwq.html#installation
Configure qmail to accept incoming mail for *#yourdomain.tld (catchall), and forward all incoming mail to the script at /home/yourhomedirectory/yourscript.sc:
add the following line to /var/qmail/control/me:
hostname.yourdomain.tld
add the following line to /var/qmail/control/defaultdomain:
yourdomain.tld
addd the following line to /var/qmail/control/virtualdomains
yourdomain.tld:yourusername
add the following line to /var/qmail/control/rcphosts:
yourdomain.tld
restart qmail:
qmailctl stop
qmailctl stat
Logout of the server, then log back in again as yourusername. Create a file /home/yourusername/.qmail-default, consisting of the following line:
| /home/yourhomedirectory/yourscript.sc
Create /home/yourhomedirectory/yourscript.sc script to process incoming mail. Enable executable permissions on the script for all users:
chmod a+x /home/yourhomedirectory/yourscript.sc
That's all there is to it. Incoming mail to your domain will be piped by qmail to this script's STDIN.
Install and configure an SMTP server. SMTP servers can usually be configured quite extensively, what to do with mails that should be deliverd locally. One such option would be to deliver the mail locally by invoking a ruby script. Popular SMTP servers are postfix, courier and qmail. The details about how to setup the mail server depends on which one you use.

client rejecting server certificate

I am new to HTTPS/SSL.
I need to write a HTTPS client which will reject all the connection by saying unknown CA . As I understand (through wireshark capture) during SSL connection, first client will send the 'client hello' message. In reply to this server will send message with three record - 'server hello', certificate, 'server hello done'.
What I am trying to achieve here is when the server will send certificate, client should always reject it.
I am trying to achieve it with following code but no luck.
How can I get LWP to validate SSL server certificates?
It's ok if solution is in some other language.
It should be enough to do the connection with no (or dummy) CA certificates known to the client. Have you tried setting SSL_ca_path and SSL_ca_file to dummy values?
Edit:
If any language goes, why not try openssls s_client?
openssl s_client -connect www.stackoverflow.com:443

Resources