internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: OpenNMT/OpenNMT-tf

Issue:
Output of inference with score formatted as a "byte string"
Running `onmt-main  --auto_config infer` with scores enabled in the config, outputs the prediction formatted as a byte string. 
Example:
`-18.279692 ||| b'Mira mit Orien- und B\xc3\xa4hrschienen .'`

When parsing the output afterwards, this leads to problems because
```
>>> str("b'Mira mit Orien- und B\xc3\xa4hrschienen .'`")
"b'Mira mit Orien- und BÃ¤hrschienen .'`"
```
while it should be 
```
>>> b'Mira mit Orien- und B\xc3\xa4hrschienen .'.decode()
'Mira mit Orien- und Bährschienen .'
```

I am using OpenNMT-tf 2.21.0 and TF/TF-text 2.4.3. To generate the output, I followed the [quickstart ](https://opennmt.net/OpenNMT-tf/quickstart.html) and used SentancePiece (as described [here](https://opennmt.net/OpenNMT-tf/tokenization.html#example-sentencepiece-tokenization)).
For the inference I added 
```
infer:
  n_best: 4
  with_scores: ture
```
to the config. Setting `with_scores: false` and rerunning, results in correct formatting/encoding.
I happy to provide additional information if necessary.


Discussion:

Resolving patch:
diff --git a/opennmt/models/sequence_to_sequence.py b/opennmt/models/sequence_to_sequence.py
--- a/opennmt/models/sequence_to_sequence.py
+++ b/opennmt/models/sequence_to_sequence.py
@@ -474,7 +474,7 @@ def print_prediction(self, prediction, params=None, stream=None):
                 tokens = prediction["tokens"][i][:target_length]
                 sentence = self.labels_inputter.tokenizer.detokenize(tokens)
             else:
-                sentence = prediction["text"][i]
+                sentence = prediction["text"][i].decode("utf-8")
             score = None
             attention = None
             if with_scores:


Test patch:
Repository: OpenNMT/OpenNMT-tf

Issue:
Make timeout value configurable while searching for an optimal batch size
In the `_auto_tune_batch_size`, the timeout value is hard coded to 15 minutes. For very large amounts of data, the workaround is to manually find a batch size by trying different values. Would be nice, if we could increase the timeout value by setting it as one of the `parameters`


Discussion:

Resolving patch:
diff --git a/opennmt/runner.py b/opennmt/runner.py
--- a/opennmt/runner.py
+++ b/opennmt/runner.py
@@ -157,6 +157,7 @@ def _finalize_config(self, training=False, num_replicas=1, num_devices=1):
                     num_devices=num_devices,
                     scaling_factor=train_config.get("batch_size_autotune_scale", 0.7),
                     mixed_precision=self._mixed_precision,
+                    timeout=train_config.get("batch_size_autotune_timeout", 15 * 60),
                 )
 
         tf.get_logger().info(


Test patch:
Repository: ktbyers/netmiko

Issue:
Add a way to read commands from a file for send_command_set()



Discussion:
I asked about this a few days ago.  However, I think that there may be some things to consider.  Creating an array of the files lines may be bad from a performance perspective.  Chunking may be better, creating a smaller array, pushing the lines, and then going through the next X chunks.  This is particularly true when the file contains entire configurations with comments.

This suggestion may fall under "[premature optimization is the root of all evil](http://en.wikipedia.org/wiki/Program_optimization#Quotes)", though.  Take it with a grain of salt.  :)

Also, as I require this feature for an upcoming project, I may implement it (crudely) and submit a PR with the change.

I think we should probably keep it simple...just read in the whole file and parse it into a list. 

I don't see the performance of chunking as mattering.

The performance that possibly matter is how long it takes to send a whole bunch of configuration commands since send_config_set() calls send_command() which will by default delay 1 second per command.

I've written the code for this.  I'll be submitting a PR later today or tomorrow.


Resolving patch:
diff --git a/netmiko/base_connection.py b/netmiko/base_connection.py
--- a/netmiko/base_connection.py
+++ b/netmiko/base_connection.py
@@ -322,6 +322,22 @@ def check_config_mode(self):
         pass
 
 
+    def send_config_file(self, config_file=None, commit=False):
+        '''
+        Parse a configuration file and relay the data to
+        self.send_config_set()
+        '''
+
+        config_commands = []
+        try:
+            for line in open(config_file, "r"):
+                config_commands.append(line.strip())
+        except IOError as (errno, strerr):
+            print "I/O Error {0}: {1}".format(errno, strerr)
+
+        return self.send_config_set(config_commands=config_commands,
+                                    commit=commit)
+
     def send_config_set(self, config_commands=None, commit=False):
         '''
         Send in a set of configuration commands as a list


Test patch:
Repository: ktbyers/netmiko

Issue:
Serial driver python3 issues
```
edited line 173 in utilities.py to the following:
       cdc = next(serial.tools.list_ports.grep(name))
       return cdc[0]

