setting smtp server port

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

  1. bobwdn

    bobwdn Member HowtoForge Supporter

    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 http://www.howtoforge.com/postfix_relaying_through_another_mailserver. Thank you, Falko.

    My ISP tells me that I need to be sending relays to smtpserver.blah.net 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 >> smtpserver.blah.net:465, 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

  3. bobwdn

    bobwdn Member HowtoForge Supporter

    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]>, relay=smtpserver.blah.net[xxx.xxx.xx.xx]:465, delay=2722, delays=2602/0.02/120/0, dsn=4.4.2, status=deferred (lost connection with smtpserver.blah.net[xxx.xxx.xx.xx] 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 "smtpserver.blah.net" the server that you used for relaying the email?
     
  5. bobwdn

    bobwdn Member HowtoForge Supporter

    smtpserver

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

    bobwdn Member HowtoForge Supporter

    Additional info

    I have been looking into Postfix.

    Found some tests to run. The command "telnet smtpserver.blah.net" yields an ip address followed by dots (example, Trying xxx.xxx.xxx.xx....) A telnet request to "relay-test.mail-abuse.org" yields the same result "Trying 168.61.4.13..."

    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.
    Code:
    telnet smtpserver.blah.net 465
     
  8. bobwdn

    bobwdn Member HowtoForge Supporter

    telnet to port 465

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

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

    bobwdn Member HowtoForge Supporter

    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 "smtpserver.blah.net" on port 465 and sent a test message. The smtpserver.blah.net 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 smtpserver.blah.net.

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

    bobwdn Member HowtoForge Supporter

    copy of my main.cf file

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

    Code:
    [email protected]:/home/robert# cat /etc/postfix/main.cf
    # See /usr/share/postfix/main.cf.dist 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 = xxx02.blah.net
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    mydestination = xxx02.mydomain.com, localhost.mydomain.com, localhost.localdomain, localhost
    relayhost = [smtpserver.blah.net]:465
    mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/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:

    Code:
    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 smtpserver.blah.net[xxx.xxx.xxx.18] while performing the EHLO handshake)
    And as if this morning I see this:

    Code:
    Jan 28 07:00:08 xxx02 postfix/smtp[14680]: 19CC824A5D: to=<[email protected]>, relay=smtpserver.blah.net[xxx.xxx.xxx.18]:465, delay=59408, delays=59408/0.02/0.24/0, dsn=4.4.2, status=deferred (lost connection with smtpserver.blah.net[xxx.xxx.xxx.18] 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... main.cf seems to be ok. Did you compare the Postfix configuration (main.cf and master.cf) on both systems?
     
  12. bobwdn

    bobwdn Member HowtoForge Supporter

    master.cf 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 smtpserver.blah.net 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 master.cf file

    Code:
    [email protected]:~$ cat /etc/postfix/master.cf
    #
    # 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 main.cf: 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/postfix-to-mailman.py
      ${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 HowtoForge Supporter

    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 HowtoForge Supporter

    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