1

Topic: Allow an user to send as any other user.

==== Required information ====
- iRedMail version: 1.8.2
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: Debian 7
====

First of all i'm sorry for my english.
I've one question about how i can authorize an user to send as any user in server.

I've a web app that send an email using the loged user email, but the server don't allow it because it uses one account. I've changed the main.cf from:

smtpd_sender_restrictions = permit_mynetworks, reject_sender_login_mismatch, permit_sasl_authenticated

to:

smtpd_sender_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_sender_login_mismatch

and works fine, but i want to allow only that user to do it, not to everybody (even spammers). Is there any way to do it?

Thanks!!

----

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

2

Re: Allow an user to send as any other user.

iRedAPD has a plugin for this purpose. Please open file /opt/iredapd/plugins/reject_sender_login_mismatch.py, read and follow the comments in this file to enable this plugin.

3 (edited by InformaticaTTU 2014-10-14 00:37:38)

Re: Allow an user to send as any other user.

ZhangHuangbin wrote:

iRedAPD has a plugin for this purpose. Please open file /opt/iredapd/plugins/reject_sender_login_mismatch.py, read and follow the comments in this file to enable this plugin.

Thanks for reply, but, how i activate the plugin?. i've read the file and it say:

"""Reject sender login mismatch (sender in mail header and SASL username).

*) You must remove "sender_login_mismatch" restriction in Postfix parameter
   "smtpd_sender_restrictions" and let this plugin do it for you.

*) Please list all allowed senders in in iRedAPD config file (settings.py),
   parameter ALLOWED_LOGIN_MISMATCH_SENDERS. For example:

    ALLOWED_LOGIN_MISMATCH_SENDERS = ['user1@here.com', 'user2@here.com']
"""

i've done that but with empty "ALLOWED_LOGIN_MISMATCH_SENDERS" to test, and the server allowed to send as another user with the test account. I've to do anything to enable the plugin?

Thanks!!

PDTA: i've pressed report first, sorry hmm

EDIT: I've seen a line in settings.py called "plugins", i've added "reject_sender_login_mismatch" to that line but still no working. I've restarted "iredapd" and "postfix" daemons.

-------------------------------------------------------------------

Forget all, sometimes i'm blind wink
I've uncommented the line where i've added the test email... then is normal that the pluging allowed to send the mail. Now i've commented that line and i've added an empty "ALLOWED_LOGIN_MISMATCH_SENDERS" line and all is working as expected.

Thanks for all your help.

4

Re: Allow an user to send as any other user.

Update comment in this plugin file, should be clearer now:

# How to use this plugin:
#
# *) You must remove "sender_login_mismatch" restriction rule in Postfix
#    setting "smtpd_sender_restrictions" (/etc/postfix/main.cf). this plugin
#    will do the same restriction for you.
#
# *) Enable this plugin in iRedAPD config file /opt/iredapd/settings.py:
#
#    plugins = ['reject_sender_login_mismatch', ...]
#
# *) List senders who are allowed to send email as different users in iRedAPD
#    config file (/opt/iredapd/settings.py), in parameter
#    ALLOWED_LOGIN_MISMATCH_SENDERS. For example:
#
#    ALLOWED_LOGIN_MISMATCH_SENDERS = ['user1@here.com', 'user2@here.com']
#

5

Re: Allow an user to send as any other user.

This is now a tutorial:
http://www.iredmail.org/docs/allow.cert … .user.html