Archive for the 'mail' Category

quickly setup relay/smarthost with smtp auth in postfix mail server

When we decided to host our mail with some other provider, the question of configuring our web servers to use that provider to send mail arise. Having CentOS and postfix as mail service in our hosts, we followed these steps to tell local postfix to use other smtp service to send mails.

1. Suppose you have example.com domain, create one separate mail account to be used in your scripts residing on web server for sending mails. As an example, let’s assume we have mailer@example.com with password mailer123 and mail server address as mail.example.com. Here mail.example.com points to provider mail server which is managing our mail infrastructure. Create a password map file which will contain this information:

quickly check your mail server using telnet, mail or mutt

There are of course various ways to check whether your mail server is now configured ok or not but what I found is that checking through telnet is quick and easy.

let’s check our mail server now, it may be mail.youdomain.com or localhost depending on what you are using right now, here’s the full process:

# telnet localhost smtp
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 mail.example.com ESMTP Postfix
mail from: me@example.com
250 2.1.0 Ok
rcpt to: other@example.com
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
Subject: Just a test. 
This is test mail using telnet.  
.
250 2.0.0 Ok: queued as 6846838401D6
quit
221 2.0.0 Bye
Connection closed by foreign host.
#_

here,

# telnet localhost smtp

We are trying connecting localhost on port 25 (smtp). It should get connected and ready to accept your next command

mail from: me@example.com

here you are specifying the sender mail id, it should be a valid mail account otherwise mail server can reject the sender address.

QuickTip use exim for normal mail but stop for secure smtp server

Isn’t this weird? most people ask how to configure a mail server for secure smtp but one of my friend told me that he has a server which running Exim mail server on both port 25 (normal) and port 465 (secure smtp) now he is facing difficulties because the SSL certificates which Exim uses are expired. He wanted to close port 465 without affecting port 25 used by their scripts.

Here’s what I did and worked but if you have better idea or something to add, I’ll be glad to hear.

Get Adobe Flash playerPlugin by wpburn.com wordpress themes