I have installed Postfix on a OpenBSD system.
I'm practically a beginner on a *nix systems and I've encountered some
problems.
Let me describe the situation.
My firewall/mail server/web server's name is helios.ercigoj.com.
I have a catch-all mailbox on a different system.
I use fetchmail to collect the mail.
I have two accounts on helios, "aki" and "info".
I'd like to achieve the following:
Send all mail for "aki" to user "aki". Send all mail for user "info" to user
"info". Send all other email from catch-all mailbox to "info".
I've managed to setup Postfix to receive mail for "info", "aki" and with
luser_relay set to "info" all unknown recipients are redirected to "info".
Except! all the users with the domain xx...@ercigoj.com
Mail for "bla...@foo.bar" is redirected to account "info", but for mail
"does_no...@ercigoj.com" bounces.
Postfix returns a "SOFT BOUNCE: mail forwarding loop" for that specific
mail. Also, I have to use canonical list for recipients, to redirect all
mail for a...@ercigoj.com to aki@localhost
So all the message headers show "a...@localhost.ercigoj.com" instead of
"a...@ercigoj.com".
If I do not use the canonical rewriting, all mail goes to luser_relay as it
is recognized as unknown.
What am I doing wrong?
Thank you for all help.
Andraz
Here are my configuration files:
/etc/hosts
----------
::1 localhost localhost.ercigoj.com
127.0.0.1 localhost helios.ercigoj.com
# intranet
10.17.6.1 helios
/etc/postfix/canonical
----------------------
in...@ercigoj.com info@localhost
a...@ercigoj.com aki@localhost
etc/postfix/main.cf (those lines that differ from default)
-------------------
soft_bounce = yes
myhostname = helios.ercigoj.com
mydomain = ercigoj.com
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, $mydomain, localhost
mynetworks = 10.17.6.0/24, 127.0.0.0/8
relay_domains = $mydestination
local_recipient_maps =
recipient_canonical_maps = hash:/etc/postfix/canonical
alias_maps = hash:/etc/postfix/aliases
alias_database = hash:/etc/postfix/aliases
home_mailbox = Maildir/
luser_relay = info@localhost
/etc/fetchmailrc
-----------------
set postmaster info
set no bouncemail
poll pop.domain.com proto pop3 localdomains ercigoj.com user "UN" pass "PWD"
is *
poll pop.domain.com proto pop3 localdomains ercigoj.com user "UN" pass
"PWD" is *
Andraz
/etc/postfix/aliases
-------------------
postmaster aki
root aki
etc/postfix/main.cf (those lines that differ from default)
-------------------
soft_bounce = yes
myhostname = helios.ercigoj.com
mydomain = ercigoj.com
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, $mydomain, localhost
mynetworks = 10.17.6.0/24, 127.0.0.0/8
relay_domains = $mydestination
local_recipient_maps =
recipient_canonical_maps = hash:/etc/postfix/canonical
alias_maps = hash:/etc/postfix/aliases
alias_database = hash:/etc/postfix/aliases
home_mailbox = Maildir/
luser_relay = info@localhost
/etc/fetchmailrc
-----------------
set postmaster info
set no bouncemail
poll pop.domain.com proto pop3 localdomains ercigoj.com user "UN" pass "PWD"
is *
poll pop.domain.com proto pop3 localdomains ercigoj.com user "UN" pass
"PWD" is *
postconf -n
------------
alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
command_directory = /usr/local/sbin
config_directory = /etc/postfix
daemon_directory = /usr/local/libexec/postfix
debug_peer_level = 2
default_destination_concurrency_limit = 4
home_mailbox = Maildir/
inet_interfaces = all
local_destination_concurrency_limit = 2
local_recipient_maps =
luser_relay = info@localhost
mail_owner = postfix
mailbox_command = /usr/bin/procmail
mailq_path = /usr/local/sbin/mailq
manpage_directory = /usr/local/man
mydestination = $myhostname, localhost.$mydomain, $mydomain, localhost
mydomain = ercigoj.com
myhostname = helios.ercigoj.com
mynetworks = 10.17.6.0/24, 127.0.0.0/8
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/local/share/doc/postfix/readme
recipient_canonical_maps = hash:/etc/postfix/canonical
relay_domains = $mydestination
sample_directory = /etc/postfix
sendmail_path = /usr/local/sbin/sendmail
setgid_group = postdrop
smtpd_banner = $myhostname ESMTP $mail_name ($mail_version) Ciao!
soft_bounce = yes
unknown_local_recipient_reject_code = 450
/var/log/maillog (blaaaaaa is an unknown user)
---------------
.
.
Dec 3 16:29:56 helios postfix/qmgr[21141]: EE80697EC5:
from=<and...@email.si>, size=2336, nrcpt=1 (queue active)
Dec 3 16:29:56 helios postfix/local[16609]: E181197EB2:
to=<blaa...@ercigoj.com>, relay=local, delay=5242, status=deferred (SOFT
BOUNCE - mail forwarding loop for blaa...@ercigoj.com)
.
.
# this happens if I turn off the canonical rewriting
Dec 3 16:29:56 helios postfix/qmgr[21141]: D2AD697ED3:
from=<and...@email.si>, size=2336, nrcpt=1 (queue active)
Dec 3 16:29:56 helios postfix/local[32070]: EA23A97ED1:
to=<a...@ercigoj.com>, relay=local, delay=5113, status=deferred (SOFT
BOUNCE - mail forwarding loop for a...@ercigoj.com)
.
.
# due to the canonical address rewriting mail goes to aki@localhost
.
Dec 4 07:00:56 helios postfix/smtpd[5706]: DB5A597EB4:
client=localhost[127.0.0.1]
Dec 4 07:00:57 helios postfix/cleanup[18487]: DB5A597EB4:
message-id=<200312040406...@omta05.mta.everyone.net>
Dec 4 07:00:57 helios postfix/qmgr[18131]: DB5A597EB4:
from=<re...@greatnotions.com>, size=5933, nrcpt=1 (queue active)
Dec 4 07:00:57 helios postfix/local[12420]: DB5A597EB4:
to=<a...@localhost.ercigoj.com>, orig_to=<A...@ERCIGOJ.COM>, relay=local,
delay=1, status=sent (maildir)
.
.
# luser_relay action, for unknown users
.
Dec 4 07:00:57 helios postfix/smtpd[5706]: DBF9E97EB4:
client=localhost[127.0.0.1]
Dec 4 07:00:58 helios postfix/cleanup[18487]: DBF9E97EB4:
message-id=<ch$c-$z7j-$-a-9...@d52j.6i82120>
Dec 4 07:00:58 helios postfix/qmgr[18131]: DBF9E97EB4:
from=<alphonsoferr...@check1check.com>, size=2132, nrcpt=1 (queue
active)
Dec 4 07:00:58 helios postfix/local[12420]: DBF9E97EB4:
to=<in...@localhost.ercigoj.com>, orig_to=<info@localhost>, relay=local,
delay=1, status=sent (maildir)
<eom>