Aliases/.forward/virtual_users confusion

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Aliases/.forward/virtual_users confusion

Gerben Wierda
I am trying to understand how my aliases/virtual_users/etc interact.

postfix setup has virtual domains and virtual users, but all users (also those from different domains) are local dovecot IMAP mailboxes (“separate domains, unix system accounts”)

main.cf says it is the destination for:
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, $myorigin
mydomain = rna.nl
mydomain_fallback = localhost
myhostname = mail.rna.nl
mynetworks = 127.0.0.0/8, 192.168.2.0/24, [::1]/128

Aliases maps are defined in main.cf as follows:
alias_maps = hash:/Library/Server/Mail/Config/postfix/aliases hash:/Library/Server/Mail/Data/listserver/aliases/list_server_aliases
virtual_alias_maps = $virtual_maps hash:/Library/Server/Mail/Config/postfix/virtual_users hash:/Library/Server/Mail/Config/postfix/rna_virtual_users hash:/Library/Server/Mail/Data/listserver/aliases/list_server_virtual

My /Library/Server/Mail/Config/postfix/aliases file contains:
# Person who should get root's mail. Don't receive mail as root!
root:           gerben
# Basic system aliases -- these MUST be present
MAILER-DAEMON:  postmaster
postmaster:     root
postfix: root

gerben is an existing local user with a dovecot IMAP mailbox who can receive mail.

The result of trying to mail to [hidden email] or [hidden email] using SMTP from another system was originally:
The server response was: <[hidden email]>: Recipient address rejected: User unknown in local recipient table

The server’s name internally is dumbledore.rna.nl (presents itself as mail.rna.nl on the outside) and the same happened with the [hidden email] address or with [hidden email], but [hidden email] worked. And [hidden email] worked and delivered to gerben’s dovecot mailbox.

Why doesn’t this work? E.g. the server is the final destination for $myorigin which is dumbledore.rna.nl, but [hidden email] doesn’t work.

With the following in virtual_users:
I can receive mail for root from another system via SMTP to [hidden email], but I still cannot receive local mail to root from the local /usr/bin/mail or crontab to ‘root'. It seems that I must have a ~root/.forward with in it:
or I have to put the following in another /etc/aliases file (not the one postfix uses):
And not ‘gerben’ as otherwise, the mail ends up in /var/mail/gerben instead of in dovecot

And I must enter the [hidden email] in my virtual_users as well:
to have it covered, 

I have it working but it seems all a little complex to me and I get the feeling that I have made things overly complex. Am I correct?

And what is preferred? An /etc/aliases file that is in use (next to the one I am using) or a ~root/.forward file?


Reply | Threaded
Open this post in threaded view
|

Re: Aliases/.forward/virtual_users confusion

Matus UHLAR - fantomas
On 20.12.19 17:25, Gerben Wierda wrote:

>I am trying to understand how my aliases/virtual_users/etc interact.
>
>postfix setup has virtual domains and virtual users, but all users (also those from different domains) are local dovecot IMAP mailboxes (“separate domains, unix system accounts”)
>
>main.cf says it is the destination for:
>mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, $myorigin
>mydomain = rna.nl
>mydomain_fallback = localhost
>myhostname = mail.rna.nl
>mynetworks = 127.0.0.0/8, 192.168.2.0/24, [::1]/128
>myorigin = dumbledore.rna.nl
>
>Aliases maps are defined in main.cf as follows:
>alias_maps = hash:/Library/Server/Mail/Config/postfix/aliases hash:/Library/Server/Mail/Data/listserver/aliases/list_server_aliases
>virtual_alias_maps = $virtual_maps hash:/Library/Server/Mail/Config/postfix/virtual_users hash:/Library/Server/Mail/Config/postfix/rna_virtual_users hash:/Library/Server/Mail/Data/listserver/aliases/list_server_virtual

don't you have dumbledore.rna.nl defined in
/Library/Server/Mail/Config/postfix/virtual_users
/Library/Server/Mail/Config/postfix/rna_virtual_users or
/Library/Server/Mail/Data/listserver/aliases/list_server_virtual by any
chance?


>My /Library/Server/Mail/Config/postfix/aliases file contains:
># Person who should get root's mail. Don't receive mail as root!
>root:           gerben
># Basic system aliases -- these MUST be present
>MAILER-DAEMON:  postmaster
>postmaster:     root
>postfix: root
>
>gerben is an existing local user with a dovecot IMAP mailbox who can receive mail.
>
>The result of trying to mail to [hidden email] or [hidden email] using SMTP from another system was originally:
>The server response was: <[hidden email]>: Recipient address rejected: User unknown in local recipient table
>
>The server’s name internally is dumbledore.rna.nl (presents itself as mail.rna.nl on the outside) and the same happened with the [hidden email] address or with [hidden email], but [hidden email] worked. And [hidden email] worked and delivered to gerben’s dovecot mailbox.
>
>Why doesn’t this work? E.g. the server is the final destination for $myorigin which is dumbledore.rna.nl, but [hidden email] doesn’t work.
>
>With the following in virtual_users:
>[hidden email]     [hidden email]
>I can receive mail for root from another system via SMTP to [hidden email], but I still cannot receive local mail to root from the local /usr/bin/mail or crontab to ‘root'. It seems that I must have a ~root/.forward with in it:
>[hidden email]
>or I have to put the following in another /etc/aliases file (not the one postfix uses):
>root: [hidden email]
>And not ‘gerben’ as otherwise, the mail ends up in /var/mail/gerben instead of in dovecot
>
>And I must enter the [hidden email] in my virtual_users as well:
>[hidden email] [hidden email]
>[hidden email]  [hidden email]
>to have it covered,
>
>I have it working but it seems all a little complex to me and I get the feeling that I have made things overly complex. Am I correct?
>
>And what is preferred? An /etc/aliases file that is in use (next to the one I am using) or a ~root/.forward file?