and edited base_connection.py to add:
output += self.remote_conn.read(self.remote_conn.in_waiting).decode('utf-8', 'ignore')
on my line 385 (edited)
```


Discussion:
Also:

```
print(cdc) = COM6 - Prolific USB-to-Serial Comm Port (COM6)
print(cdc[0]) = COM6
print(cdc[1]) = Prolific USB-to-Serial Comm Port (COM6)
print(cdc[2]) = USB VID:PID=067B:2303 SER=5 LOCATION=1-6

ktbyers [8:14 PM]
Can you `print(type(cdc))`


<class 'serial.tools.list_ports_common.ListPortInfo'>
```

Resolving patch:
diff --git a/netmiko/base_connection.py b/netmiko/base_connection.py
--- a/netmiko/base_connection.py
+++ b/netmiko/base_connection.py
@@ -457,7 +457,9 @@ def _read_channel(self):
         elif self.protocol == "serial":
             output = ""
             while self.remote_conn.in_waiting > 0:
-                output += self.remote_conn.read(self.remote_conn.in_waiting)
+                output += self.remote_conn.read(self.remote_conn.in_waiting).decode(
+                    "utf-8", "ignore"
+                )
         log.debug("read_channel: {}".format(output))
         self._write_session_log(output)
         return output
diff --git a/netmiko/utilities.py b/netmiko/utilities.py
--- a/netmiko/utilities.py
+++ b/netmiko/utilities.py
@@ -183,7 +183,7 @@ def check_serial_port(name):
     """returns valid COM Port."""
     try:
         cdc = next(serial.tools.list_ports.grep(name))
-        return cdc.split()[0]
+        return cdc[0]
     except StopIteration:
         msg = "device {} not found. ".format(name)
         msg += "available devices are: "


Test patch:
Repository: ktbyers/netmiko

Issue:
Huawei vrpv8 commit func issue
After commiting changes on huawei vrpv8, cli on devices look like this: 
```
[~HUAWEI]dot1x enable
[*HUAWEI]snmp-agent sys-info version all
Warning: SNMPv1/SNMPv2c is not secure, and SNMPv3 in either authentication or privacy mode is recommended.
[*HUAWEI]commit
[~HUAWEI]
```


with following code: 

```
from netmiko import Netmiko

device = {
    "host": "10.0.0.3",
    "username": "yyy",
    "password": "xxx",
    "device_type": "huawei_vrpv8",
    "session_log": "log_file2.txt"
}
config_commands = ['dot1x enable','snmp-agent sys-info version all']
net_connect = Netmiko(**device)

output = net_connect.send_config_set(config_commands,exit_config_mode=False)
output += net_connect.commit()
print(output)
```

i got this error: 

```
Traceback (most recent call last):
  File "/home/kafooo/PycharmProjects/nornir_scripts/venv/huawei_netmiko_test.py", line 18, in <module>
    output2 = net_connect.commit()
  File "/home/kafooo/PycharmProjects/nornir_scripts/venv/lib/python3.6/site-packages/netmiko/huawei/huawei_ssh.py", line 114, in commit
    strip_command=False, delay_factor=delay_factor)
  File "/home/kafooo/PycharmProjects/nornir_scripts/venv/lib/python3.6/site-packages/netmiko/base_connection.py", line 1206, in send_command_expect
    return self.send_command(*args, **kwargs)
  File "/home/kafooo/PycharmProjects/nornir_scripts/venv/lib/python3.6/site-packages/netmiko/base_connection.py", line 1188, in send_command
    search_pattern))
