I'm running mail server on Ubuntu 12.04 and box has Web Server + Mail Server (Postfix + Dovecot). This is Virtual Machine setup on Windows Azure cloud.
Problem: I'm unable to send emails outside network. Following are the configuration and logs.
Postfix:
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
dovecot_destination_recipient_limit = 1
inet_interfaces = all
mailbox_size_limit = 0
mydestination = abc.cloudapp.net, localhost.abc.cloudapp.net, localhost
myhostname = abc.cloudapp.net
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_transport = dovecot
Dovecot:
# 2.0.19: /etc/dovecot/dovecot.conf
# OS: Linux 3.2.0-65-virtual x86_64 Ubuntu 12.04.4 LTS ext4
auth_mechanisms = plain login
mail_location = maildir:/var/vmail/%d/%n/Maildir
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date ihave
passdb {
args = /etc/dovecot/dovecot-sql.conf.ext
driver = sql
}
plugin {
sieve = ~/.dovecot.sieve
sieve_dir = ~/sieve
}
protocols = " imap sieve pop3"
service auth {
unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0660
user = postfix
}
unix_listener auth-userdb {
group = vmail
user = vmail
}
}
ssl_cert = </etc/ssl/certs/mailserver.pem
ssl_key = </etc/ssl/private/mailserver.pem
userdb {
args = uid=vmail gid=vmail home=/var/vmail/%d/%n
driver = static
}
protocol lda {
mail_plugins = " sieve"
}
/var/log/mail.log
Jul 9 08:40:11 layfootak postfix/smtpd[44127]: connect from unknown[87.109.35.199]
Jul 9 08:40:12 layfootak postfix/smtpd[44127]: NOQUEUE: reject: RCPT from unknown[87.109.35.199]: 554 5.7.1 <raheel@layfootak.com>: Relay access denied; from=<abc@example.com> to=<abc@otherdomain.com> proto=ESMTP helo=<[127.0.0.1]>
I'm able to configure and get emails properly with Mozilla Thunderbird email client. It shows my inbox properly but when I'm sending an email to other email address like outside network then it gives Relay access denied; from= to= proto=ESMTP helo=<[127.0.0.1]>
Please advise me.
I've fixed the Problem after setting up following postfix configuration for SMTP Relaying configuration:
sudo postconf -e smtpd_sasl_type=dovecot
sudo postconf -e smtpd_sasl_path=private/auth
sudo postconf -e smtpd_sasl_auth_enable=yes
sudo postconf -e smtpd_tls_security_level=may
sudo postconf -e smtpd_tls_auth_only=yes
sudo postconf -e smtpd_tls_cert_file=/etc/ssl/certs/mailserver.pem
sudo postconf -e smtpd_tls_key_file=/etc/ssl/private/mailserver.pem
sudo postconf -e smtpd_recipient_restrictions=" \
permit_mynetworks \
permit_sasl_authenticated \
reject_unauth_destination"