mailcow / mailcow-dockerized

mailcow: dockerized - ๐Ÿฎ + ๐Ÿ‹ = ๐Ÿ’•
https://mailcow.email
GNU General Public License v3.0
8.97k stars 1.18k forks source link

Recipient maps: don't allow local domains in original address #1576

Open stAn47 opened 6 years ago

stAn47 commented 6 years ago

hello, we are using recepient maps for our non-for-profit organization where we use a single email address which is then sent to another cca 40 email addresses.

when we try to add recipient map, we get the following error:

MySQL: PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'new_dest' at row 1 in /web/inc/functions.address_rewriting.inc.php:356 Stack trace: #0 /web/inc/functions.address_rewriting.inc.php(356): PDOStatement->execute(Array) #1 /web/json_api.php(150): recipient_map('add', Array) #2 {main}

i am completely new to docker and mailcow, giving it a try as a migration from our old server (ispconfig), while i do have experience with postfix,dovecot,mysql, i am not sure what is the proper way to modify docker images so they persist

how can we modify the DB schema so that it persists any mailcow updates ?

thank you, best regards, stan

andryyy commented 6 years ago

This will not work.

We should add a check if the new dest is a valid mail address.

What you want is probably an alias address with multiple destinations. :-)

Am 16.07.2018 um 14:46 schrieb stAn47 notifications@github.com:

hello, we are using recepient maps for our non-for-profit organization where we use a single email address which is then sent to another cca 40 email addresses.

when we try to add recipient map, we get the following error:

MySQL: PDOException: SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'new_dest' at row 1 in /web/inc/functions.address_rewriting.inc.php:356 Stack trace: #0 /web/inc/functions.address_rewriting.inc.php(356): PDOStatement->execute(Array) #1 /web/json_api.php(150): recipient_map('add', Array) #2 {main}

i am completely new to docker and maicow, giving it a try as a migration from our old server, while i do have experience with postfix,dovecot,mysql, i am not sure what is the proper way to modify docker images so they persist

how can we modify the DB schema so that it persists any mailcow updates ?

thank you, best regards, stan

โ€” You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

stAn47 commented 6 years ago

hello andryyy, thank you very much for the solution, it should do the job.

generally upon migration we really miss any API to add all of this (from ispconfig) programatically (i.e. import mailboxes + aliases + sender and recipient bcc's )

on the other hand ya'll did a great job providing mailcow dockerized. main reason i chose this is a complete process separation from rest of the system, but i am a bit afraid of adjusting those docker images (for performance, installation of custom plugins, etc.. )

thanks again, best regards, stan

mkuron commented 6 years ago

We should also add a check to ensure that any "original address" configured in the recipient map does not belong to one of the domains. If it does, we should display an error telling the user to use aliases instead.

andryyy commented 6 years ago

@mkuron Why is the new dest field a textarea anyway? I am sure it can only be a single dest.

Yes: warning: 5E979156D: multi-valued recipient_canonical_maps entry for blabla@gmail.com

mkuron commented 6 years ago

Ok, then you can change that. I thought multiple values were allowed, but clearly they arenโ€™t.

andryyy commented 6 years ago

No problem, I thought so, too.

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.