-3

I try to setup email server already 2 days, everything work flawless when i use roundcube on PC, I can send and receive emails, but problems start when I want to setup my email on iPhone. I can receive emails, but can't send any.

Dec 25 15:44:16 servername postfix/smtpd[17833]: Anonymous TLS connection established from unknown[120.218.*.*]: TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)
Dec 25 15:44:16 servername postfix/smtpd[17833]: NOQUEUE: reject: RCPT from unknown[120.218.*.*]: 454 4.7.1 <recipientMail@gmail.com>: Relay access denied; from=<myEmail> to=<recipientMail@gmail.com> proto=ESMTP helo=<[192.168.1.104]>
Dec 25 15:44:17 kaka90 postfix/smtpd[17833]: disconnect from unknown[120.218.*.*]

I run it on ubuntu with SSL/TLS, postfix+debian. Postfix has no auth. Here's my main.cf:

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

readme_directory = no

smtpd_tls_cert_file = /etc/ssl/domain/2_domain.crt
smtpd_tls_key_file =  /etc/ssl/startssl/myserver.key
smtpd_tls_CAfile = /etc/ssl/domain/1_root_bundle.crt
smtpd_use_tls=yes
smtp_use_tls=yes
smtpd_tls_auth_only = no
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_tls_security_level = may
smtp_tls_security_level = may
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
smtpd_tls_mandatory_ciphers = high
tls_high_cipherlist=EDH+CAMELLIA(****)
smtpd_tls_loglevel = 1
smtp_tls_loglevel = 1
smtpd_tls_received_header = yes
broken_sasl_auth_clients = yes
smtpd_delay_reject = yes

smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_local_domain =
smtpd_sasl_security_options=noanonymous
smtpd_recipient_restrictions = permit_sasl_authenticated, reject_unauth_destination, permit_mynetworks check_relay_domains

myhostname = domain
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = domain
mydestination = domain, localhost.domain, localhost
relayhost =
mynetworks = 127.0.0.0/8 192.168.0.0/16 [::ffff:127.0.0.0]/104 [::1]/128
#mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
user328817
  • 3
  • 1
  • 3
  • You need some authentication, as configured with `smtpd_recipient_restrictions = permit_sasl_authenticated, reject_unauth_destination, ...` – mschuett Dec 25 '15 at 15:51

1 Answers1

1

You are probably using Roundcube on the server, and localhost is by default authorized to send mail. Your iPhone is coming from an external IP, and it will probably regularly change IP over time, so you cannot simply authorize that IP to send mail. You need to authenticate yourself to postfix with a login/password to be authorized to send mail, in the same way you authenticate yourself to dovecot to be authorized to read your mail.

Postfix seems to be already set up to allow this (smtpd_recipient_restrictions = permit_sasl_authenticated), but have you configured your iPhone to connect with the same login/password when sending mail as it is using to read mail? You might also want to tell it to connect to the submission port (587) instead of the smtp port (25), if you have not already done that.

Law29
  • 3,557
  • 1
  • 16
  • 28
  • Thanks for reply, i alraedy changed port to 465. The problem is that I cannot send any email outside my network, for example gmail, outlook etc NOQUEUE: reject: RCPT from localhost Relay access denied; from= – user328817 Dec 28 '15 at 16:20
  • 1
    Have you configured your iPhone to connect with the same login/password when sending mail as it is using to read mail? You might also want to tell it to connect to the submission port (587) instead of the smtp port (25), if you have not already done that. – Law29 Dec 28 '15 at 17:51