OSError: Search pattern never detected in send_command_expect: \[\*HUAWEI\]
```


looks like netmiko is expecting [*hostname] after commit, but in reality there is [~hostname] after commit


Discussion:

Resolving patch:
diff --git a/netmiko/huawei/huawei_ssh.py b/netmiko/huawei/huawei_ssh.py
--- a/netmiko/huawei/huawei_ssh.py
+++ b/netmiko/huawei/huawei_ssh.py
@@ -115,6 +115,7 @@ def commit(self, comment="", delay_factor=1):
             strip_prompt=False,
             strip_command=False,
             delay_factor=delay_factor,
+            expect_string=r"]",
         )
         output += self.exit_config_mode()
 


Test patch:
Repository: ktbyers/netmiko

Issue:
Raise exception if asa_login() fails to login successfully



Discussion:

Resolving patch:
diff --git a/netmiko/cisco/cisco_asa_ssh.py b/netmiko/cisco/cisco_asa_ssh.py
--- a/netmiko/cisco/cisco_asa_ssh.py
+++ b/netmiko/cisco/cisco_asa_ssh.py
@@ -2,6 +2,7 @@
 import re
 import time
 from netmiko.cisco_base_connection import CiscoSSHConnection, CiscoFileTransfer
+from netmiko.ssh_exception import NetmikoAuthenticationException
 
 
 class CiscoAsaSSH(CiscoSSHConnection):
@@ -88,12 +89,14 @@ def asa_login(self):
 
         twb-dc-fw1> login
         Username: admin
-        Password: ************
+
+        Raises NetmikoAuthenticationException, if we do not reach privilege
+        level 15 after 3 attempts.
         """
         delay_factor = self.select_delay_factor(0)
 
         i = 1
-        max_attempts = 50
+        max_attempts = 3
         self.write_channel("login" + self.RETURN)
         while i <= max_attempts:
             time.sleep(0.5 * delay_factor)
@@ -103,11 +106,14 @@ def asa_login(self):
             elif "ssword" in output:
                 self.write_channel(self.password + self.RETURN)
             elif "#" in output:
-                break
+                return True
             else:
                 self.write_channel("login" + self.RETURN)
             i += 1
 
+        msg = "Unable to get to enable mode!"
+        raise NetmikoAuthenticationException(msg)
+
     def save_config(self, cmd="write mem", confirm=False, confirm_response=""):
         """Saves Config"""
         return super().save_config(


Test patch:
Repository: ktbyers/netmiko

Issue:
SSHDetect - OneAccess device not detected
Hi Kirk,

The [SSHDetect](https://github.com/ktbyers/netmiko/blob/develop/netmiko/ssh_autodetect.py#L309) class is not able to detect OneAccess equipment.
This is due to missing entry in the SSH_MAPPER_DICT dictionnary.

The following entry should make it:
```
"oneaccess_oneos": {
        "cmd": "show version",
        "search_patterns": [r"OneOS"],
        "priority": 99,
        "dispatch": "_autodetect_std",
    },
