Comments (7)
I just pushed a commit that implements :
- a WTForm field class that handles validation based on the
SelectMultipleField
that you suggested, - a database type for comma separated lists to keep the Postfix compatibility without adding the complexity of a relation table.
What do you think of it? Still testing the forwarding part locally but it seems to fix the bug at least.
from mailu.
Thank you for your feedback, I'm closing the issue then.
from mailu.
I renamed the issue to better describe the bug. When editing an alias with multiple destinations, only the first email address is saved. This could be related to using select2
for aliases.
from mailu.
I was debugging for this issue and I found that the problem is due to use SelectField
instead SelectMultipleField into class AliasForm()
of forms.py
:
class AliasForm(Form):
localpart = fields.StringField('Alias', [validators.DataRequired()])
destination = fields.SelectField('Destination')
comment = fields.StringField('Comment')
submit = fields.SubmitField('Create')
Because I noticed that in aliases.py, the method form.populate_obj(alias) into edit_alias() only populated one destination, data field instead raw_data field. After I changed to SelectMultipleField, data field contains multiple destinations.
But the problem is that database is not prepared for this change because is necessary introducing an array in the destination field of alias table, this is it sql schema:
CREATE TABLE alias (
created_at DATE NOT NULL,
updated_at DATE,
comment VARCHAR(255),
localpart VARCHAR(80) NOT NULL,
destination VARCHAR NOT NULL,
domain_name VARCHAR(80) NOT NULL,
email VARCHAR(255) NOT NULL,
PRIMARY KEY (email),
FOREIGN KEY(domain_name) REFERENCES domain (name)
);
And this is the output error when I try add multiples detinations with SelectMultipleField:
sqlalchemy.exc.InterfaceError: (sqlite3.InterfaceError) Error binding parameter 1 - probably unsupported type. [SQL: 'UPDATE alias SET updated_at=?, destination=? WHERE alias.email = ?'] [parameters: ('2016-08-11', ['[email protected]', '[email protected]'], '[email protected]')]
As this bd is SQLite, we must add a relational table. Other solutions are using BLOB (as a workaround) or using no-sql db as MongoDB (maybe the optimal solution, because it support arrays as type).
Another problem is the way that Postfix query aliases ...
Meanwhile there is a workaround here (#34)
I can handle this by creating a new branch, but I need to know how proceded with this problem.
How do yo see it?
from mailu.
There are two problems with using a relational table here :
- it adds complexity without improving performance (either storage or access performance)
- postfix will be fine with a database accessed relational table but we would have to implement a different scheme for redictions because Dovecot does not support relational tables at all.
from mailu.
Prior to using Select2 we were using tagsinput (4853e54) which worked perfectly because it stored a comma separated list (Postfix compatible format) and read from the same list.
Maybe Select2 supports this as well, which would make for the simplest fix at stay compatible with both Postfix and Dovecot.
from mailu.
Great work! It is perfect and simply for now.
I pulled the latest automatic build freeposte/admin image and I tested it with a couple of destinations and It works fine. Congrats!
from mailu.
Related Issues (20)
- Placeholders in autoconfig file are not replaced HOT 1
- ooo is broken when proxy protocol is in use
- Is relay supported by sending domain?
- imap container doesn't support IPv6 clients over proxy-protocol HOT 2
- ISRG_X1 not included in fullchain.pem (--> DANE validation failed) HOT 5
- 收国外邮件延迟很大
- front container crashing after upgrading to 2.0.39 HOT 3
- Missing cert or key file, disabling TLS
- Files infected with viruses - Warning HOT 1
- how to add one custom mail header,thanks
- SPF is not authorized and invalid rDNS/PTR Record HOT 3
- ERR_TO_MANY_REDIRECTS on /webmail HOT 1
- Autoreply with HTML code HOT 1
- ERROR: cannot start service front: driver failed programming external connectivity on endpoint mailu_front_1 HOT 2
- Use port 465 post email HOT 1
- The postgresql database cannot be configured for roundcube HOT 1
- ERROR: cannot start service front: driver failed programming external connectivity on endpoint mailu_front_1
- [BUG]: Host is already in use by another container HOT 2
- Internal Server Error - In accounts that were imported from another server
- After disable email account, it still receive emails during the disable period HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mailu.