3

I could not make Postfix work with Linux usernames containing @

Postfix has virtual domain map, in /etc/postfix/virtual

It looks something like this:

domain.ru                       domain.ru
[email protected]         [email protected]
[email protected]             [email protected]

It means that all mail going to users [email protected] and [email protected] must be delivered to the Linux user with name [email protected]

However, when I use no @ in Linux username, like me.example.ru, things work regular way.

I found out that saslauth rejected to work with [email protected] unless it's load with -r flag. Is there something familiar should be done to Postfix, to make it work the same way?

I also tried me\@example.ru, escaping it. No effect. What am I missing?

2
  • How do you want to treat/deliver messages to OTHER addresses in example.ru?
    – AnFi
    Jul 30, 2015 at 14:48
  • They have the same structure as the example above but just for example.ru
    – Ilia Ross
    Jul 30, 2015 at 16:21

2 Answers 2

5

According to hints from [email protected] you should use virtual mailer instead of local mailer for deliveries to [email protected].

As I understand you may:
1. Put example.ru domain in virtual_mailbox_domains list
2. Use virtual mailbox map (vmailbox) to specify location of [email protected] mailbox-file/maildir
3. Use virtual uid map to set owner of [email protected] mailbox file(s)
[it selects OS account/user (numerical) identifier]

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


[postfix-users] OS accounts/users with @

To: postfix-users at postfix org
Subject: Re: OS accounts/users with @
Date: Thu, 30 Jul 2015 11:21:12 -0400 (EDT)
Message-Id: <[email protected]>
From: [email protected] (Wietse Venema)
[...]
In any case, using UNIX system account names with @ is a mistake, and I will not put in a great deal of effort to make that easy.

Wietse

1
  • I think I got it now. Thanks for extra, interesting investigation on Google Groups
    – Ilia Ross
    Jul 30, 2015 at 22:40
2

What directive used in main.cf for that /etc/postfix/virtual ? There're a bunch of maps.

I would use for such things in main.cf just

recipient_bcc_maps = hash:/usr/local/etc/postfix/recipient_bcc
sender_bcc_maps = hash:/usr/local/etc/postfix/sender_bcc

where you can manipulate with copies of sent/received emails.

Syntax of recipient_bcc/sender_bcc is pretty simple (as all in postfix)

# Email to catch                       email to send copy
[email protected]                [email protected]
[email protected]                    [email protected]

Advantage of using bcc - You can assign some admin and monitor him or keep related to [email protected] emails in his account and keep clean [email protected] account, when you get msg you can safely delete it since you know you always have a copy in real account. If assigned admin delete some msg, you anyway will have a copy as evidence if he/she something wrong.

12
  • There is no directives should be in main.cf about virtual domains. I'm not sure how your answer will help me to solve my problem. The problem is, that Postifix needs additional settings (if there are any in this concern) to make it work.
    – Ilia Ross
    Jul 28, 2015 at 21:34
  • recipient_bcc_maps is not related to virtual domains only, it catching every emails passed through the server. This directive used in main.cf as a global parameters and just point to external file shown above. If you won't such solution as bcc check, then you need to use virtual_alias_maps
    – Alex
    Jul 28, 2015 at 22:34
  • BTW, "There is no directives should be in main.cf about virtual domains." - If main.cf will not have directive about virtual domains, then how did you point to /etc/postfix/virtual ?
    – Alex
    Jul 28, 2015 at 22:37
  • The problem is that [email protected] is local Linux username and it falls into loop.
    – Ilia Ross
    Jul 28, 2015 at 22:38
  • 1
    Alex, my question was about how to make things work differently, when they already work find the way they are. In case, in virtual I set destination user as me.example.ru - it's all fine then BUT if I use [email protected], then Postfix says unknown user!? What should I do?
    – Ilia Ross
    Jul 29, 2015 at 18:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .