[Wolves] Postfix aliasing

Adam Sweet adam at adamsweet.org
Fri May 23 15:02:57 BST 2008


David Goodwin wrote:
>> If you need more of the config I'll paste it in.
>>
>> Yours optimistically,
>>
> 
> I'm a Postfix geek. You might also want to look at
> http://postfixadmin.sf.net - which I waste plenty of spare time on.
> 
> I probably need to see more of your main.cf file

Here is the uncommented contents of main.cf

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
unknown_local_recipient_reject_code = 550
mynetworks_style = host
debug_peer_level = 2
debugger_command =
         PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
         xxgdb $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
manpage_directory = /usr/share/man
sample_directory = /etc/postfix
alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
myhostname = linpac1.alias.icritical.com
virtual_alias_maps=mysql:/etc/postfix/sql/aliases.cf
virtual_alias_domains=mysql:/etc/postfix/sql/domains.cf
virtual_mailbox_base=/var/spool/virtual
transport_maps=hash:/etc/postfix/transport_map
message_size_limit = 27000000
default_process_limit = 250

> Does /var/log/mail.log have anything useful in it?

Here is an example connection:

May 23 14:02:50 alias1 postfix/smtpd[9946]: connect from
filter.icritical.com[87.127.225.238]
May 23 14:02:50 alias1 postfix/smtpd[9946]: NOQUEUE: reject: RCPT from
filter.icritical.com[87.127.226.238]: 550 <testus at mailtest.com>:
Recipient address rejected: User unknown in virtual alias table;
from=<adams at icritical.com> to=<testus at mailtest.com> proto=SMTP
helo=<filter.icritical.com>
May 23 14:02:50 alias1 postfix/smtpd[9946]: disconnect from
filter.icritical.com[87.127.225.238]

> You should be able to run 'postmap -q xxxx at domain.com
> /path/to/sql.cf.file' (I think)

Yeah, where I have an alias set up, doing

postmap -q user at domain.com /path/to/sql.cf.file

returns the address to which the mail should be aliased, ie
user at otherdomain.com. The problem I have is that mail is rejected as
'user unknown in virtual alias table' if it isn't in the alias table and
I want it to be accepted and then delivered to the original addressee,
rather than be rejected. If I understand:

http://www.postfix.org/postconf.5.html#virtual_alias_maps

correctly, "optional lookup tables that alias specific mail addresses or
domains to other local or remote address", suggest that an address ionly
has to be in the alias table if it is to be aliases but will be accepted
if it isn't?

(Hour and a half later...)

However, for the time being I think I've solved the problem by replacing:

virtual_alias_domains=mysql:/etc/postfix/sql/domains.cf

with

virtual_mailbox_domains=mysql:/etc/postfix/sql/domains.cf

Many thanks for your help Dave :)

Adam



More information about the Wolves mailing list