Re: Recipient address rejected: User unknown in local recipient table

2019-03-30 Thread luckydog xf
I'll use Mariadb to store alias_map, uid/gid.etc
The previous is just a quick test.
Thanks.

On Sat, Mar 30, 2019 at 4:35 PM luckydog xf  wrote:

> Thanks for your kindly reply. I read the book you recommended carefully
> and get answer.
>
> I paste stuff as below for anyone whoever may run into this problem.
> 
> ## Tells Postfix to use Dovecot's LMTP instead of its own LDA to save
> emails to the local mailboxes.
> virtual_transport = lmtp:unix:/usr/var/run/dovecot/lmtp
> virtual_mailbox_domains = ad.pthl.hk  #* remove $mydomain for
> $mydestination*
> virtual_mailbox_maps = hash:/etc/postfix/vmailbox
> virtual_alias_maps   = hash:/etc/postfix/virtual_alias_map
> virtual_uid_maps = static:600
> virtual_gid_maps = static:12
> virtual_mailbox_base = /var/mail
> it works.
>
> And this is my personal understanding, virtual delivery agent( refer to as
> virtual in postfix docs)  unlike Local delivery agent ( Refer to as Local
> in postfix doc) does not need user exists in the postfix-running system. So
> it relies on virtual_mailbox_map to get  user's information and other stuff
> to get mail location.
>
> Besides, postfix could use its own LMTP ,pipe, maildrop to deliver mail to
> mailbox, right?
>
> Thanks a lot, you save me out of it. :),
>
>
> On Sat, Mar 30, 2019 at 2:26 AM Noel Jones  wrote:
>
>> On 3/29/2019 5:04 AM, luckydog xf wrote:
>> > Hi,
>> >
>> >   I'm new to postfix, and I use postfix + dovecot, and I add MX/A/PTR.
>> >
>> >   I use Mariadb as Dovecot passdb and Cyrus SASL Authentication.
>> >
>> >   And I configure email client (MUA) and try to send email to
>> > another user in the same domain, it says,
>> >
>> > "Recipient address rejected: User unknown in local recipient table"
>> >
>> >   I can read literally this user does not exist on this machine. How
>> > can I solve this problem?
>> >
>> >   I also read docs of postfix, which is quite difficult for me since
>> > I'm new to email field.
>>
>> Postfix needs to know which domains it should handle, the valid
>> users, and what postfix should do with that mail.
>>
>> It sounds like all your users are stored in dovecot and not unix
>> system users.  Postfix calls this a virtual mailbox domain.  Some
>> docs for that can be found here:
>> http://www.postfix.org/VIRTUAL_README.html#virtual_mailbox
>>
>> Other documents can be found here:
>> http://www.postfix.org/documentation.html
>>
>> You'll probably want something like:
>> mydestination = localhost  (or set this empty)
>> virtual_mailbox_domains = {your domain name here}
>> virtual_mailbox_maps = {dovecot user database here}
>> virtual_transport = {dovecot delivery agent here}
>>
>>
>> You may also find one of the postfix books helpful, "The Book of
>> Postfix" by Hildebrandt and Koetter; or  "Postfix: The Definitive
>> Guide" by Dent.  Both are very old and won't cover new features, but
>> the basic structure of postfix hasn't changed, and they're still
>> useful for an overview of how things work.
>>
>>
>>
>>-- Noel Jones
>>
>


Re: Recipient address rejected: User unknown in local recipient table

2019-03-29 Thread Noel Jones

On 3/29/2019 5:04 AM, luckydog xf wrote:

Hi,

  I'm new to postfix, and I use postfix + dovecot, and I add MX/A/PTR.

  I use Mariadb as Dovecot passdb and Cyrus SASL Authentication.

  And I configure email client (MUA) and try to send email to 
another user in the same domain, it says,


"Recipient address rejected: User unknown in local recipient table"

  I can read literally this user does not exist on this machine. How 
can I solve this problem?


  I also read docs of postfix, which is quite difficult for me since 
I'm new to email field.


Postfix needs to know which domains it should handle, the valid 
users, and what postfix should do with that mail.


It sounds like all your users are stored in dovecot and not unix 
system users.  Postfix calls this a virtual mailbox domain.  Some 
docs for that can be found here:

http://www.postfix.org/VIRTUAL_README.html#virtual_mailbox

Other documents can be found here:
http://www.postfix.org/documentation.html

You'll probably want something like:
mydestination = localhost  (or set this empty)
virtual_mailbox_domains = {your domain name here}
virtual_mailbox_maps = {dovecot user database here}
virtual_transport = {dovecot delivery agent here}


You may also find one of the postfix books helpful, "The Book of 
Postfix" by Hildebrandt and Koetter; or  "Postfix: The Definitive 
Guide" by Dent.  Both are very old and won't cover new features, but 
the basic structure of postfix hasn't changed, and they're still 
useful for an overview of how things work.




  -- Noel Jones


Recipient address rejected: User unknown in local recipient table

2019-03-29 Thread luckydog xf
Hi,

 I'm new to postfix, and I use postfix + dovecot, and I add MX/A/PTR.

 I use Mariadb as Dovecot passdb and Cyrus SASL Authentication.

 And I configure email client (MUA) and try to send email to another user
in the same domain, it says,

"Recipient address rejected: User unknown in local recipient table"

 I can read literally this user does not exist on this machine. How can I
solve this problem?

 I also read docs of postfix, which is quite difficult for me since I'm new
