setting smtp server port

Discussion in 'Installation/Configuration' started by bobwdn, Jan 26, 2009.

  1. bobwdn

    bobwdn Member

    I have been attempting to set up ISPConfig to relay email through a smtp server available at our ISP. I have followed the very good Thank you, Falko.

    My ISP tells me that I need to be sending relays to on port 465. It is my understand, through various articles I have read, that this is accomplished by adding a colon and 465 after the server. Like this >>, then as the howto indicates, followed by a space and the [email protected]:userpassword.

    I am tailing the mail.log and still seeing server connections at port 25 that are timing out. And no mail relay happening (I think.) Should this not be port 465 timing out?

    I must admit that I am not sure how to test this, but I have yet to receive a test email sent to myself at a different address.

    As I am using dynamic dns services through dyndns, I need to use email relay to send emails.

    I am able to receive emails on my ISPConfig server, just cannot send.

    Am I setting the port correctly, our is this handled differently in postfix?
  2. merlincc

    merlincc New Member and sasl_passwd

    Both files need to be changed.

    In /etc/postfix/

    relayhost = []:465

    In /etc/postfix/sasl_passwd:

    []:465 [email protected]:userpassword

    Don't forget to do a postmap on sasl_passwd:

    postmap /etc/postfix/sasl_passwd

    Finally restart postfix:

    /etc/init.d/postfix restart
    Last edited: Jan 26, 2009
  3. bobwdn

    bobwdn Member

    Now I am getting this

    Thanks, Merlincc. That is getting me closer.

    Now, my mail.log file says this: Jan 26 15:15:23 [myemailserverhostname] postfix/smtp[9363]: 1DD9024B19: to=<[email protected]>,[]:465, delay=2722, delays=2602/0.02/120/0, dsn=4.4.2, status=deferred (lost connection with[] while performing the EHLO handshake)

    (Okay, I have changed some hostname and users to protect myself.)

    And still no emails receive that I have sent to myself.

    But, I have progressed to the "EHLO handshake" which, I think is good?
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Is "" the server that you used for relaying the email?
  5. bobwdn

    bobwdn Member


    yes, and I was instructed by ISP to use port 465.
  6. bobwdn

    bobwdn Member

    Additional info

    I have been looking into Postfix.

    Found some tests to run. The command "telnet" yields an ip address followed by dots (example, Trying A telnet request to "" yields the same result "Trying"

    These test also suggest to "ping" various ip addresses, however, if I am remembering correctly, the "perfect server" howto I followed sets the server to NOT respond to pings. Maybe?

    Maybe I am wrong, but I think that does not look correct? Hum-m-m-m!
    Last edited: Jan 27, 2009
  7. falko

    falko Super Moderator ISPConfig Developer

    You must specify a port in the telnet command, e.g.
    telnet 465
  8. bobwdn

    bobwdn Member

    telnet to port 465

    Okay, now when I "telnet 465" I get "Connected to" and a second line that says "Escape character is '^]'."

    I still am not receiving email relayed thru to an outside testing world email address. (i.e. me at a different email address.)
  9. bobwdn

    bobwdn Member

    Additional info

    I have an extra computer here, loaded with Debian. Installed Icedove mail client and set up a fake email user. Set outgoing email server to my "" on port 465 and sent a test message. The properly asked for password and on input (of password) sent the email and it was received at my test location.

    So, the relay smtp server works and there is no authentication issue regarding the user and password set on

    Which tells me that the problem should be some setting I have incorrectly entered. I followed the instructions of and have re-checked those settings and all appears to be correct, but . . . . what can it be?
  10. bobwdn

    bobwdn Member

    copy of my file

    Still not working. Here is a copy of my file:

    [email protected]:/home/robert# cat /etc/postfix/
    # See /usr/share/postfix/ for a commented, more complete version
    # Debian specific:  Specifying a file name will cause the first
    # line of that file to be used as the name.  The Debian default
    # is /etc/mailname.
    #myorigin = /etc/mailname
    smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
    biff = no
    # appending .domain is the MUA's job.
    append_dot_mydomain = no
    # Uncomment the next line to generate "delayed mail" warnings
    #delay_warning_time = 4h
    readme_directory = no
    # TLS parameters
    smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
    smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
    smtpd_use_tls = yes
    smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
    smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
    # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
    # information on enabling SSL in the smtp client.
    myhostname =
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    mydestination =,, localhost.localdomain, localhost
    relayhost = []:465
    mynetworks = [::ffff:]/104 [::1]/128
    mailbox_command = 
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    inet_protocols = all
    smtpd_sasl_local_domain = 
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_security_options = noanonymous
    broken_sasl_auth_clients = yes
    smtpd_sasl_authenticated_header = yes
    smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
    smtpd_tls_auth_only = no
    smtp_use_tls = yes
    smtp_tls_note_starttls_offer = yes
    smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
    smtpd_tls_loglevel = 1
    smtpd_tls_received_header = yes
    smtpd_tls_session_cache_timeout = 3600s
    tls_random_source = dev:/dev/urandom
    home_mailbox = Maildir/
    virtual_maps = hash:/etc/postfix/virtusertable
    mydestination = /etc/postfix/local-host-names
    smtp_sasl_auth = yes
    smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
    smtp_sasl_security_options = 
    smtp_sasl_auth_enable = yes
    After reading various forums regarding Postfix and this problem, most forum posts agreed with merlincc post about using [brackets] around the smtpserver host name. He must also have an AT&T/SBC/Ameritech type account. This may be part of the problem, the unique way that AT&T/SBC/Ameritech "leads the industry" technology. I do not know at this moment.

    I am still receiving the following mail.log entries:

    Jan 28 06:55:08 xxx02 postfix/error[14606]: 767B524A7E: to=<[email protected]>, relay=none, delay=1507, delays=1507/0.02/0/0.03, dsn=4.4.2, status=deferred (delivery temporarily suspended: lost connection with[] while performing the EHLO handshake)
    And as if this morning I see this:

    Jan 28 07:00:08 xxx02 postfix/smtp[14680]: 19CC824A5D: to=<[email protected]>,[]:465, delay=59408, delays=59408/0.02/0.24/0, dsn=4.4.2, status=deferred (lost connection with[] while receiving the initial server greeting
    This has been challenging, but I am learning things.

    Should I move to a Postfix forum? Ubuntu occasionally has unique ways of doing some things. Is it Ubuntu related?
  11. falko

    falko Super Moderator ISPConfig Developer

    Hm... seems to be ok. Did you compare the Postfix configuration ( and on both systems?
  12. bobwdn

    bobwdn Member file

    Yes, but my inexperience is not sure what I am to be looking for.

    A brief re-cap here, my test Debian system with Icedove (Thunderbird) client setup send emails through my works.

    Some Postfix forums and mailing lists are mentioning enclosing the server host within [brackets] and that the port reference should be located after the final bracket ( i.e. [bracket]:465). These are for AT&T/SBC/Ameritech smtp servers.

    My file

    [email protected]:~$ cat /etc/postfix/
    # Postfix master process configuration file.  For details on the format
    # of the file, see the master(5) manual page (command: "man 5 master").
    # Do not forget to execute "postfix reload" after editing this file.
    # ==========================================================================
    # service type  private unpriv  chroot  wakeup  maxproc command + args
    #               (yes)   (yes)   (yes)   (never) (100)
    # ==========================================================================
    smtp      inet  n       -       -       -       -       smtpd
    #submission inet n       -       -       -       -       smtpd
    #  -o smtpd_tls_security_level=encrypt
    #  -o smtpd_sasl_auth_enable=yes
    #  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
    #  -o milter_macro_daemon_name=ORIGINATING
    #smtps     inet  n       -       -       -       -       smtpd
    #  -o smtpd_tls_wrappermode=yes
    #  -o smtpd_sasl_auth_enable=yes
    #  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
    #  -o milter_macro_daemon_name=ORIGINATING
    #628      inet  n       -       -       -       -       qmqpd
    pickup    fifo  n       -       -       60      1       pickup
    cleanup   unix  n       -       -       -       0       cleanup
    qmgr      fifo  n       -       n       300     1       qmgr
    #qmgr     fifo  n       -       -       300     1       oqmgr
    tlsmgr    unix  -       -       -       1000?   1       tlsmgr
    rewrite   unix  -       -       -       -       -       trivial-rewrite
    bounce    unix  -       -       -       -       0       bounce
    defer     unix  -       -       -       -       0       bounce
    trace     unix  -       -       -       -       0       bounce
    verify    unix  -       -       -       -       1       verify
    flush     unix  n       -       -       1000?   0       flush
    proxymap  unix  -       -       n       -       -       proxymap
    proxywrite unix -       -       n       -       1       proxymap
    smtp      unix  -       -       -       -       -       smtp
    # When relaying mail as backup MX, disable fallback_relay to avoid MX loops
    relay     unix  -       -       -       -       -       smtp
    	-o smtp_fallback_relay=
    #       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
    showq     unix  n       -       -       -       -       showq
    error     unix  -       -       -       -       -       error
    retry     unix  -       -       -       -       -       error
    discard   unix  -       -       -       -       -       discard
    local     unix  -       n       n       -       -       local
    virtual   unix  -       n       n       -       -       virtual
    lmtp      unix  -       -       -       -       -       lmtp
    anvil     unix  -       -       -       -       1       anvil
    scache    unix  -       -       -       -       1       scache
    # ====================================================================
    # Interfaces to non-Postfix software. Be sure to examine the manual
    # pages of the non-Postfix software to find out what options it wants.
    # Many of the following services use the Postfix pipe(8) delivery
    # agent.  See the pipe(8) man page for information about ${recipient}
    # and other message envelope options.
    # ====================================================================
    # maildrop. See the Postfix MAILDROP_README file for details.
    # Also specify in maildrop_destination_recipient_limit=1
    maildrop  unix  -       n       n       -       -       pipe
      flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
    # See the Postfix UUCP_README file for configuration details.
    uucp      unix  -       n       n       -       -       pipe
      flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
    # Other external delivery methods.
    ifmail    unix  -       n       n       -       -       pipe
      flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
    bsmtp     unix  -       n       n       -       -       pipe
      flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
    scalemail-backend unix	-	n	n	-	2	pipe
      flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
    mailman   unix  -       n       n       -       -       pipe
      flags=FR user=list argv=/usr/lib/mailman/bin/
      ${nexthop} ${user}
    All these forums make it clear that many users have stuggled with this setup when relaying through certain smtp servers.

    What next?
  13. bobwdn

    bobwdn Member

    it is fixed

    During the night I decided to give up trying to configure and use our AT&T smtp server. I have setup a Gmail account to use for now.

    Now, my only problem is how to relay my email servers address through so it does not say blahuser <[email protected] in the "from" address box of sent emails.

    Thanks for everyones help. I would have needed it to get Gmail smtp working.:)

    BTW, Falko, great howto's!!!! Thanks!!
  14. falko

    falko Super Moderator ISPConfig Developer

    As far as I remember, there is a thread in this forum that has the solution for the Gmail problem. But I can't find it right now... :eek:
  15. bobwdn

    bobwdn Member

    cannot remember

    Yes, I remember reading an article here as well as elsewhere on the internet. But right now I cannot remember what to search for.

    I have learned that with all the "new" ways used to combat spam email, etc. I cannot get my gmail account to set a "REPLY TO" type box with sent emails.

    I will keep looking. Thanks.
  16. happz

    happz Member

    bobwnd! Good luck to you on this...

    I have tried and tried to make what you are doing work and i wish you all the luck in the world. Let me know if you success! :)

Share This Page