Telnet to Postfix

Hi,

I need to send e-mails from my website and the hosting company does not have any mail servers so I am trying a DIY with postfix. I have uninstalled sendmail but every time I try to connect it still seems to be using it:


telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 vps-cp.blacknight.com ESMTP Sendmail 8.14.1/8.14.1/SuSE Linux

I don’t even know if this is the best way to go about it… all suggestions welcome…

Did you run YaST > Mail Transfer Agent?

There you can enter the setting (last screen of the basic setup I think) to allow remote SMTP connections. By default only the localhost is allowed to connect.

Do make sure relaying is not allowed from the outside world or you will get spam and other nastiness relayed through your server.

For more detailed configuration you can run the MTA tool in Advanced mode or dive into the config found in /etc/postfix. master.cf & main.cf are the files to start with -but I’m guessing that’s overkill for what you are wanting to do.

Hope that helps,
Wj

Sorry this is all Greek to me… I ran what you suggested but I am not really sure what I’m at… can you give me some more information…

Ok… sorry :slight_smile: & I misread your question. I’ve re-read your first post making me realize you are still connecting to sendmail.

if you’ve uninstalled sendmail you probably need to reboot (easiest) or kill the sendmail process to release the sendmail daemon.

Also set postfix to start at boot with:
chkconfig postfix on
or start if after killing sendmail with:
service postfix start

You probably wont need to have to run the YaST > Mail Transfer Agent as postfix is running on your mailserver? So give the steps mentioned above a try first & retry the telnet thingy.

Cheers,
Wj

Ok, great - I got the mail working… I think it’s using postfix but I am really not sure… this sends me a mail from ‘root’

echo "test" | mail -s testsubject me@myemail.com

I setup postfix to use a secure connection on port 25… so this is what it looks like:

telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 server1.myserver.ie ESMTP Postfix
ehlo localhost
250-server1.myserver.ie
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
quit
221 2.0.0 Bye
Connection closed by foreign host.

Is there anyway I can drill down to see if the mail was sent securely or anything like that?

Telnet’ing to localhost presents the Postfix greeting… so you are set there!

As for secure…, double check that localhost is the only one allowed to connect. A simple test: telnet to the server with a remote pc. You should not be able to send mail or connect that way.

Also have a look at the config files I mentioned in /etc/postfix.
Run through the options to see if you have not set anything you don’t want to. By default postfix is set up to be secure.

If you want to dive into this you can read though the basic setup parameters here : Postfix Basic Configuration

Others might be able to give better pointers as I don’t do too much detail postfix configuration. Most important rule: make sure others can not relay using your host & keep packges up to date.

Hope that helps,
Wj

Great thanks for your help…