1 (edited by c33s 2012-03-19 07:40:57)

Topic: smtp alias sending problem

os: debian squeeze stable
iredmail: iRedMail-0.7.4
backend: iRedAdmin-Pro-MySQL

i have a problem sending a mail over smtp using an alias connected with the account. after creating a user account named "firstname.lastname@domain.com" i added an alias to the domain "post@domain.com" (see attachment). it is not possible to send an email over smtp, having the alias as sender address.

Mar 19 00:28:55 mail postfix/smtpd[3628]: NOQUEUE: reject: RCPT from xxx.xxx.xxx.xxx: 553 5.7.1 <post@domain.com>: Sender address rejected: not owned by user firstname.lastname@domain.com; from=<post@domain.com> to=<name@otherdomain.at> proto=ESMTP helo=<[yyy.yyy.yyy.yyy]>

Post's attachments

Edit account profile - Mozilla Firefox_2012-03-19_00-36-37.png
Edit account profile - Mozilla Firefox_2012-03-19_00-36-37.png 19.09 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: smtp alias sending problem

Reference: http://iredmail.org/wiki/index.php?titl … domain.ltd

Searching forum before posting is a good idea.

3 (edited by c33s 2012-03-19 23:44:20)

Re: smtp alias sending problem

the solution you posted is not really a good option to solve this. removing "reject_sender_login_mismatch" just allows users to fake identities.

for example:
we have two users for a domain.
mark@domain.com
sandy@domain.com

mark has two aliases:
office@domain.com
mark.gardner@domain.com

sandy has one alias:
sandy.hubert@domain.com

both should be able to use all their aliases as their from address but they must not use it overcross.
with removing "reject_sender_login_mismatch" sandy can "use mark.garnder@" as her from address.

edit: fixed grammar

4

Re: smtp alias sending problem

c33s wrote:

the solution you posted is not really a good option to solve this. removing "reject_sender_login_mismatch" just allows users to fake identities.

You're right. but i don't know how to make Postfix return proper value in smtpd_sender_login_maps. Any suggestion?

5

Re: smtp alias sending problem

not right now, i hoped you have one. now i am searching the docs...

6

Re: smtp alias sending problem

I don't think this will work... Aliases are not supposed to work like this for outgoing messages, only for incoming.

For example, if you have 3 mailbox accounts:
mark@domain.com
sarah@domain.com
john@domain.com

And one alias which points to all three of them:
support@domain.com -> mark@, sarah@, john@

Which one of sarah, mark and john are supposed to "own" that alias? Which one is supposed to be able to send from it?

7

Re: smtp alias sending problem

Which one of sarah, mark and john are supposed to "own" that alias? Which one is supposed to be able to send from it?

quite easy to define. all of them are allowed.
it should work like a normal unix group membership.

8 (edited by Swordsman 2012-05-16 19:12:31)

Re: smtp alias sending problem

c33s wrote:

all of them are allowed.
it should work like a normal unix group membership.

I stood in front of the same problem as only recipients of an alias schould be able to send with it.
I managed to do so, by adding a new mysql query to the "mysql" subfolder of postfix and added it to the main.cf under "smtpd_sender_login_maps".
The new query I placed in "/etc/postfix/mysql/sender_login_maps_alias.cf" was

SELECT alias.goto FROM alias,domain WHERE alias.address='%s' AND alias.domain='%d' AND alias.domain=domain.domain AND alias.enablesmtp=1 AND alias.active=1 AND domain.backupmx=0 AND domain.active=1

Copy the other Settings from one of the other scripts.
I also inserted a tinyint column into aliases with the title "enablesmtp" and the default value '1', so I could deaktivate sending via specific aliases.

Comments are Welcome, but as far as I tested, it worked (and still rejects unknown aliases or senders)

EDIT: you could also insert a column for accepted senders into aliases and query them instead of goto, so you could specify who could send i.e. leave out some addresses, so only one could send but two recieve.