0

I have an ubuntu server installed on a remote server on amazon.

I'm trying to allow remote connections to send email per user/password that is configured by the ubuntu system. means each user in my system can send email using his own credentials.

first I opened port 25 in amazon's firewall.

then I configured the following files:

master.cf in postfix

I added the following lines:

submission inet n       -       -       -       -       smtpd
  -o syslog_name=postfix/submission
  -o smtpd_tls_wrappermode=no
  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject
  -o milter_macro_daemon_name=ORIGINATING
  -o smtpd_sasl_type=dovecot
  -o smtpd_sasl_path=private/auth

then i configured dovecot but adding the following lines at /etc/dovecot/conf.d/10-auth.conf

disable_plaintext_auth = no
service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0660
    user = postfix
  }
}
ssl=required
ssl_cert = </etc/ssl/certs/mailcert.pem
ssl_key = </etc/ssl/private/mail.key

and this is my main.cf in post:

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no

smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.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 = ip-172-31-42-234.us-west-2.compute.internal
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = tux-in.com, ip-172-31-42-234.us-west-2.compute.internal, localhost.us-west-2.compute.internal, localhost,     myalcoholist.com, myalcohollist.com
virtual_alias_domains = myalcoholist.com myalcohollist.com tux-in.com
virtual_alias_maps = hash:/etc/postfix/virtual
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
broken_sasl_auth_clients = yes
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
home_mailbox = Maildir/
mailbox_command =
local_recipient_maps = proxy:unix:passwd.byname $alias_maps

ok.. so far so good... i have dovecot installed, so i have an imap and pop3 servers and i can retrieve emails succesfuly.

now i want to configure my email client on my osx desktop to connect to the smtp server on amazon and send emails.

the problem that i'm having is that i can't connect to the smtp server from out side. i get connection timed out when i try to telnet. I am able to telnet from the local server to 127.0.0.1 on port 25. I checked and the inet interfaces is configured to all, and I did open the port 25 on amazon firewall, so the only thing that comes in mind is that for some reason postfix itself is blocking outside connections.

if postfix is blocking outside connections so i missed something in the configuration.

I'm kind of lost here.. any information regarding the issue would be greatly appreciated.

  • I guess amazon blocks your connections, chose a real server hosting. – sebix Oct 12 '15 at 18:24
1

submission is TCP/587 smtp is TCP/25

Sounds like a firewall issue, you may need to request port 25 open from aws support. Test if you can telnet to 587 and send email with authentication to a local mailbox.

You could still get email working if you send via a relay host on 587 and retrieve on an alterative port like 2525 via 3rd party spam filters.

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.