```

Do you mind if I send a pull request for this ?


Discussion:
@bilalel Sounds good. Yes, send a PR on it.

Resolving patch:
diff --git a/netmiko/ssh_autodetect.py b/netmiko/ssh_autodetect.py
--- a/netmiko/ssh_autodetect.py
+++ b/netmiko/ssh_autodetect.py
@@ -288,6 +288,12 @@
         "priority": 99,
         "dispatch": "_autodetect_std",
     },
+    "oneaccess_oneos": {
+        "cmd": "show version",
+        "search_patterns": [r"OneOS"],
+        "priority": 99,
+        "dispatch": "_autodetect_std",
+    },
 }
 
 # Sort SSH_MAPPER_DICT such that the most common commands are first


Test patch:
Repository: Mailu/Mailu

Issue:
Forward E-mails without storing them in Mailu
I think it would be useful to have a checkbox in E-mail Forward to let the user choose whether to store a copy of them in Mailu or simply forward to another address.


Discussion:
That would be an interesting feature, could be implemented by tweaking the SQL queries when resolving aliases in Postfix.

Resolving patch:
diff --git a/admin/mailu/admin/forms.py b/admin/mailu/admin/forms.py
--- a/admin/mailu/admin/forms.py
+++ b/admin/mailu/admin/forms.py
@@ -77,6 +77,7 @@ class UserPasswordForm(flask_wtf.FlaskForm):
 
 class UserForwardForm(flask_wtf.FlaskForm):
     forward_enabled = fields.BooleanField(_('Enable forwarding'))
+    forward_keep = fields.BooleanField(_('Keep a copy of the emails'))
     forward_destination = fields.StringField(
         _('Destination'), [validators.Optional(), validators.Email()]
     )
diff --git a/admin/mailu/admin/models.py b/admin/mailu/admin/models.py
--- a/admin/mailu/admin/models.py
+++ b/admin/mailu/admin/models.py
@@ -146,6 +146,7 @@ class User(Base, Email):
     # Filters
     forward_enabled = db.Column(db.Boolean(), nullable=False, default=False)
     forward_destination = db.Column(db.String(255), nullable=True, default=None)
+    forward_keep = db.Column(db.Boolean(), nullable=False, default=True)
     reply_enabled = db.Column(db.Boolean(), nullable=False, default=False)
     reply_subject = db.Column(db.String(255), nullable=True, default=None)
     reply_body = db.Column(db.Text(), nullable=True, default=None)
diff --git a/admin/migrations/versions/73e56bad5ec5_.py b/admin/migrations/versions/73e56bad5ec5_.py
new file mode 100644
--- /dev/null
+++ b/admin/migrations/versions/73e56bad5ec5_.py
@@ -0,0 +1,24 @@
+""" Add the ability to keep forwarded messages
+
+Revision ID: 73e56bad5ec5
+Revises: 3f6994568962
+Create Date: 2017-09-03 15:36:07.821002
+
+"""
+
+# revision identifiers, used by Alembic.
+revision = '73e56bad5ec5'
+down_revision = '3f6994568962'
+
+from alembic import op
+import sqlalchemy as sa
+
+
+def upgrade():
+    with op.batch_alter_table('user') as batch:
+        batch.add_column(sa.Column('forward_keep', sa.Boolean(), nullable=False, server_default=sa.sql.expression.true()))
+
+
+def downgrade():
+    with op.batch_alter_table('user') as batch:
+        batch.drop_column('forward_keep')


Test patch:
Repository: Mailu/Mailu

Issue:
Internal Server Error in admin page
Looks like a reference to the auto-forward page was left behind when Settings / Forwarding were merged.  Clicking the link on /ui/user/list page results in an ISE.

Will submit a PR to fix shortly.


Discussion:

Resolving patch:
diff --git a/core/admin/mailu/models.py b/core/admin/mailu/models.py
--- a/core/admin/mailu/models.py
+++ b/core/admin/mailu/models.py
@@ -162,7 +162,7 @@ def sendmail(self, subject, body):
         """
         from_address = '{}@{}'.format(
             app.config['POSTMASTER'], app.config['DOMAIN'])
-        with smtplib.SMTP('smtp', port=10025) as smtp:
+        with smtplib.SMTP(app.config['HOST_AUTHSMTP'], port=10025) as smtp:
             msg = text.MIMEText(body)
             msg['Subject'] = subject
             msg['From'] = from_address


Test patch:
Repository: Mailu/Mailu

Issue:
Vacation: fields start
I have requests from customers who would like to put their vocations in advance. In fact, can we put a start field in vocation ?


Discussion:
Agreed, and it should be straightforward to implement

Resolving patch:
diff --git a/core/admin/mailu/models.py b/core/admin/mailu/models.py
--- a/core/admin/mailu/models.py
+++ b/core/admin/mailu/models.py
@@ -250,6 +250,8 @@ class User(Base, Email):
     reply_enabled = db.Column(db.Boolean(), nullable=False, default=False)
     reply_subject = db.Column(db.String(255), nullable=True, default=None)
     reply_body = db.Column(db.Text(), nullable=True, default=None)
+    reply_startdate = db.Column(db.Date, nullable=False,
+        default=date(1900, 1, 1))
     reply_enddate = db.Column(db.Date, nullable=False,
         default=date(2999, 12, 31))
 
@@ -276,6 +278,15 @@ def destination(self):
         else:
             return self.email
 
+    @property
+    def reply_active(self):
+        now = date.today()
+        return (
+            self.reply_enabled and
+            self.reply_startdate < now and
+            self.reply_enddate > now
+        )
+
     scheme_dict = {'PBKDF2': "pbkdf2_sha512",
                    'BLF-CRYPT': "bcrypt",
                    'SHA512-CRYPT': "sha512_crypt",
diff --git a/core/admin/mailu/ui/forms.py b/core/admin/mailu/ui/forms.py
--- a/core/admin/mailu/ui/forms.py
+++ b/core/admin/mailu/ui/forms.py
@@ -117,6 +117,7 @@ class UserReplyForm(flask_wtf.FlaskForm):
     reply_subject = fields.StringField(_('Reply subject'))
     reply_body = fields.StringField(_('Reply body'),
         widget=widgets.TextArea())
+    reply_startdate = fields.html5.DateField(_('Start of vacation'))
     reply_enddate = fields.html5.DateField(_('End of vacation'))
     submit = fields.SubmitField(_('Update'))
 
diff --git a/core/admin/migrations/versions/3b281286c7bd_.py b/core/admin/migrations/versions/3b281286c7bd_.py
new file mode 100644
--- /dev/null
+++ b/core/admin/migrations/versions/3b281286c7bd_.py
@@ -0,0 +1,24 @@
+""" Add a start day for vacations
+
+Revision ID: 3b281286c7bd
+Revises: 25fd6c7bcb4a
+Create Date: 2018-09-27 22:20:08.158553
+
+"""
+
+revision = '3b281286c7bd'
+down_revision = '25fd6c7bcb4a'
+
+from alembic import op
+import sqlalchemy as sa
+
+
+def upgrade():
+    with op.batch_alter_table('user') as batch:
+        batch.add_column(sa.Column('reply_startdate', sa.Date(), nullable=False,
+            server_default="1900-01-01"))
+
+
+def downgrade():
+    with op.batch_alter_table('user') as batch:
+        batch.drop_column('reply_startdate')


Test patch:
Repository: Mailu/Mailu

Issue:
'User' object has no attribute 'self'
I've been getting the following error recently for emails that are sent to forwarded addresses:

```
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.7/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/app/mailu/internal/views/postfix.py", line 34, in postfix_alias_map
    return flask.jsonify(user_obj.destination)
  File "/app/mailu/models.py", line 274, in destination
    result = self.self.forward_destination
