Forward local user email or another local user

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

Forward local user email or another local user

JosC
I have a service running that requires me to configure an SMTP user X
with password to send daily statistics to.

Cannot use a virtual alias user (and forward to the final user Y)
because I have to provide a password as well.

So I set up a dedicated user X account (with password) for this to be
used to pass through incoming email to the final user Y account (which I
didn't want to use for that SMTP action).

Can you tell me how I can force this to be done with Postfix directly?
I can solve it by some forward action once it arrives in the inbox of
user X, and forward it to user Y, but would be better if I can do such
directly with Postfix.

-- With both feet on the ground you can't make any step forward
Reply | Threaded
Open this post in threaded view
|

Re: Forward local user email or another local user

cacook

On 10/26/2017 08:59 AM, Jos Chrispijn wrote:
I have a service running that requires me to configure an SMTP user X with password to send daily statistics to.

Cannot use a virtual alias user (and forward to the final user Y) because I have to provide a password as well.

So I set up a dedicated user X account (with password) for this to be used to pass through incoming email to the final user Y account (which I didn't want to use for that SMTP action).

Can you tell me how I can force this to be done with Postfix directly?
I can solve it by some forward action once it arrives in the inbox of user X, and forward it to user Y, but would be better if I can do such directly with Postfix.

-- With both feet on the ground you can't make any step forward

Am I understanding correctly that there can be no email authentication with virtual users?

And nobody told me this, with my long thread on Virtual Domains/Users? 

I've been on the wrong track all this time.  How can there be no authentication with virtual users.




0x946C680E.asc (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Forward local user email or another local user

Matus UHLAR - fantomas
>On 10/26/2017 08:59 AM, Jos Chrispijn wrote:
>> Cannot use a virtual alias user (and forward to the final user Y)
>> because I have to provide a password as well.

On 26.10.17 09:25, [hidden email] wrote:
>Am I understanding correctly that there can be no email authentication
>with virtual users?

no. virtual alias is not virtual user.


--
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.
Linux IS user friendly, it's just selective who its friends are...
Reply | Threaded
Open this post in threaded view
|

Re: Forward local user email or another local user

Matus UHLAR - fantomas
In reply to this post by JosC
On 26.10.17 17:59, Jos Chrispijn wrote:

>I have a service running that requires me to configure an SMTP user X
>with password to send daily statistics to.
>
>Cannot use a virtual alias user (and forward to the final user Y)
>because I have to provide a password as well.
>
>So I set up a dedicated user X account (with password) for this to be
>used to pass through incoming email to the final user Y account
>(which I didn't want to use for that SMTP action).
>
>Can you tell me how I can force this to be done with Postfix directly?

what do you mean directly? what you described is exactly what needs to be
done in case described by you.

>I can solve it by some forward action once it arrives in the inbox of
>user X, and forward it to user Y, but would be better if I can do
>such directly with Postfix.

if you want to send mail to a user Y and you don't want to use password of
user Y, but you must use a password, you must use password of user X
(whatever X and Y mean)

--
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.
Linux is like a teepee: no Windows, no Gates and an apache inside...
Reply | Threaded
Open this post in threaded view
|

Re: Forward local user email or another local user

cacook
In reply to this post by Matus UHLAR - fantomas
On 10/26/2017 11:09 AM, Matus UHLAR - fantomas wrote:
On 10/26/2017 08:59 AM, Jos Chrispijn wrote:
Cannot use a virtual alias user (and forward to the final user Y)
because I have to provide a password as well.

On 26.10.17 09:25, [hidden email] wrote:
Am I understanding correctly that there can be no email authentication
with virtual users?

no. virtual alias is not virtual user.

So, passwords -can- be used with virtual users for SMTP?

I need to authenticate to the server, to send emails.

mynetworks = lets me set an accepted network, although my laptop often changes IPs (DHCP) so I'd need to set it to the class C range.  And I can't find in docs any mechanism for when I'm on other random networks. (phone)  There has to be authentication.


0x946C680E.asc (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Forward local user email or another local user

JosC
In reply to this post by Matus UHLAR - fantomas

Op 26-10-2017 om 20:17 schreef Matus UHLAR - fantomas:
> if you want to send mail to a user Y and you don't want to use
> password of
> user Y, but you must use a password, you must use password of user X
> (whatever X and Y mean)
It is all about _existing_ user accounts
Using (virtual) aliases provides only email addresses of non existing
users, which I cannot use for the push service (that is going to send
out the message(s).

I don't want the mail to come into the inbox of existing user X but
directly forwarded into the one of existing user Y.

-- With both feet on the ground you can't make any step forward

Reply | Threaded
Open this post in threaded view
|

Re: Forward local user email or another local user

Bill Cole-3
In reply to this post by cacook
On 26 Oct 2017, at 14:24, [hidden email] wrote:

> So, passwords -can- be used with virtual users for SMTP?

Yes. Any authentication identity can be used for Postfix's
SMTP/Submission authentication because Postfix doesn't really do the
authentication.

Authentication in Postfix is entirely managed by external SASL
libraries: either Cyrus or Dovecot. Authentication does not even
intrinsically require a deliverable address and not all deliverable
addresses (e.g. aliases, usually) will be valid authentication
identities. For example, on my personal system the "virtual" address
that I use for Dovecot (and hence Postfix) authentication is in fact
tied to a real OS user with a username that is never published as an
email address and which actually can't receive mail via SMTP except via
addresses in virtual domains. Unless you have smtpd_sender_login_maps
defined, the authentication identity you use is not bound to any
particular sender address or set of sender addresses. It is merely a
username that the SASL subsystem has authenticated.
Reply | Threaded
Open this post in threaded view
|

Re: Forward local user email or another local user

JosC
Op 27-10-2017 om 0:17 schreef Bill Cole:
So, passwords -can- be used with virtual users for SMTP?

Yes. Any authentication identity can be used for Postfix's SMTP/Submission authentication because Postfix doesn't really do the authentication.

That is an interesting statment. I really didn't know that (sorry for the mix up here).
Where can I find this to work regarding configuration of these kind of accounts? I know have a control file virtual_alias_maps in which I refer non main domein addresses to domain users.

-- With both feet on the ground you can't make any step forward
Reply | Threaded
Open this post in threaded view
|

Re: Forward local user email or another local user

Matus UHLAR - fantomas
In reply to this post by JosC
>Op 26-10-2017 om 20:17 schreef Matus UHLAR - fantomas:
>>if you want to send mail to a user Y and you don't want to use
>>password of
>>user Y, but you must use a password, you must use password of user X
>>(whatever X and Y mean)

On 26.10.17 21:33, Jos Chrispijn wrote:
>It is all about _existing_ user accounts
>Using (virtual) aliases provides only email addresses of non existing
>users, which I cannot use for the push service (that is going to send
>out the message(s).

actually, virtual users don't have to exist in underlying OS, but they must
exist in postfix - otherwise you could not send mail to them.
they apparently exist in your IMAP server, thus they can exist in sasl too.

>I don't want the mail to come into the inbox of existing user X but
>directly forwarded into the one of existing user Y.

log your SMTP session as user X and send the mail to user Y then.
Is there any reason you want to "forward" the mail?
--
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.
Boost your system's speed by 500% - DEL C:\WINDOWS\*.*
Reply | Threaded
Open this post in threaded view
|

Re: Forward local user email or another local user

Bill Cole-3
In reply to this post by JosC
On 27 Oct 2017, at 5:41 (-0400), Jos Chrispijn wrote:

> Op 27-10-2017 om 0:17 schreef Bill Cole:
>> So, passwords -can- be used with virtual users for SMTP?
>>
>> Yes. Any authentication identity can be used for Postfix's
>> SMTP/Submission authentication because Postfix doesn't really do the
>> authentication.
>>
> That is an interesting statment. I really didn't know that (sorry for
> the mix up here).
> Where can I find this to work regarding configuration of these kind of
> accounts? I know have a control file virtual_alias_maps in which I
> refer non main domein addresses to domain users.

How you configure authentication for Postfix depends on which SASL
library you use: Cyrus or Dovecot. The Postfix details for both are
documented in http://www.postfix.org/SASL_README.html and there are
deeper explanations in the documentation specifically for each SASL
implementation.

--
Bill Cole
[hidden email] or [hidden email]
(AKA @grumpybozo and many *@billmail.scconsult.com addresses)
Currently Seeking Paying Work: https://linkedin.com/in/billcole
Reply | Threaded
Open this post in threaded view
|

Re: Forward local user email or another local user

JosC
In reply to this post by JosC
Op 26-10-2017 om 17:59 schreef Jos Chrispijn:
> Can you tell me how I can force this to be done with Postfix directly?

Finally the solution was so simple:

- create user jdoe (main domain)
- add entry to /etc/aliases:

jdoe:      <any existing username>

- update /postfix/tables
- restart postfix

When I now send a domain user an email, instead of arriving in
/var/mail/jdoe it is piped to <any existing username>
Solved!

-- With both feet on the ground you can't make any step forward