Results 1 to 2 of 2

Thread: Ubuntu 13.04 Server - Postfix/Dovecot - SMTP Port Change

  1. #1
    Join Date
    May 2013
    Beans
    17

    Ubuntu 13.04 Server - Postfix/Dovecot - SMTP Port Change

    My ISP blocks all the main ports - 25, 465, 587, so I have to use a different port number. I edited /etc/postfix/master.cf and changed the line
    smtp inet n - - - - smtp
    to
    9000 inet n - - - - smtpd
    and restarted postfix.

    Before I did this I had no issues sending mail on my local network, but once I tried to send an email after changing the port, in SquirrelMail I received this error
    ERROR:Message not sent. Server replied:
    Connection refused
    111 Can't open SMTP stream.
    Where did I go wrong? Also, as soon as I did this, I could no long access /squirrelmail/ through mail.example.com, which was working before.

    I had the port configured on my firewall and router. I set this up to use ISPConfig3 using the guide here. http://www.howtoforge.com/perfect-se...ot-ispconfig-3

    Any thoughts?

    Here is my master.cf
    9336 inet n - - - - smtpd
    #smtp inet n - - - 1 postscreen
    #smtpd pass - - - - - smtpd
    #dnsblog unix - - - - 0 dnsblog
    #tlsproxy unix - - - - 0 tlsproxy
    submission inet n - - - - smtpd
    -o syslog_name=postfix/submission
    -o smtpd_tls_security_level=encrypt
    -o smtpd_sasl_auth_enable=yes
    -o smtpd_client_restrictions=permit_sasl_authenticate d,reject
    # -o smtpd_reject_unlisted_recipient=no
    # -o smtpd_client_restrictions=$mua_client_restrictions
    # -o smtpd_helo_restrictions=$mua_helo_restrictions
    # -o smtpd_sender_restrictions=$mua_sender_restrictions
    # -o smtpd_recipient_restrictions=permit_sasl_authentic ated,reject
    # -o milter_macro_daemon_name=ORIGINATING
    smtps inet n - - - - smtpd
    -o syslog_name=postfix/smtps
    -o smtpd_tls_wrappermode=yes
    -o smtpd_sasl_auth_enable=yes
    -o smtpd_client_restrictions=permit_sasl_authenticate d,reject
    # -o smtpd_reject_unlisted_recipient=no
    # -o smtpd_client_restrictions=$mua_client_restrictions
    # -o smtpd_helo_restrictions=$mua_helo_restrictions
    # -o smtpd_sender_restrictions=$mua_sender_restrictions
    # -o smtpd_recipient_restrictions=permit_sasl_authentic ated,reject
    # -o milter_macro_daemon_name=ORIGINATING
    #628 inet n - - - - qmqpd
    pickup unix n - - 60 1 pickup
    cleanup unix n - - - 0 cleanup
    qmgr unix n - n 300 1 qmgr
    #qmgr unix n - 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
    relay unix - - - - - smtp
    # -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
    maildrop unix - n n - - pipe
    flags=DRhu user=vmail argv=/usr/bin/maildrop -d vmail ${extension} ${recipient} ${user} ${nexthop} ${sender}

    #cyrus unix - n n - - pipe
    # user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
    #old-cyrus unix - n n - - pipe
    # flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
    uucp unix - n n - - pipe
    flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
    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}
    dovecot unix - n n - - pipe
    flags=DROhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -f ${sender} -d ${user}@${nexthop}
    amavis unix - - - - 2 smtp
    -o smtp_data_done_timeout=1200
    -o smtp_send_xforward_command=yes

    127.0.0.1:10025 inet n - - - - smtpd
    -o content_filter=
    -o local_recipient_maps=
    -o relay_recipient_maps=
    -o smtpd_restriction_classes=
    -o smtpd_client_restrictions=
    -o smtpd_helo_restrictions=
    -o smtpd_sender_restrictions=
    -o smtpd_recipient_restrictions=permit_mynetworks,rej ect
    -o mynetworks=127.0.0.0/8
    -o strict_rfc821_envelopes=yes
    -o receive_override_options=no_unknown_recipient_chec ks,no_header_body_checks
    Last edited by xExekut3x; July 2nd, 2013 at 12:29 AM.

  2. #2
    Join Date
    May 2013
    Beans
    17

    Re: Ubuntu 13.04 Server - Postfix/Dovecot - SMTP Port Change

    Well, I found out that if I change the SMTP port to something other than 25, I wont' be able to receive emails. I reverted things back to port 25.

    Now I'm trying to to use a relay host. I set it up using this method.
    cp /etc/postfix/main.cf /etc/postfix/main.cf.orig
    chmod a-w /etc/postfix/main.cf.orig
    nano /etc/postfix/main.cf
    added
    relayhost = [smtp.gmail.com]:587
    smtp_use_tls=yes
    smtp_sasl_auth_enable = yes
    smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd
    smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
    smtp_sasl_security_options =
    debug_peer_list=smtp.gmail.com
    debug_peer_level=3
    created
    nano /etc/postfix/sasl/sasl_passwd
    put in
    [smtp.gmail.com]:587 username: password
    then ran
    postmap /etc/postfix/sasl/sasl_passwd
    chmod 600 /etc/postfix/sasl/sasl_passwd
    chmod 600 /etc/postfix/sasl/sasl_passwd.db
    /etc/init.d/postfix reload
    I'm able to send emails out now, even though they all appear as being sent from my Gmail account, but I guess that's how it works. I tried to send an email from my Hotmail account to my home server. It has yet to arrive, so I'm not too sure if it'll work. I'm guessing not, since my ISP blocks port 25.
    Last edited by xExekut3x; July 2nd, 2013 at 02:17 AM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •