I've done some googling on this, and often people do site this setting as a potential cause of this situation. Here's mine, although nothing seems to stand out:
smtpd_recipient_restrictions = reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_non_fqdn_recipient, reject_unknown_recipient_domain, reject_unauth_destination, check_policy_service inet:127.0.0.1:10023, permit
Here is the output of postconf -n
root@mail:~# postconf -n
alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = no
config_directory = /etc/postfix
content_filter = amavis:[127.0.0.1]:10024
delay_warning_time = 4h
disable_vrfy_command = yes
inet_interfaces = all
local_recipient_maps =
mailbox_size_limit = 0
masquerade_domains = mail.example.com example.com !sub.dyndomain.com
masquerade_exceptions = root
maximal_backoff_time = 8000s
maximal_queue_lifetime = 7d
minimal_backoff_time = 1000s
mydestination =
myhostname = mail.example.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mynetworks_style = host
myorigin = example.com
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_helo_timeout = 60s
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_client_restrictions = reject_rbl_client sbl.spamhaus.org, reject_rbl_client blackholes.easynet.nl
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_delay_reject = yes
smtpd_hard_error_limit = 12
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks, warn_if_reject reject_non_fqdn_hostname, reject_invalid_hostname, permit
smtpd_recipient_limit = 16
smtpd_recipient_restrictions = reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_non_fqdn_recipient, reject_unknown_recipient_domain, reject_unauth_destination, check_policy_service inet:127.0.0.1:10023, permit
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_sasl_auth_enable = yes
Another potential trouble area may be that I can't seem to telnet to port 25 remotely from my work station:
[me@home:~] #telnet mail.example.com 25
Trying xx.xx.xx.xx..
telnet: connect to address xx.xx.xx.xx: Operation timed out
telnet: Unable to connect to remote host
As mentioned this is an amazon EC2 instance, but I have opened up port 25 on the security groups and made sure that ufw (the ubuntu firewall) was not running on the instance.
I'd definitely appreciate your esteemed advice on this!
Thanks,
Tim
Mar 16 02:27:58 mail postfix/smtpd[22335]: connect from n11-vm3.bullet.mail.bf1.external.com[66.196.81.194]
Mar 16 02:27:59 mail postfix/smtpd[22335]: Anonymous TLS connection established from n11-vm3.bullet.mail.bf1.external.com[66.196.81.194]: TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)
Mar 16 02:27:59 mail postfix/smtpd[22335]: NOQUEUE: reject: RCPT from n11-vm3.bullet.mail.bf1.external.com[66.196.81.194]: 454 4.7.1 <bluet...@example.com>: Relay access denied; from=<reg.gi3tqmjyge4dama-bluethundr=examp...@returns.bulk.external.com> to=<bluet...@example.com> proto=ESMTP helo=<n11-vm3.bullet.mail.bf1.external.com>
Mar 16 02:27:59 mail postfix/smtpd[22335]: disconnect from n11-vm3.bullet.mail.bf1.external.com[66.196.81.194]
Mar 16 02:30:55 mail postfix/smtpd[22335]: connect from n11-vm3.bullet.mail.bf1.external.com[66.196.81.194]
Mar 16 02:30:55 mail postfix/smtpd[22335]: Anonymous TLS connection established from n11-vm3.bullet.mail.bf1.external.com[66.196.81.194]: TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)
Mar 16 02:30:55 mail postfix/smtpd[22335]: NOQUEUE: reject: RCPT from n11-vm3.bullet.mail.bf1.external.com[66.196.81.194]: 454 4.7.1 <bluet...@example.com>: Relay access denied; from=<reg.gi3tqmjyge4dama-bluethundr=examp...@returns.bulk.external.com> to=<bluet...@example.com> proto=ESMTP helo=<n11-vm3.bullet.mail.bf1.external.com>
Mar 16 02:30:55 mail postfix/smtpd[22335]: disconnect from n11-vm3.bullet.mail.bf1.external.com[66.196.81.194]
Mar 16 02:31:41 mail postfix/smtpd[22335]: connect from nm48.bullet.mail.ne1.external.com[98.138.120.55]Mar 16 02:31:41 mail postfix/smtpd[22335]: NOQUEUE: reject: RCPT from nm48.bullet.mail.ne1.external.com[98.138.120.55]: 454 4.7.1 <bluet...@example.com>: Relay access denied; from=<blueth...@external.com> to=<bluet...@example.com> proto=SMTP helo=<nm48.bullet.mail.ne1.external.com>Mar 16 02:31:41 mail postfix/smtpd[22335]: disconnect from nm48.bullet.mail.ne1.external.com[98.138.120.55]
Mar 16 02:33:24 mail postfix/smtpd[22335]: connect from nm48.bullet.mail.ne1.external.com[98.138.120.55]
Mar 16 02:33:24 mail postfix/smtpd[22335]: NOQUEUE: reject: RCPT from nm48.bullet.mail.ne1.external.com[98.138.120.55]: 454 4.7.1 <bluet...@example.com>: Relay access denied; from=<blueth...@external.com> to=<bluet...@example.com> proto=SMTP helo=<nm48.bullet.mail.ne1.external.com>
Mar 16 02:33:24 mail postfix/smtpd[22335]: disconnect from nm48.bullet.mail.ne1.external.com[98.138.120.55]
And here's an example from gmail
Mar 16 02:23:20 mail postfix/smtpd[21652]: NOQUEUE: reject: RCPT from mail-la0-f48.google.com[209.85.215.48]: 454 4.7.1 <bluet...@example.com>: Relay access denied; from=<bluet...@external.com> to=<bluet...@example.com> proto=ESMTP helo=<mail-la0-f48.google.com>
Mar 16 02:35:01 mail postfix/smtpd[22335]: NOQUEUE: reject: RCPT from mail-lb0-f177.google.com[209.85.217.177]: 454 4.7.1 <bluet...@example.com>: Relay access denied; from=<bluet...@external.com> to=<bluet...@example.com> proto=ESMTP helo=<mail-lb0-f177.google.com>
OK, so it seems as if I'm in the home stretch! What do I need to alter in my postfix configuration to get this mail server rocking?
Thanks!
Tim
Postfix doesn't know it should accept mail for example.com.
example.com must be listed in *one* of mydestination, relay_domains,
virtual_mailbox_domains, virtual_alias_domains, depending on where
the mail is to be delivered.
mysql> select * from domains;
+------+-----------------------+-----------+---------+
| pkid | domain | transport | enabled |
+------+-----------------------+-----------+---------+
| 1 | localhost | virtual: | 1 |
| 2 | localhost.localdomain | virtual: | 1 |
| 3 | example.com | virtual: | 1 |
| 4 | mail.example.com | virtual: | 1 |
| 5 | example2.com | virtual: | 1 |
| 6 | mail.example2.com | virtual: | 1 |
+------+-----------------------+-----------+---------+
6 rows in set (0.00 sec)
It seems that postfix is able to read from the database, as would be evidenced of my being able to receive emails to accounts that are stored in the db. So why it's unable to read from the domains list is a bit puzzling.
Here's my current postconf -n output if anyone would like to help with advice on why virtual domains aren't working as desired.
[root@mail:~] #postconf -n
alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = no
config_directory = /etc/postfix
content_filter = amavis:[127.0.0.1]:10024
delay_warning_time = 4h
disable_vrfy_command = yes
inet_interfaces = all
local_recipient_maps =
mailbox_size_limit = 0
masquerade_domains = mail.jokefire.com jokefire.com !sub.dyndomain.com
masquerade_exceptions = root
maximal_backoff_time = 8000s
maximal_queue_lifetime = 7d
minimal_backoff_time = 1000s
mydestination = mail.jokefire.com jokefire.com
myhostname = mail.jokefire.com
mynetworks = 127.0.0.0/8 mail.jokefire.com
mynetworks_style = host
myorigin = jokefire.com
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_helo_timeout = 60s
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_client_restrictions = reject_rbl_client sbl.spamhaus.org, reject_rbl_client blackholes.easynet.nl
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_delay_reject = yes
smtpd_hard_error_limit = 12
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks, warn_if_reject reject_non_fqdn_hostname, reject_invalid_hostname, permit
smtpd_recipient_limit = 16
smtpd_recipient_restrictions = reject_unauth_pipelining, permit_mynetworks, permit_sasl_authenticated, reject_non_fqdn_recipient, reject_unknown_recipient_domain, reject_unauth_destination, check_policy_service inet:127.0.0.1:10023, permit
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks, warn_if_reject reject_non_fqdn_sender, reject_unknown_sender_domain, reject_unauth_pipelining, permit
smtpd_soft_error_limit = 3
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
transport_maps = mysql:/etc/postfix/mysql_transport.cf
unknown_local_recipient_reject_code = 450
virtual_alias_maps = mysql:/etc/postfix/mysql_alias.cf
virtual_gid_maps = static:5000
virtual_mailbox_base = /var/spool/mail/virtual
virtual_mailbox_domains = mysql:/etc/postfix/mysql_domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql_mailbox.cf
virtual_uid_maps = static:5000
Thanks!
Tim