1

I am managing a server which mainly deals in relaying mail using virtual alias maps. For some reason unknown to me email that goes through these maps are getting bounced. I've checked to make sure the domains are in my virtual_alias_domains table but they are still bouncing. I've consulted the postfix site but everything seems to be set correctly. How can I diagnose this issue?

Below is information that might be of help:

Aug  2 00:07:01 server2 postfix/smtpd[6729]: NOQUEUE: reject: RCPT from <sender address>: 454 4.7.1 <recipient address>: Relay access denied; from=<sender address> to=<recipient address> proto=ESMTP helo=<sender server>

# postconf -n
alias_database = hash:/usr/local/etc/postfix/aliases
alias_maps = hash:/usr/local/etc/postfix/aliases, hash:/usr/local/etc/postfix/aliases-www
command_directory = /usr/local/sbin
config_directory = /usr/local/etc/postfix
daemon_directory = /usr/local/libexec/postfix
data_directory = /var/db/postfix
debug_peer_level = 2
html_directory = /usr/local/share/doc/postfix
mail_owner = postfix
mailbox_command = /usr/local/bin/procmail
mailbox_size_limit = 524288000
mailq_path = /usr/local/bin/mailq
manpage_directory = /usr/local/man
message_size_limit = 40960000
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
myhostname = mymailserver.domain.com
mynetworks = #list of ip's#
myorigin = $mydomain
newaliases_path = /usr/local/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/local/share/doc/postfix
sample_directory = /usr/local/etc/postfix
sendmail_path = /usr/local/sbin/sendmail
setgid_group = maildrop
soft_bounce = yes
unknown_local_recipient_reject_code = 450
virtual_alias_domains = hash:/usr/local/etc/postfix/virtual-alias-domains
virtual_alias_maps = hash:/usr/local/etc/postfix/virtusertable
virtual_mailbox_base = /var/mail
virtual_mailbox_limit = 524288000
devnill
  • 307
  • 1
  • 2
  • 19

3 Answers3

1

So wait. Get your wording right.

When you have virtual_alias_maps then this is to deliver mails to local mailboxes and not for relaying mails for others.

When you want to relay mails for other domains you need something like transport_maps or relay_domains and relay_recipient_maps.

See http://www.postfix.org/STANDARD_CONFIGURATION_README.html for examples.

How do your logs look like when mails bounce?

Daniel Böhmer
  • 271
  • 2
  • 13
mailq
  • 17,023
  • 2
  • 37
  • 69
  • I am using the maps to sent to remote mailboxes but it still *should* work: "virtual_alias_maps (default: $virtual_maps) Optional lookup tables that alias specific mail addresses or domains to other local or **remote address**." My logs only show that “User unknown in virtual alias table”. When I run postmap -q on virtual_alias_domains and virtual_alias_maps it returns the correct result and I've made sure that postfix can read the files. – devnill Aug 05 '11 at 08:56
  • Show the content of both virtual_alias_* files. – mailq Aug 05 '11 at 09:48
1
# postconf -d smtpd_recipient_restrictions
smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_destination

# postconf -d mynetworks
mynetworks = 127.0.0.0/8 <serversSubnet>

You might want:

smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination

or

mynetworks = 127.0.0.0/8 <serversSubnet> <clientSubnet>

or maybe both.

Daniel Böhmer
  • 271
  • 2
  • 13
84104
  • 12,905
  • 6
  • 45
  • 76
  • 1
    the '-d' flag in 'postconf -d' will show the defaults. If you wish to display the active configuration just do 'postconf mynetworks' – omencat Jun 03 '16 at 22:59
-1

You may want to check that the receiving SMTP server does not have the subject server blocked.

user48838
  • 7,431
  • 2
  • 18
  • 14
  • None of the servers should blocked. I can receive mail using other transport methods, just not using the mapping. Is there a place I can look to see if I am inadvertently blocking? – devnill Aug 02 '11 at 08:37
  • "454 4.7.1 : Relay access denied" appears to be from the destination SMTP server. – user48838 Aug 02 '11 at 12:36