I thought I had everything working, but something broke. What I need to do is to accept mail for local delivery for several users on a couple domains (sermon-archive.info and one other) and relay mail for a number of users on domain (lafn.org) to a variety of different locations. Each user could be on a different server. My tests seemed to work, but when adding in the full tables, it broke. Here are the various config files etc:
mail# postconf -n
command_directory = /usr/local/sbin
compatibility_level = 2
daemon_directory = /usr/local/libexec/postfix
data_directory = /var/db/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
dovecot_destination_recipient_limit = 1
enable_long_queue_ids = yes
home_mailbox = Maildir/
html_directory = /usr/local/share/doc/postfix
inet_protocols = ipv4
local_recipient_maps = unix:passwd.byname $alias_maps
mail_owner = postfix
mail_spool_directory = /var/spool/mail
mailbox_size_limit = 0
mailq_path = /usr/local/bin/mailq
manpage_directory = /usr/local/man
max_use = 5
message_size_limit = 1024000000
mydestination = localhost.$mydomain, localhost
mydomain = sermon-archive.info
mynetworks_style = host
newaliases_path = /usr/local/bin/newaliases
postscreen_access_list = permit_mynetworks, cidr:/usr/local/etc/postfix/access.cidr
postscreen_greet_action = enforce
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
smtp_destination_recipient_limit = 25
smtpd_authorized_xclient_hosts = 10.0.1.0/24
smtpd_command_filter = pcre:/usr/local/etc/postfix/quote
smtpd_error_sleep_time = 10
smtpd_hard_error_limit = 10
smtpd_milters = unix:/var/run/clamav/clmilter.sock
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_soft_error_limit = 1
smtpd_tls_cert_file = /etc/ssl/certs/mail.pem
smtpd_tls_key_file = /etc/ssl/private/mail.key
smtpd_tls_loglevel = 1
smtpd_tls_security_level = may
unknown_local_recipient_reject_code = 550
virtual_alias_domains = hash:/usr/local/etc/postfix/vmail_domains
virtual_alias_maps = hash:/usr/local/etc/postfix/vmail_alias
virtual_gid_maps = static:2222
virtual_mailbox_base = /var/mail/
virtual_mailbox_domains = hash:/usr/local/etc/postfix/local_domains
virtual_mailbox_limit = 1024000000
virtual_mailbox_maps = hash:/usr/local/etc/postfix/vmail_mailbox
virtual_minimum_uid = 2222
virtual_transport = dovecot
virtual_uid_maps = static:2222
mail# more local_domains
mail# more vmail_alias
user1 [hidden email]
user2 [hidden email]
refund [hidden email]
Plus a bunch more. Other than postmaster, I thought that the left names should have @lafn.org, but that didn't seem to work either.
mail# more vmail_domains
mail# more vmail_mailbox
[hidden email] home_mail/doug/
[hidden email] home_mail/doug/
I also wanted to be able to have different users with the same name of different addresses such as [hidden email] and [hidden email] and have them go to different places. Both seem to get local delivery to doug.
I am sure I have something configured wrong.
When I try to send from a non-local system I get the following:
brain% telnet sermon-archive.info 25
Connected to sermon-archive.info.
Escape character is '^]'.
220 mail.sermon-archive.info ESMTP Postfix
mail from:[hidden email]
250 2.1.0 Ok
rcpt to:[hidden email]
550 5.1.1 <[hidden email]>: Recipient address rejected: User unknown in virtual alias table
> 550 5.1.1 <[hidden email]>: Recipient address rejected: User unknown in virtual alias table
The domain name 'lafn.org' matches $virtual_alias_domains, but the
address '[hidden email]' does not match $virtual_alias_maps.
Should domain name 'lafn.org' match $virtual_alias_domains? If so,
make an entry
[hidden email] [hidden email]
in $virtual_alias_maps, so that Postfix knows the address is real.
If the domain should not match $virtual_alias_domains, update that
I think I have it working now. Typos are killers. I added @lafn.org to each of the keys in the virtual_alias_maps file. That seems to have worked. I am not sure why I needed (or if I needed) the virtual_mailbox_domains table.
I did notice there were no entries for [second_domain] in virtual_alias_maps. Those are all locally delivered so I assumed they were not necessary. I am receiving mail for that domain without them.
I have found the diagrams in the documentation quite helpful in understanding postfix. However, is there similar information on how the various tables are used and in which order?
On Sat, Jul 01, 2017 at 11:42:30AM -0700, wa6vvv wrote:
> I think I have it working now. Typos are killers. I added
> @lafn.org to each of the keys in the virtual_alias_maps file. That
> seems to have worked. I am not sure why I needed (or if I needed)
> the virtual_mailbox_domains table.
> I did notice there were no entries for [second_domain] in
> virtual_alias_maps. Those are all locally delivered so I assumed
> they were not necessary. I am receiving mail for that domain
> without them.
> I have found the diagrams in the documentation quite helpful in
> understanding postfix. However, is there similar information on
> how the various tables are used and in which order?
Postfix has four "address classes" for receiving mail (for which
Postfix is either the final destination or an intermediate MX), and
these classes and the lookups they need/use are documented here:
Not a diagram, but it does have the answers to your questions.
Offlist GMX mail is seen only if "/dev/rob0" is in the Subject:
|Free forum by Nabble||Edit this page|