alias_maps are processed before .forward, virtual_alias_maps before
alias_maps.

--
Matus UHLAR - fantomas, [hidden email] ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
It's now safe to throw off your computer.
Reply | Threaded
Open this post in threaded view
|

Re: Aliases/.forward/virtual_users confusion

Gerben Wierda

On 20 Dec 2019, at 22:06, Matus UHLAR - fantomas <[hidden email]> wrote:

On 20.12.19 17:25, Gerben Wierda wrote:
I am trying to understand how my aliases/virtual_users/etc interact.

postfix setup has virtual domains and virtual users, but all users (also those from different domains) are local dovecot IMAP mailboxes (“separate domains, unix system accounts”)

main.cf says it is the destination for:
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, $myorigin
mydomain = rna.nl
mydomain_fallback = localhost
myhostname = mail.rna.nl
mynetworks = 127.0.0.0/8, 192.168.2.0/24, [::1]/128
myorigin = dumbledore.rna.nl

Aliases maps are defined in main.cf as follows:
alias_maps = hash:/Library/Server/Mail/Config/postfix/aliases hash:/Library/Server/Mail/Data/listserver/aliases/list_server_aliases
virtual_alias_maps = $virtual_maps hash:/Library/Server/Mail/Config/postfix/virtual_users hash:/Library/Server/Mail/Config/postfix/rna_virtual_users hash:/Library/Server/Mail/Data/listserver/aliases/list_server_virtual

don't you have dumbledore.rna.nl defined in
/Library/Server/Mail/Config/postfix/virtual_users
/Library/Server/Mail/Config/postfix/rna_virtual_users or
/Library/Server/Mail/Data/listserver/aliases/list_server_virtual by any
chance?

No. The only occurrences of the string ‘dumbledore' in /Library/Server/Mail/Config/:

main.cf:myorigin = dumbledore.rna.nl
rna_virtual_users:[hidden email] [hidden email]

and none in /Library/Server/Mail/Data/listserver/aliases/list_server_virtual



My /Library/Server/Mail/Config/postfix/aliases file contains:
# Person who should get root's mail. Don't receive mail as root!
root:           gerben
# Basic system aliases -- these MUST be present
MAILER-DAEMON:  postmaster
postmaster:     root
postfix: root

gerben is an existing local user with a dovecot IMAP mailbox who can receive mail.

The result of trying to mail to [hidden email] or [hidden email] using SMTP from another system was originally:
The server response was: <[hidden email]>: Recipient address rejected: User unknown in local recipient table

The server’s name internally is dumbledore.rna.nl (presents itself as mail.rna.nl on the outside) and the same happened with the [hidden email] address or with [hidden email], but [hidden email] worked. And [hidden email] worked and delivered to gerben’s dovecot mailbox.

Why doesn’t this work? E.g. the server is the final destination for $myorigin which is dumbledore.rna.nl, but [hidden email] doesn’t work.

With the following in virtual_users:
[hidden email]     [hidden email]
I can receive mail for root from another system via SMTP to [hidden email], but I still cannot receive local mail to root from the local /usr/bin/mail or crontab to ‘root'. It seems that I must have a ~root/.forward with in it:
[hidden email]
or I have to put the following in another /etc/aliases file (not the one postfix uses):
root: [hidden email]
And not ‘gerben’ as otherwise, the mail ends up in /var/mail/gerben instead of in dovecot

And I must enter the [hidden email] in my virtual_users as well:
[hidden email] [hidden email]
[hidden email]  [hidden email]
to have it covered,

I have it working but it seems all a little complex to me and I get the feeling that I have made things overly complex. Am I correct?

And what is preferred? An /etc/aliases file that is in use (next to the one I am using) or a ~root/.forward file?

alias_maps are processed before .forward, virtual_alias_maps before
alias_maps.

--
Matus UHLAR - fantomas, [hidden email] ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
It's now safe to throw off your computer.

Reply | Threaded
Open this post in threaded view
|

Re: Aliases/.forward/virtual_users confusion

Noel Jones-2
On 12/20/2019 4:56 PM, Gerben Wierda wrote:

>
>> On 20 Dec 2019, at 22:06, Matus UHLAR - fantomas
>> <[hidden email] <mailto:[hidden email]>> wrote:
>>
>> On 20.12.19 17:25, Gerben Wierda wrote:
>>> I am trying to understand how my aliases/virtual_users/etc interact.
>>>
>>> postfix setup has virtual domains and virtual users, but all
>>> users (also those from different domains) are local dovecot IMAP
>>> mailboxes (“separate domains, unix system accounts”)
>>>

Note that aliases and .forward are only processed by domains that
use the postfix local delivery agent. If you're using anything other
than that, such as the dovecot delivery agent or LMTP, only the
virtual aliases will be used. All mail is subject to virtual
aliases, regardless of delivery agent or domain type.

The delivery agent will be noted in the mail log during delivery.




   -- Noel Jones