I've been using Postfix on my CentOS 6 Server on it's default install settings but I would like to configure it to use the mail server from my existing email.

I altered the /etc/postfix/main.cf file by adding

relayhost = [mail.mywebsite.com]:993

Then at the bottom I added

smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous

Then in /etc/postfix/sasl_passwd I added

[mail.mywebsite.com]:993    my_uname:my_pword

I gave that file 600 permissions, then ran

# postmap /etc/postfix/sasl_passwd

and finally I restarted postfix. After these changes it no longer works as when I try to send an email I am getting the following error

-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
2FF29F0F        355 Thu Jun  4 11:56:24  root@centos6.localdomain
(lost connection with mail.mywebsite.com[] while receiving the
initial server greeting)

-- 0 Kbytes in 1 Request

Is there something that I did wrong in setting this up?

  • Not sure what you're trying to achieve here. Port 993 is for IMAP but postfix is an SMTP server. Do you want to forward incoming messages on your CentOS postfix service to your company's internal mail server? Or do you want to use postfix to read messages from your company's mail server?
    – user86969
    Jun 4 '15 at 11:53
  • I'm hoping to use it as a relay Jun 4 '15 at 12:00

Postfix is an SMTP server, but port 993 is used for IMAPS. Try using 25, 465 or 587 instead, depending on what mail.mywebsite.com supports.

  • Thanks a bunch, I have a second option for my relay I will try that and leave it's port as default and I'll let you know Jun 4 '15 at 12:14
  • worked perfectly, I didn't realise the IMAP would be an issue, thanks a bunch man Jun 4 '15 at 13:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.