to email field.

 # postconf -n
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
compatibility_level = 2
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/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
default_privs = nobody
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
inet_protocols = ipv4
mail_owner = postfix
mail_spool_directory = /var/spool/mail
mailbox_transport = lmtp:unix:/usr/var/run/dovecot/lmtp
local_recipient_maps =
mailq_path = /usr/bin/mailq
manpage_directory = /usr/local/man
meta_directory = /etc/postfix
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mydomain = ad.pthl.hk
myhostname = mail.ad.pthl.hk
mynetworks = 172.16.0.0/12, 127.0.0.0/8, 172.16.81.0/24
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = no
relay_domains = $mydestination
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
shlib_directory = /usr/lib/postfix
smtp_tls_note_starttls_offer = yes
smtp_tls_security_level = may
smtpd_recipient_restrictions =
permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/ssl/certs/dovecot.pem
smtpd_tls_key_file = /etc/ssl/certs/dovecot.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
unknown_local_recipient_reject_code = 550

What  do I have to setup? I only have a single domain

Thanks,


Re: Recipient address rejected: User unknown in local recipient table

2017-10-27 Thread Viktor Dukhovni


> On Oct 27, 2017, at 9:32 AM, 9acca9 <erdosa...@gmail.com> wrote:
> 
> Recipient address rejected: User unknown in local recipient table
> 
> of course the "user" is not know by postfix or that server, I want postfix
> to deliver this mail to zimbra, who knows them.

Remove the recipient domain from "mydestination" and add it
to "relay_domains".  On a pure relay system, with no local
mailboxes

   main.cf:
# Convenience macro
indexed = ${default_database_type}:${config_directory}/

mydestination =
alias_database =
alias_maps = $alias_database
local_recipient_maps =
local_transport = error:5.1.2 Mailbox unavailable

# One or more relayed domains
#
relay_domains = example.com

# If inbound relaying is not always MX based, use a
# transport table
#
# transport_maps = ${indexed}transport

# Alternatively, if all inbound domains hit the same relay
# Just specify the relay in main.cf:
#
# relay_transport = relay:[relay.example.com]

# Consider mandatory TLS for relay traffic
#
smtp_tls_policy_maps = ${indexed}tls-policy
smtp_tls_loglevel = 1
smtp_tls_security_level = may
# Or instead:
#
# smtp_tls_security_level = dane
## Ensure /etc/resolv.conf has just: nameserver 127.0.0.1
## And resolver is doing DNSSEC validation, and tracks
## RFC5011 root KSK rollovers reliably.
## See:
##
## https://www.icann.org/news/announcement-2017-09-27-en
#
# smtp_dns_support_level = dnssec

# See 
http://www.postfix.org/postconf.5.html#parent_domain_matches_subdomains
# Consider setting entirely empty at the cost of adding each blocked 
subtree
# of DNS twice:  "example.com REJECT ..." and ".example.com REJECT ..."
#
parent_domain_matches_subdomains = smtpd_access_maps

transport:
example.com relay:[relay.example.com]

tls-policy:
# Or "secure" if you're comfortable enough with PKI,
# or even "dane" or "dane-only"
#
[relay.example.com] encrypt

-- 
Viktor.



Re: Recipient address rejected: User unknown in local recipient table

2017-10-27 Thread wilfried.es...@essignetz.de
Hi,

is zimbra running on the same machine? Then you should read zimbra doc,
how to integrate with postfix.

If zimbra is running on another machine, you should read postfix doc on
relaying (http://www.postfix.org/documentation.html)


Willi


Am 27.10.2017 um 15:32 schrieb 9acca9:
> Hello everyone.
> I have configured a zimbra and a postfix different pc. (zimbra is on my
> local network, and postfix on an external network).
> 
> the only thing I want is for postfix to send the mails from my domain to any
> side, and that the ones of any side send them to zimbra.
> 
> The sending of mails was correct but if from my google mail account I want
> to answer, I find this error in the log:
> 
> Recipient address rejected: User unknown in local recipient table
> 
> of course the "user" is not know by postfix or that server, I want postfix
> to deliver this mail to zimbra, who knows them.
> 
> smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
> biff = no
> 
> append_dot_mydomain = no
> 
> readme_directory = no
> 
> smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
> smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
> smtpd_use_tls = yes
> smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
> smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
> 
> smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated
> defer_unauth_destination
> myhostname = postfix.mydomain.es
> alias_maps = hash:/etc/aliases
> alias_database = hash:/etc/aliases
> myorigin = /etc/mailname
> mydestination = $myhostname, mydomain.es, localhost.mydomain.es, localhost,
> relay_domains = $mydestination
> relayhost =
> mynetworks = 127.0.0.0/8 [:::127.0.0.0]/104 [::1]/128 172.16.5.5/32
> 190.2.19.187/32
> mailbox_size_limit = 8192000
> recipient_delimiter = +
> inet_interfaces = all
> inet_protocols = all
> home_mailbox = Maildir/
> 
> Thanks to all.
> 
> 
> 
> --
> Sent from: http://postfix.1071664.n5.nabble.com/Postfix-Users-f2.html
> 


Recipient address rejected: User unknown in local recipient table

2017-10-27 Thread 9acca9
Hello everyone.
I have configured a zimbra and a postfix different pc. (zimbra is on my
local network, and postfix on an external network).

the only thing I want is for postfix to send the mails from my domain to any
side, and that the ones of any side send them to zimbra.

The sending of mails was correct but if from my google mail account I want
to answer, I find this error in the log:

Recipient address rejected: User unknown in local recipient table

of course the "user" is not know by postfix or that server, I want postfix
to deliver this mail to zimbra, who knows them.

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

append_dot_mydomain = no

readme_directory = no

smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated
defer_unauth_destination
myhostname = postfix.mydomain.es
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, mydomain.es, localhost.mydomain.es, localhost,
relay_domains = $mydestination
relayhost =
mynetworks = 127.0.0.0/8 [:::127.0.0.0]/104 [::1]/128 172.16.5.5/32
190.2.19.187/32
mailbox_size_limit = 8192000
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
home_mailbox = Maildir/

Thanks to all.



--
Sent from: http://postfix.1071664.n5.nabble.com/Postfix-Users-f2.html


Re: Recipient address rejected: User unknown in local recipient table

2017-02-23 Thread Asif Iqbal
On Thu, Feb 23, 2017 at 6:54 PM, Viktor Dukhovni  wrote:

> If you've migrated from qmail, you should probably keep "-" as your
> recipient delimiter to maintain as much backwards-compatible behaviour
> as possible.
>
> Otherwise you'll need an explicit alias for each actively used "-"
> address extension.
>

I eventually want to change the default `+' to `-'. But I will need to find
out if there is any dependency
on postfix side that might break? I am using mailman which has `-' in the
list name.

In the meantime, If I understand you correctly, just use an alias entry
like below as a quick workaround?

 iqbala-sysadmin: iqbala

I do not have too many of those, so that would work now without breaking
anything.




-- 
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?


Re: Recipient address rejected: User unknown in local recipient table

2017-02-23 Thread Viktor Dukhovni

> On Feb 23, 2017, at 6:49 PM, Asif Iqbal <vad...@gmail.com> wrote:
> 
> Failing to receive mail in iqbala-sysad...@example.net

This looks like email to the user "iqbala" with an extension of
"sysadmin" using qmail's "-" as a delimiter.

> 
> Feb 23 18:40:02 mail postfix/smtpd[16962]: NOQUEUE: reject: RCPT from 
> remote.example.net[192.168.18.193]: 550 5.1.1 <iqbala-sysad...@example.net>: 
> Recipient address rejected: User unknown in local recipient table; 
> from=<r...@remote.example.net> to=<iqbala-sysad...@example.net> proto=ESMTP 
> helo=
> 
> I am using postfix 2.6.6 on CentOS 6.7. My recipient_delimiter is `+'
> 
> I just migrated from qmail to postfix.
> 
> Any suggestion is appreciated.

If you've migrated from qmail, you should probably keep "-" as your
recipient delimiter to maintain as much backwards-compatible behaviour
as possible.

Otherwise you'll need an explicit alias for each actively used "-"
address extension.

-- 
Viktor.



Recipient address rejected: User unknown in local recipient table

2017-02-23 Thread Asif Iqbal
Failing to receive mail in iqbala-sysad...@example.net

Feb 23 18:40:02 mail postfix/smtpd[16962]: NOQUEUE: reject: RCPT from
remote.example.net[192.168.18.193]: 550 5.1.1 <iqbala-sysad...@example.net>:
Recipient address rejected: User unknown in local recipient table; from=<
r...@remote.example.net> to=<iqbala-sysad...@example.net> proto=ESMTP helo=<
remote.example.net>

I am using postfix 2.6.6 on CentOS 6.7. My recipient_delimiter is `+'

I just migrated from qmail to postfix.

Any suggestion is appreciated.

-- 
Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?


Re: canonicalised address gives: Recipient address rejected: User unknown in local recipient table

2016-03-02 Thread Tom Robinson
On 03/03/16 08:58, wilfried.es...@essignetz.de wrote:
>> I was guessing that this would have to be aliased but didn't see it in the 
>> documentation for
>> canonical. Is it the correct way to set up full.name mapping to local users? 
>> Also I'm more used to
>> sendmail and qmail. This is my first time configuring postfix.
> 
> Correct is probably the wrong word.
> 
> If you need mailadresses, that aren't the same as loginnames or
> mailboxnames, you have to define aliases. For me, using aliases, instead
> of internal usernames, is the usual way. But, usually, i don't use
> canonical for that. Maybe it makes sense, when changing from mailaddress
> scheme "firstname" to, e.g.,  "first.lastname".
> 
> You can define aliases also in virtual table.
> 

Still wading through the doco. From what I can determine /etc/postfix/canonical 
is used to rewrite
the envelope and headers. From the doco 
http://www.postfix.org/ADDRESS_REWRITING_README.html:

---8<---
Canonical address mapping

The cleanup(8) daemon uses the canonical(5) tables to rewrite addresses in 
message envelopes and in
message headers. By default all header and envelope addresses are rewritten; 
this is controlled with
the canonical_classes configuration parameter.

---8<---
Local alias database

When mail is to be delivered locally, the local(8) delivery agent runs each 
local recipient name
through the aliases(5) database. The mapping does not affect addresses in 
message headers. Local
aliases are typically used to implement distribution lists, or to direct mail 
for standard aliases
such as postmaster to real people. The table can also be used to map 
"Firstname.Lastname" addresses
to login names.
---8<---

My apologies that I didn't read _all_ the doco before attempting the mapping. 
So my understanding is
now that the /etc/postfix/canonical file allows envelope and header rewrites to 
the final delivered
email but /etc/aliases is used to create the actual mapping for 
firsname.lastname to a local user
and that is necessary for successful delivery of email.

So, if out of two users, shaun and tom and I have only canonicalised tom as 
follows:
/etc/aliases:
shaun.fielder: shaun
tom.robinson: tom

/etc/postfix/canonical:
tom tom.robinson

Using sendmail to generate a report helps explain what happens:

/usr/sbin/sendmail -bv tom

in the report I can see the mail is deliverable to the local user 
(t...@motec.com.au) but the To: is
rewritten to tom.robin...@motec.com.au:

---8<---
   The mail system

 (expanded from ): delivery via local: delivers to
maildir

---8<---

Final-Recipient: rfc822; t...@motec.com.au
Original-Recipient: rfc822; tom
Action: deliverable
Status: 2.0.0
Diagnostic-Code: X-Postfix; delivery via local: delivers to maildir

--66BDF295D.1456957031/camber.motec.com.au
Content-Description: Message Headers
Content-Type: text/rfc822-headers

Return-Path: 
Received: by camber.motec.com.au (Postfix, from userid 0)
id 66BDF295D; Thu,  3 Mar 2016 09:17:11 +1100 (AEDT)
DKIM-Filter: OpenDKIM Filter v2.10.3 camber.motec.com.au 66BDF295D
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=motec.com.au;
s=mail.motec.com.au; t=1456957031;
bh=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=;
h=From:Subject:To:Date:From;
b=dWhEOD1NdRiFqTz/bHCytLEWfZiuQiqi1nSY058RhH3oZsZ44SWvPe3ihAUfHlOA3
 fNK39lnH5+dejADrx++k03VXgyjfNLL54+lyiQuCU2OnJrRQoJP8ll1KShgm7AvPlv
 +cMeDrR1mXrzHC8nEDsQch3cjzD9+STDmph6Ko+E=
From: r...@motec.com.au
Subject: probe
To: tom.robin...@motec.com.au
Message-Id: <20160302221711.66bdf2...@camber.motec.com.au>
Date: Thu,  3 Mar 2016 09:17:11 +1100 (AEDT)

--66BDF295D.1456957031/camber.motec.com.au--
---8<---

Using sendmail again for user shaun (who has _no_ canonicalisation to 
firstname.lastname):

/usr/sbin/sendmail -bv shaun

in the report I can see the mail is deliverable to the local user 
(sh...@motec.com.au) but the To:
is unchanged:

---8<---
   The mail system

 (expanded from ): delivery via local: delivers to
maildir

---8<---

Final-Recipient: rfc822; sh...@motec.com.au
Original-Recipient: rfc822; shaun
Action: deliverable
Status: 2.0.0
Diagnostic-Code: X-Postfix; delivery via local: delivers to maildir

--D8F30295D.1456957257/camber.motec.com.au
Content-Description: Message Headers
Content-Type: text/rfc822-headers

Return-Path: 
Received: by camber.motec.com.au (Postfix, from userid 0)
id D8F30295D; Thu,  3 Mar 2016 09:20:56 +1100 (AEDT)
DKIM-Filter: OpenDKIM Filter v2.10.3 camber.motec.com.au D8F30295D
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=motec.com.au;
s=mail.motec.com.au; t=1456957256;
bh=47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=;
h=From:Subject:To:Date:From;
b=VZaX2Z1dmJy+X6qXe28KFco8blbjQ6kNJM5XyQR+Y1Q7mHlTqvbrHAfEETF6rHp+A
 

Re: canonicalised address gives: Recipient address rejected: User unknown in local recipient table

2016-03-02 Thread wilfried.es...@essignetz.de
> I was guessing that this would have to be aliased but didn't see it in the 
> documentation for
> canonical. Is it the correct way to set up full.name mapping to local users? 
> Also I'm more used to
> sendmail and qmail. This is my first time configuring postfix.

Correct is probably the wrong word.

If you need mailadresses, that aren't the same as loginnames or
mailboxnames, you have to define aliases. For me, using aliases, instead
of internal usernames, is the usual way. But, usually, i don't use
canonical for that. Maybe it makes sense, when changing from mailaddress
scheme "firstname" to, e.g.,  "first.lastname".

You can define aliases also in virtual table.


Willi



Re: canonicalised address gives: Recipient address rejected: User unknown in local recipient table

2016-03-02 Thread Tom Robinson
On 03/03/16 08:02, wilfried.es...@essignetz.de wrote:
> 
> Am 02.03.2016 um 21:52 schrieb Tom Robinson:
>> On 03/03/16 06:33, wilfried.es...@essignetz.de wrote:
>>> Am 02.03.2016 um 06:32 schrieb Tom Robinson:
>>>> Hi,
>>>>
>>>> I'm trying to map users to first.last in canonical but I get
>>>> an error when sending email to the canonicalized address 
>>>> first.last@domain:
>>> ...
>>>> My Error: Mar  2 15:47:36 camber policyd-spf[17984]: None; 
>>>> identity=helo; client-ip=10.0.6.3; helo=motec.com.au; 
>>>> envelope-from=r...@motec.com.au; 
>>>> receiver=tom.robin...@motec.com.au Mar  2 15:47:36 camber 
>>>> policyd-spf[17984]: None; identity=mailfrom;
>>>> client-ip=10.0.6.3; helo=motec.com.au;
>>>> envelope-from=r...@motec.com.au; 
>>>> receiver=tom.robin...@motec.com.au Mar  2 15:47:36 camber 
>>>> postfix/smtpd[17974]: NOQUEUE: reject: RCPT from 
>>>> caster.motec.com.au[10.0.6.3]: 550 5.1.1 
>>>> <tom.robin...@motec.com.au>: Recipient address rejected: User 
>>>> unknown in local recipient table; from=<r...@motec.com.au> 
>>>> to=<tom.robin...@motec.com.au> proto=SMTP helo= 
>>>
>>> Hi,
>>>
>>> can you show the according entries from /etc/aliases and 
>>> /etc/postfix/canonical?
>>>
>>> What name has the target mailbox for tom.robin...@motec.com.au?
>>
>> Hi Willi,
>>
>> Thanks for taking a look.
>>
>> I don't have an entry in aliases and maybe that's the problem. From
>> /etc/postfix/canonical:
>>
>> tom tom.robinson
>>
>> The real user is tom.
> 
> 
> OK. I think you'll need entries like
> 
> tom.robinson: tom
> 
> in your /etc/aliases. (Don't forget newaliases)
> 

I replied as you wrote this. I made that change which seems to have worked. My 
other post has more
details and a question.

Thanks,
Tom




signature.asc
Description: OpenPGP digital signature


Re: canonicalised address gives: Recipient address rejected: User unknown in local recipient table

2016-03-02 Thread Tom Robinson
On 03/03/16 07:52, Tom Robinson wrote:
> On 03/03/16 06:33, wilfried.es...@essignetz.de wrote:
>> Am 02.03.2016 um 06:32 schrieb Tom Robinson:
>>> Hi,
>>>
>>> I'm trying to map users to first.last in canonical but I get an
>>> error when sending email to the canonicalized address
>>> first.last@domain:
>> ...
>>> My Error: Mar  2 15:47:36 camber policyd-spf[17984]: None;
>>> identity=helo; client-ip=10.0.6.3; helo=motec.com.au;
>>> envelope-from=r...@motec.com.au;
>>> receiver=tom.robin...@motec.com.au Mar  2 15:47:36 camber
>>> policyd-spf[17984]: None; identity=mailfrom; client-ip=10.0.6.3; 
>>> helo=motec.com.au; envelope-from=r...@motec.com.au;
>>> receiver=tom.robin...@motec.com.au Mar  2 15:47:36 camber
>>> postfix/smtpd[17974]: NOQUEUE: reject: RCPT from 
>>> caster.motec.com.au[10.0.6.3]: 550 5.1.1
>>> <tom.robin...@motec.com.au>: Recipient address rejected: User
>>> unknown in local recipient table; from=<r...@motec.com.au>
>>> to=<tom.robin...@motec.com.au> proto=SMTP helo= 
>>
>> Hi,
>>
>> can you show the according entries from /etc/aliases and
>> /etc/postfix/canonical?
>>
>> What name has the target mailbox for tom.robin...@motec.com.au?
> 
> Hi Willi,
> 
> Thanks for taking a look.
> 
> I don't have an entry in aliases and maybe that's the problem. From 
> /etc/postfix/canonical:
> 
> tom tom.robinson
> 
> The real user is tom.
> 

I have since made this entry in /etc/aliases:

tom.robinson:   tom

and rebuilt with postalias.

If that's the only change and the correct way to set this up, I think it's 
fixed. Is that the
correct way to set it up?

When I send a test email:

# telnet 10.0.6.5 25
Trying 10.0.6.5...
Connected to 10.0.6.5.
Escape character is '^]'.
220 camber.motec.com.au ESMTP Postfix
mail from: r...@motec.com.au
250 2.1.0 Ok
rcpt to: tom.robin...@motec.com.au
250 2.1.5 Ok
data
354 End data with .
Subject: test full.name
email to full.name
.
250 2.0.0 Ok: queued as 2BE6A295D
quit
221 2.0.0 Bye
Connection closed by foreign host.

The log shows this:
Mar  3 07:54:37 camber policyd-spf[27063]: None; identity=mailfrom; 
client-ip=10.0.6.3;
helo=motec.com.au; envelope-from=r...@motec.com.au; 
receiver=tom.robin...@motec.com.au
Mar  3 07:54:37 camber postfix/smtpd[27055]: 2BE6A295D: 
client=caster.motec.com.au[10.0.6.3]
Mar  3 07:54:54 camber postfix/cleanup[27064]: 2BE6A295D: message-id=<>
Mar  3 07:54:54 camber opendkim[9340]: 2BE6A295D: can't determine message 
sender; accepting
Mar  3 07:54:54 camber postfix/qmgr[17616]: 2BE6A295D: 
from=<r...@motec.com.au>, size=446, nrcpt=1
(queue active)
Mar  3 07:54:55 camber postfix/local[27074]: 2BE6A295D: to=<t...@motec.com.au>,
orig_to=<tom.robin...@motec.com.au>, relay=local, delay=23, 
delays=22/0.03/0/0.06, dsn=2.0.0,
status=sent (delivered to maildir)
Mar  3 07:54:55 camber postfix/qmgr[17616]: 2BE6A295D: removed

And in the Maildir/cur of user tom I see:

$ cat 1456952094.Vfd11I55455b9M998906.camber.motec.com.au:2,a
Return-Path: <r...@motec.com.au>
X-Original-To: tom.robin...@motec.com.au
Delivered-To: tom.robin...@motec.com.au
Received-SPF: None (no SPF record) identity=mailfrom; client-ip=10.0.6.3; 
helo=motec.com.au;
envelope-from=r...@motec.com.au; receiver=tom.robin...@motec.com.au
Authentication-Results: camber.motec.com.au; dkim=permerror (bad 
message/signature format)
Received: from caster.motec.com.au (caster.motec.com.au [10.0.6.3])
by camber.motec.com.au (Postfix) with SMTP id 2BE6A295D
for <tom.robin...@motec.com.au>; Thu,  3 Mar 2016 07:54:32 +1100 (AEDT)
Subject: test full.name

email to full.name

I was guessing that this would have to be aliased but didn't see it in the 
documentation for
canonical. Is it the correct way to set up full.name mapping to local users? 
Also I'm more used to
sendmail and qmail. This is my first time configuring postfix.

Kind regards,
Tom

-- 

Tom Robinson
IT Manager/System Administrator

MoTeC Pty Ltd

121 Merrindale Drive
Croydon South
3136 Victoria
Australia

T: +61 3 9761 5050
F: +61 3 9761 5051
E: tom.robin...@motec.com.au





signature.asc
Description: OpenPGP digital signature


Re: canonicalised address gives: Recipient address rejected: User unknown in local recipient table

2016-03-02 Thread wilfried.es...@essignetz.de

Am 02.03.2016 um 21:52 schrieb Tom Robinson:
> On 03/03/16 06:33, wilfried.es...@essignetz.de wrote:
>> Am 02.03.2016 um 06:32 schrieb Tom Robinson:
>>> Hi,
>>> 
>>> I'm trying to map users to first.last in canonical but I get
>>> an error when sending email to the canonicalized address 
>>> first.last@domain:
>> ...
>>> My Error: Mar  2 15:47:36 camber policyd-spf[17984]: None; 
>>> identity=helo; client-ip=10.0.6.3; helo=motec.com.au; 
>>> envelope-from=r...@motec.com.au; 
>>> receiver=tom.robin...@motec.com.au Mar  2 15:47:36 camber 
>>> policyd-spf[17984]: None; identity=mailfrom;
>>> client-ip=10.0.6.3; helo=motec.com.au;
>>> envelope-from=r...@motec.com.au; 
>>> receiver=tom.robin...@motec.com.au Mar  2 15:47:36 camber 
>>> postfix/smtpd[17974]: NOQUEUE: reject: RCPT from 
>>> caster.motec.com.au[10.0.6.3]: 550 5.1.1 
>>> <tom.robin...@motec.com.au>: Recipient address rejected: User 
>>> unknown in local recipient table; from=<r...@motec.com.au> 
>>> to=<tom.robin...@motec.com.au> proto=SMTP helo= 
>> 
>> Hi,
>> 
>> can you show the according entries from /etc/aliases and 
>> /etc/postfix/canonical?
>> 
>> What name has the target mailbox for tom.robin...@motec.com.au?
> 
> Hi Willi,
> 
> Thanks for taking a look.
> 
> I don't have an entry in aliases and maybe that's the problem. From
> /etc/postfix/canonical:
> 
> tom tom.robinson
> 
> The real user is tom.


OK. I think you'll need entries like

tom.robinson:   tom

in your /etc/aliases. (Don't forget newaliases)


Willi




> 
> Kind regards, Tom
> 



Re: canonicalised address gives: Recipient address rejected: User unknown in local recipient table

2016-03-02 Thread wilfried.es...@essignetz.de
Am 02.03.2016 um 06:32 schrieb Tom Robinson:
> Hi,
> 
> I'm trying to map users to first.last in canonical but I get an
> error when sending email to the canonicalized address
> first.last@domain:
...
> My Error: Mar  2 15:47:36 camber policyd-spf[17984]: None;
> identity=helo; client-ip=10.0.6.3; helo=motec.com.au;
> envelope-from=r...@motec.com.au;
> receiver=tom.robin...@motec.com.au Mar  2 15:47:36 camber
> policyd-spf[17984]: None; identity=mailfrom; client-ip=10.0.6.3; 
> helo=motec.com.au; envelope-from=r...@motec.com.au;
> receiver=tom.robin...@motec.com.au Mar  2 15:47:36 camber
> postfix/smtpd[17974]: NOQUEUE: reject: RCPT from 
> caster.motec.com.au[10.0.6.3]: 550 5.1.1
> <tom.robin...@motec.com.au>: Recipient address rejected: User
> unknown in local recipient table; from=<r...@motec.com.au>
> to=<tom.robin...@motec.com.au> proto=SMTP helo= 

Hi,

can you show the according entries from /etc/aliases and
/etc/postfix/canonical?

What name has the target mailbox for tom.robin...@motec.com.au?


Willi





canonicalised address gives: Recipient address rejected: User unknown in local recipient table

2016-03-01 Thread Tom Robinson
Hi,

I'm trying to map users to first.last in canonical but I get an error when 
sending email to the
canonicalized address first.last@domain:

Recipient address rejected: User unknown in local recipient table

What am I not understanding? Any help is appreciated.

Here are my configs and the error from the logs:

# postconf -nf
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases, hash:/etc/mailman/aliases
canonical_maps = hash:/etc/postfix/canonical
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/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
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
milter_default_action = accept
milter_protocol = 2
mydestination = localhost.$mydomain, localhost, mail.$mydomain, $mydomain
mydomain = motec.com.au
myhostname = camber.motec.com.au
mynetworks = cidr:/etc/postfix/network_table
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
non_smtpd_milters = inet:localhost:8891
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
sample_directory = /usr/share/doc/postfix-2.10.1/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_milters = inet:localhost:8891
smtpd_recipient_restrictions = permit_sasl_authenticated permit_mynetworks
reject_unauth_destination check_policy_service unix:private/policy-spf
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = no
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous, noplaintext
smtpd_sasl_tls_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_CAfile = /etc/pki/tls/certs/ca-bundle
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/pki/tls/certs/crt
smtpd_tls_exclude_ciphers = EXPORT
smtpd_tls_key_file = /etc/pki/tls/private/key
smtpd_tls_loglevel = 2
smtpd_tls_security_level = may
unknown_local_recipient_reject_code = 550

# postconf -Mf
smtp   inet  n   -   n   -   -   smtpd
smtps  inet  n   -   n   -   -   smtpd
-o syslog_name=postfix/smtps -o smtpd_tls_wrappermode=yes
-o smtpd_sasl_auth_enable=yes
pickup unix  n   -   n   60  1   pickup
cleanupunix  n   -   n   -   0   cleanup
qmgr   unix  n   -   n   300 1   qmgr
tlsmgr unix  -   -   n   1000?   1   tlsmgr
rewriteunix  -   -   n   -   -   trivial-rewrite
bounce unix  -   -   n   -   0   bounce
defer  unix  -   -   n   -   0   bounce
trace  unix  -   -   n   -   0   bounce
verify unix  -   -   n   -   1   verify
flush  unix  n   -   n   1000?   0   flush
proxymap   unix  -   -   n   -   -   proxymap
proxywrite unix  -   -   n   -   1   proxymap
smtp   unix  -   -   n   -   -   smtp
relay  unix  -   -   n   -   -   smtp
showq  unix  n   -   n   -   -   showq
error  unix  -   -   n   -   -   error
retry  unix  -   -   n   -   -   error
discardunix  -   -   n   -   -   discard
local  unix  -   n   n   -   -   local
virtualunix  -   n   n   -   -   virtual
lmtp   unix  -   -   n   -   -   lmtp
anvil  unix  -   -   n   -   1   anvil
scache unix  -   -   n   -   1   scache
policy-spf unix  -   n   n   -   -   spawn
user=nobody argv=/usr/libexec/postfix/policyd-spf

My Error:
Mar  2 15:47:36 camber policyd-spf[17984]: None; identity=helo; 
client-ip=10.0.6.3;
helo=motec.com.au; envelope-from=r...@motec.com.au; 
receiver=tom.robin...@motec.com.au
Mar  2 15:47:36 camber policyd-spf[17984]: None; identity=mailfrom; 
client-ip=10.0.6.3;
helo=motec.com.au; envelope-from=r...@motec.com.au; 
receiver=tom.robin...@motec.com.au
Mar  2 15:47:36 camber postfix/smtpd[17974]: NOQUEUE: reject: RCPT from
caster.motec.com.au[10.0.6.3]: 550 5.1.1 <tom.robin...@motec.com.au>: Recipient 
address rejected:
User unknown in local recipient table; from=<r...@motec.com.au> 
to=<tom.robin...@motec.com.au>
proto=SMTP helo=



Kind regards,
Tom

-- 

Tom Robinson
IT Manager/System Administrator

MoTeC Pty Ltd

121 Merrindale Drive
Croydon South
3136 Victoria
Australia

T: +61 3 9761 5050
F: +61 3 9761 5051
E: tom.robin...@motec.com.au




signature.asc
Description: OpenPGP digital signature


Forward emails recieveing error: Recipient address rejected: User unknown in local recipient table

2015-04-08 Thread Jonathan Bees
Hi,

I have one domain - example.com. And I'd like to have user mailboxes on two
separate machines (policy differences), but ran into a problem with sending
emails from a user on one machine to users on the other machine.
The error message : 550 5.1.1 remoteu...@example.com: Recipient address
rejected: User unknown in local recipient table

Partial postconf output:
alias_maps = mysql:/etc/postfix/mysql-alias.cf
mailbox_command = procmail -a $EXTENSION
mailbox_transport = cyrus
maximal_queue_lifetime = 5m
mydestination = example.com, localhost.example.com, localhost,
mysql:/etc/postfix/mysql-mydestination.cf
myhostname = mail.example.com
mynetworks = 127.0.0.0/8,
myorigin = /etc/mailname
readme_directory = /usr/share/doc/postfix
receive_override_options = no_address_mappings
recipient_delimiter = +
relayhost = [192.168.1.1]
smtpd_client_restrictions = permit_mynetworks, check_client_access
hash:/etc/postfix/access, cidr:/etc/postfix/client.cidr,
reject_unknown_client_hostname,
permit
smtpd_delay_reject = yes
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks, reject_non_fqdn_hostname,
reject_invalid_hostname, permit
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks,
reject_unauth_destination ...  permit
smtpd_sender_restrictions = hash:/etc/postfix/access_blacklist
smtpd_soft_error_limit = 10
smtpd_use_tls = yes
soft_bounce = no
transport_maps = hash:/etc/postfix/transport
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual.cf,
mysql:/etc/postfix/mysql-virtual-example.cf, hash:/etc/postfix/virtual

Hoping someone knows a good way to send all unknown recepient in local
tables (referred by mysql-virtual.cf) to a smarthost (192.168.1.1), which
would decide whether to forward this to the remote server or answer with a
bounce message.

Sincerely,
Jonathan


Re: Forward emails recieveing error: Recipient address rejected: User unknown in local recipient table

2015-04-08 Thread Noel Jones
On 4/8/2015 3:51 AM, Jonathan Bees wrote:

 
 Hoping someone knows a good way to send all unknown recepient in
 local tables (referred by mysql-virtual.cf
 http://mysql-virtual.cf) to a smarthost (192.168.1.1), which would
 decide whether to forward this to the remote server or answer with a
 bounce message.

This is a broken design.  The edge gateway MX must know all valid
recipients, even for internal systems.  Unknown recipients must be
rejected during the initial SMTP, and not bounced later.

Either transfer the valid recipient list from the smarthost, or you
might be able to use reject_unverified_recipient to let postfix
decide for itself.

Sending bounces for unknown users will clog your queue with
undeliverable mail, and will get your server blacklisted as a
backscatter source.


  -- Noel Jones


Re: Forward emails recieveing error: Recipient address rejected: User unknown in local recipient table

2015-04-08 Thread Viktor Dukhovni
On Wed, Apr 08, 2015 at 11:51:03AM +0300, Jonathan Bees wrote:

 I have one domain - example.com. And I'd like to have user mailboxes on two
 separate machines (policy differences), but ran into a problem with sending
 emails from a user on one machine to users on the other machine.
 The error message : 550 5.1.1 remoteu...@example.com: Recipient address
 rejected: User unknown in local recipient table

Both machines must accept all users in the domain.

 Partial postconf output:
 alias_maps = mysql:/etc/postfix/mysql-alias.cf
 mailbox_transport = cyrus
 mydestination = example.com, localhost.example.com, localhost, 
 mysql:/etc/postfix/mysql-mydestination.cf
 myorigin = /etc/mailname

Looks like the split domain is local.  If such a domain is local
to multiple hosts, you need to use an aliases table that lists all the
users:

aliases:
user1:  us...@host1.example.com
user2:  us...@host2.example.com
...

where host1 is listed in mydestination on host1, but not on host2,
and conversely host2 is in mydestination on host2, but on host1.

mydestination =
$myhostname,
example.com,
localhost.example.com,
localhost,
mysql:/etc/postfix/mysql-mydestination.cf

Alternatively, (and I what I actually recommend) you can make the
example.com domain be a virtual alias domain, and use virtual alias
maps to rewrite recipient addresses:

virtual:
us...@example.com   us...@host1.example.com
us...@example.com   us...@host2.example.com

Then on each host:

mydestination =
$myhostname,
localhost.example.com,
localhost,
# possibly instead the mysql domains become virtual
mysql:/etc/postfix/mysql-mydestination.cf

virtual_alias_domains =
example.com
# possibly the mysql domains become virtual
# mysql:/etc/postfix/mysql-virtual-domains.cf

 receive_override_options = no_address_mappings

Not generally a good idea as a global setting.  What are you doing with that?

 transport_maps = hash:/etc/postfix/transport
 virtual_alias_maps =
   mysql:/etc/postfix/mysql-virtual.cf,
   mysql:/etc/postfix/mysql-virtual-example.cf,
   hash:/etc/postfix/virtual

Generally, list the indexed first, those queries are faster.

 Hoping someone knows a good way to send all unknown recepients in local
 tables (referred by mysql-virtual.cf) to a smarthost (192.168.1.1), which
 would decide whether to forward this to the remote server or answer with a
 bounce message.

No need to route through the smarthost if this is an MTA hosting mailboxes.
Only punt to the smarthost from null-client machines that punt everything.

-- 
Viktor.


Recipient address rejected: User unknown in local recipient table

2011-09-06 Thread clem free
Hi,

I installed a postfix relay between a local SMTP server and another relay.

I have the error when email are sent from external (i.e: gmail) to my
internal domain : Recipient address rejected: User unknown in local
recipient table

Here is my main.cf:

disable_dns_lookup = yes
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
myhostname = smtpsrv
mydomain = toto-internal.com
inet_interfaces = all
mydestination = $mydomain, $myhostname, localhost.$mydomain, localhost
local_recipent_maps =
unknown_local_recipient_reject_code = 550
mynetworks = hash:/etc/postfix/mynetworks
transport_maps = hash:/etc/postfix/transport
debug_peer_level = 2
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
smtpd_banner = SMTP Relay - Unauthorized please unlog immediately !!!
relayhost = 192.x.x.x
fallback_relay =

Transport file:
.toto-internal.com smtp:[172.x.x.x]
toto-internal.com smtp:[172.x.x.x]
* smtp:[192.x.x.x]

Mynetworks:
#external relay
192.x.x.x OK
#internal mail server
172.x.x.x OK
#postfix itself
192.x.x.y

Any idea ?

Thanks in advance.


Re: Recipient address rejected: User unknown in local recipient table

2011-09-06 Thread Noel Jones

On 9/6/2011 11:09 AM, clem free wrote:

Hi,

I installed a postfix relay between a local SMTP server and
another relay.

I have the error when email are sent from external (i.e:
gmail) to my internal domain : Recipient address rejected:
User unknown in local recipient table

Here is my main.cf http://main.cf/:



In the future, please show postconf -n output rather than 
random main.cf snippings.


Your domain should be configured as a relay_domain and not 
listed in mydestination.


Valid users should be listed in relay_recipient_maps.

Please see
http://www.postfix.org/documentation.html
http://www.postfix.org/ADDRESS_CLASS_README.html
http://www.postfix.org/STANDARD_CONFIGURATION_README.html#firewall

and if you need more help, please see:
http://www.postfix.org/DEBUG_README.html#mail



  -- Noel Jones