Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 02-21-2008, 06:01 AM   #1
Registered: Jun 2004
Location: Leiden, The Netherlands
Distribution: Slackware 10.2, SmoothWall Express v3, Kubuntu 7.04, Mac OS X.4
Posts: 69

Rep: Reputation: 15
postfix relayhost configuration (SMTPS)

Hi Everybody,

I'm trying to setup my postfix configuartion to send email via my ISP.

I've understand that you should use the "relayhost=" in
However my ISP uses SMTP-AUTH on port 465 (with SSL)

I've read that i should add the following lines and create the sasl_passwd file:
relayhost = []
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_use_tls = yes

However I've also read that my passwords are send in plain text on port 25.

How do I setup postfix so that my passwords are sent encrypted (SSL/TLS?!) over port 465 (this is the port my ISP uses)?
Old 02-21-2008, 10:59 PM   #2
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
have a look at smtp_sasl_tls_security_options at
Old 02-22-2008, 05:07 PM   #3
Registered: Jun 2004
Location: Leiden, The Netherlands
Distribution: Slackware 10.2, SmoothWall Express v3, Kubuntu 7.04, Mac OS X.4
Posts: 69

Original Poster
Rep: Reputation: 15

I think the noplaintext option was just what is was looking for.

Last edited by rutgerw; 02-22-2008 at 05:08 PM. Reason: typo
Old 02-19-2011, 03:02 AM   #4
Milan Knizek
LQ Newbie
Registered: Sep 2006
Posts: 2

Rep: Reputation: 0
I know that this thread is a bit old, but it popped up in google while I was trying to setup relaying local email to my external SMTP server (SSL encryption on port 465, plain text authentification).

Postfix version 2.8.0 does not support SMTP client mode on SSL port 465. Instead, one has to use a separate daemon stunnel (refer elsewhere how to set it up and run) to wrap the communication into ssl. Do not forget to check /etc/hosts.allow to allow connections to stunnel ("stunneld: ALL")

Once setup, add this to your stunnel.conf:

 accept = 11125
 client = yes
 connect =
and test by running "telnet localhost 11125" - you should be redirected to and get its greetings. Type "quit" to exit.
If you get error with libwrap (check /var/log/...), try adding "libwrap = no" to stunnel.conf and restart stunnel service.

The /etc/postfix/ configuration is similar as above, just the relay host is local:

relayhost = []:11125
smtp_sasl_type = cyrus
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_auth_enable = yes
   # optional: necessary if email provider
   # requires passwords sent in clear text
smtp_sasl_security_options = noanonymous
smtp_sasl_mechanism_filter = plain, login
  # optional: necessary if email provider uses load balancing and
  # forwards emails to another smtp server
  # for delivery (ie: -->
smtp_cname_overrides_servername = no
Also do not forget to create the credentials file /etc/postfix/sasl_passwd (set chmod go-rwx to protect it from non-root users):
# The server info must exactly match the value
# for "relayhost" in /etc/postfix/
[]:11125 my_login:my_password
and rebuild the password hash by typing "postmap hash:/etc/postfix/sasl_passwd".

Then restart postfix and try "telnet localhost 25" and type

EHLO localhost
MAIL FROM: <from-email>
RCPT TO: <recipient-email>
Type message here.
. <Enter>
The last line leaves DATA mode and email should be relayed by postfix. Watch /var/log files to see if it goes okay.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Postfix Configuration namit Linux - Server 1 02-18-2007 02:55 PM
postfix relayhost gabsik Linux - Networking 1 02-08-2007 03:51 AM
PostFix configuration jscedunn Linux - Enterprise 6 01-31-2007 12:49 PM
Do I need a relayhost? gubak Linux - Networking 1 08-23-2004 08:52 AM
postfix configuration argh2005 Linux - Networking 0 08-30-2003 11:35 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:17 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration