Sending mail through linux commandline without MTA to a Smarthost

After getting tired of using a mail server on every Linux machine with security lockdowns to keep external mail from sending through it, I’ve decided to go back to the “client/server” mentality of server maintenance to keep myself sane.
All mail has to go through the corporate Exchange server for some masochistic reason that is vaguely masked by logging even though the logs aren’t kept or monitored. Sooo, thankfully an SMTP service is running on the Exchange server instead of the pompous antics of most shops running Exchange.
In a nutshell, I edited the /etc/mail/submit.cf, and changed the line beginning with “DS”, appending the server name with no spaces.
The next line I changed was D{MTAHost} which I removed “localhost” and replaced it with the mail server hostname. This can be IP address as well, but it’s always best to use a name so if the IP of the server changes it is only needing to be replaced in DNS instead of on a zillion servers.
That’s it… I figured I’d post it so if anyone runs into this silly little thing and doesn’t feel like surfing through 20+ pages saying “use sendmail/postfix/qmail!!!!!” instead of just answering the question.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s