AttributeError: 'User' object has no attribute 'self'
```
Looks like it might be a typo on that line.  I will test a fix shortly and submit a PR if successful.


Discussion:

Resolving patch:
diff --git a/core/admin/mailu/models.py b/core/admin/mailu/models.py
--- a/core/admin/mailu/models.py
+++ b/core/admin/mailu/models.py
@@ -271,7 +271,7 @@ def get_id(self):
     @property
     def destination(self):
         if self.forward_enabled:
-            result = self.self.forward_destination
+            result = self.forward_destination
             if self.forward_keep:
                 result += ',' + self.email
             return result


Test patch:
Repository: Mailu/Mailu

Issue:
signup submit show The response parameter is missing
![image](https://user-images.githubusercontent.com/14049597/44628410-dd0fd100-a971-11e8-9962-002865f4a2d5.png)



Discussion:
This is a bug when not enabling recaptcha.
okay 
i fixed after add recaptcha client id and secret
@ionutfilip. you know how to play with validation in Flask now ;).

Resolving patch:
diff --git a/core/admin/mailu/ui/forms.py b/core/admin/mailu/ui/forms.py
--- a/core/admin/mailu/ui/forms.py
+++ b/core/admin/mailu/ui/forms.py
@@ -90,9 +90,10 @@ class UserSignupForm(flask_wtf.FlaskForm):
     localpart = fields.StringField(_('Email address'), [validators.DataRequired(), validators.Regexp(LOCALPART_REGEX)])
     pw = fields.PasswordField(_('Password'), [validators.DataRequired()])
     pw2 = fields.PasswordField(_('Confirm password'), [validators.EqualTo('pw')])
-    captcha = flask_wtf.RecaptchaField()
     submit = fields.SubmitField(_('Sign up'))
 
+class UserSignupFormCaptcha(UserSignupForm):
+    captcha = flask_wtf.RecaptchaField()
 
 class UserSettingsForm(flask_wtf.FlaskForm):
     displayed_name = fields.StringField(_('Displayed name'))
diff --git a/core/admin/mailu/ui/views/users.py b/core/admin/mailu/ui/views/users.py
--- a/core/admin/mailu/ui/views/users.py
+++ b/core/admin/mailu/ui/views/users.py
@@ -170,7 +170,11 @@ def user_signup(domain_name=None):
             available_domains=available_domains)
     domain = available_domains.get(domain_name) or flask.abort(404)
     quota_bytes = domain.max_quota_bytes or app.config['DEFAULT_QUOTA']
-    form = forms.UserSignupForm()
+    if app.config['RECAPTCHA_PUBLIC_KEY'] == "" or app.config['RECAPTCHA_PRIVATE_KEY'] == "":
+        form = forms.UserSignupForm()
+    else:
+        form = forms.UserSignupFormCaptcha()
+
     if form.validate_on_submit():
         if domain.has_email(form.localpart.data):
             flask.flash('Email is already used', 'error')


Test patch:
Repository: Mailu/Mailu

Issue:
Alternatives useless after podop
After updating to master to get all the up-to-date fixes it also moves postfix to use podop and it seems to no longer support receiving external mail from alternative domains 😢 

Sending internal mail between alternatives works as expected but not with external mail, a "relay denied" message is shown in the logs and when checking the postfix podop views it looks like alternative is never mentioned.


Discussion:

Resolving patch:
diff --git a/core/admin/mailu/internal/views/postfix.py b/core/admin/mailu/internal/views/postfix.py
--- a/core/admin/mailu/internal/views/postfix.py
+++ b/core/admin/mailu/internal/views/postfix.py
@@ -6,7 +6,9 @@
 
 @internal.route("/postfix/domain/<domain_name>")
 def postfix_mailbox_domain(domain_name):
-    domain = models.Domain.query.get(domain_name) or flask.abort(404)
+    domain = models.Domain.query.get(domain_name) or \
+             models.Alternative.query.get(domain_name) or \
+             flask.abort(404)
     return flask.jsonify(domain.name)
 
 


Test patch:
Repository: Mailu/Mailu

Issue:
Increase attachment size limit
Hello, 

How can web change the max file limit of attachment in Roundcube ?

Version 1.5


Discussion:
Currently you can't, you could mount a new ``php.ini`` with a different ``upload_max_filesize`` and ``post_max_size``. Ideally, you would need to generate a dynamic ``php.ini``. The best way to go is probably to create the same kind of ``start.py`` as for other containers and compile a ``php.ini`` that uses the max mail size environment variable.
@ionutfilip 

Resolving patch:
diff --git a/webmails/rainloop/start.py b/webmails/rainloop/start.py
--- a/webmails/rainloop/start.py
+++ b/webmails/rainloop/start.py
@@ -10,6 +10,8 @@
 os.environ["FRONT_ADDRESS"] = os.environ.get("FRONT_ADDRESS", "front")
 os.environ["IMAP_ADDRESS"] = os.environ.get("IMAP_ADDRESS", "imap")
 
+os.environ["MAX_FILESIZE"] = str(int(int(os.environ.get("MESSAGE_SIZE_LIMIT"))*0.66/1048576))
+
 base = "/data/_data_/_default_/"
 shutil.rmtree(base + "domains/", ignore_errors=True)
 os.makedirs(base + "domains", exist_ok=True)
@@ -17,6 +19,7 @@
 
 convert("/default.ini", "/data/_data_/_default_/domains/default.ini")
 convert("/config.ini", "/data/_data_/_default_/configs/config.ini")
+convert("/php.ini", "/usr/local/etc/php/conf.d/rainloop.ini")
 
 os.system("chown -R www-data:www-data /data")
 
diff --git a/webmails/roundcube/start.py b/webmails/roundcube/start.py
--- a/webmails/roundcube/start.py
+++ b/webmails/roundcube/start.py
@@ -1,6 +1,13 @@
 #!/usr/bin/python3
 
 import os
+import jinja2
+
+convert = lambda src, dst: open(dst, "w").write(jinja2.Template(open(src).read()).render(**os.environ))
+
+os.environ["MAX_FILESIZE"] = str(int(int(os.environ.get("MESSAGE_SIZE_LIMIT"))*0.66/1048576))
+
+convert("/php.ini", "/usr/local/etc/php/conf.d/roundcube.ini")
 
 # Fix some permissions
 os.system("mkdir -p /data/gpg")


Test patch: