Re: json_parse_number broken by compiler optimization

2021-04-01 Thread Josef 'Jeff' Sipek
On Wed, Mar 31, 2021 at 11:26:14 -0400, Josef 'Jeff' Sipek wrote:
> On Wed, Mar 31, 2021 at 09:07:28 +0200, Christian Ehrhardt wrote:
> > On Wed, Mar 31, 2021 at 8:46 AM Christian Ehrhardt 
> >  wrote:
> > > On Tue, Mar 30, 2021 at 9:21 PM Josef 'Jeff' Sipek 
> > >  wrote:
> ...
> > > > The culprit seems to be LTO.  If you disable LTO, everything should work
> > > > just fine.
> > >
> > > I've had LTO disabled and it has still shown the same effect (with my
> > > gcc 10.2.0-1).
> > > I'll give it a non-LTO retry and double check if it really changed the
> > > compile options accordingly.
> > > I'll let you know about that later on.
> > 
> > Indeed, I wonder what I tried yesterday in regard to LTO then .. :-/
> > I can confirm that disabling LTO fixes the issue for me as well and
> > for now that should be a good mitigation until the root cause is found
> > and fixed.
> 
> Sounds good.  Thanks for the confirmation.

Does the following patch make the tests pass for you?  We still need to
clean it up a bit, but I figured I'd share the work-in-progress version to
make sure we're seeing the same issues as you.  (And the obvious disclaimer:
this patch hasn't gone through the usual before-commit scrutiny, so don't
ship it.)

Thanks,

Jeff.

diff --git a/src/anvil/anvil-settings.c b/src/anvil/anvil-settings.c
--- a/src/anvil/anvil-settings.c
+++ b/src/anvil/anvil-settings.c
@@ -16,8 +16,8 @@ static struct file_listener_settings *an
_unix_listeners_array[0],
_unix_listeners_array[1]
 };
-static buffer_t anvil_unix_listeners_buf = {
-   anvil_unix_listeners, sizeof(anvil_unix_listeners), { NULL, }
+static union static_buffer anvil_unix_listeners_buf = {
+   .buf = { anvil_unix_listeners, sizeof(anvil_unix_listeners) }
 };
 /*  */
 
@@ -41,7 +41,7 @@ struct service_settings anvil_service_se
.idle_kill = UINT_MAX,
.vsz_limit = UOFF_T_MAX,
 
-   .unix_listeners = { { _unix_listeners_buf,
+   .unix_listeners = { { _unix_listeners_buf.buf,
  sizeof(anvil_unix_listeners[0]) } },
.fifo_listeners = ARRAY_INIT,
.inet_listeners = ARRAY_INIT,
diff --git a/src/auth/auth-master-connection.c 
b/src/auth/auth-master-connection.c
--- a/src/auth/auth-master-connection.c
+++ b/src/auth/auth-master-connection.c
@@ -108,7 +108,7 @@ master_input_request(struct auth_master_
const char *const *list, *const *params;
unsigned int id, client_pid, client_id;
uint8_t cookie[MASTER_AUTH_COOKIE_SIZE];
-   buffer_t buf;
+   union static_buffer buf;
 
/* [] */
list = t_strsplit_tabescaped(args);
@@ -121,7 +121,7 @@ master_input_request(struct auth_master_
}
 
buffer_create_from_data(, cookie, sizeof(cookie));
-   if (hex_to_binary(list[3], ) < 0) {
+   if (hex_to_binary(list[3], ) < 0) {
e_error(conn->event, "BUG: Master sent broken REQUEST cookie");
return FALSE;
}
diff --git a/src/auth/auth-settings.c b/src/auth/auth-settings.c
--- a/src/auth/auth-settings.c
+++ b/src/auth/auth-settings.c
@@ -32,8 +32,8 @@ static struct file_listener_settings *au
_unix_listeners_array[4],
_unix_listeners_array[5]
 };
-static buffer_t auth_unix_listeners_buf = {
-   auth_unix_listeners, sizeof(auth_unix_listeners), { NULL, }
+static union static_buffer auth_unix_listeners_buf = {
+   .buf = { auth_unix_listeners, sizeof(auth_unix_listeners) }
 };
 /*  */
 
@@ -57,7 +57,7 @@ struct service_settings auth_service_set
.idle_kill = 0,
.vsz_limit = UOFF_T_MAX,
 
-   .unix_listeners = { { _unix_listeners_buf,
+   .unix_listeners = { { _unix_listeners_buf.buf,
  sizeof(auth_unix_listeners[0]) } },
.fifo_listeners = ARRAY_INIT,
.inet_listeners = ARRAY_INIT,
@@ -72,8 +72,8 @@ static struct file_listener_settings aut
 static struct file_listener_settings *auth_worker_unix_listeners[] = {
_worker_unix_listeners_array[0]
 };
-static buffer_t auth_worker_unix_listeners_buf = {
-   auth_worker_unix_listeners, sizeof(auth_worker_unix_listeners), { NULL, 
}
+static union static_buffer auth_worker_unix_listeners_buf = {
+   .buf = { auth_worker_unix_listeners, sizeof(auth_worker_unix_listeners) 
}
 };
 /*  */
 
@@ -97,7 +97,7 @@ struct service_settings auth_worker_serv
.idle_kill = 0,
.vsz_limit = UOFF_T_MAX,
 
-   .unix_listeners = { { _worker_unix_listeners_buf,
+   .unix_listeners = { { _worker_unix_listeners_buf.buf,
  sizeof(auth_worker_unix_listeners[0]) } },
.fifo_listeners = ARRAY_INIT,
.inet_listeners = ARRAY_INIT
diff --git a/src/auth/mech-digest-md5.c b/src/auth/mech-digest-md5.c
--- a/src/auth/mech-digest-md5.c
+++ b/src/auth/mech-digest-md5.c
@@ -25,7 +25,7 @@ static const char *qop_names[] = { "auth
 static string_t *get_digest_challenge(struct digest_auth_request *request)
 {

Re: Re: nginx configuration to pass x-originating-ip

2021-04-01 Thread Henry
Hello,

Does anyone has a solution about it?
Thanks


Re: Mass Stripping Attachments by Directory, Age, Size

2021-04-01 Thread justina colmena ~biz
Well ain't that rich? To use an allegory of sorts, we're going to have start 
using staples rather than paperclips ️  with our email attachments, and one 
unified digital signature on the whole message as sent rather than a separate 
signature for each enclosure as commonly "done" with PGP, GnuPG, etc.

On March 30, 2021 7:39:02 PM AKDT, Plutocrat  wrote:
>Still can't find the magic solution to this.
>
>- My PERL isn't good enough to re-purpose strip-attachments.pl so it
>works on individual emails.
>- ripmime works to extract attachments only
>- altermime looked good and would delete all attachments from a
>directory of emails. However it messed up the structure somehow so they
>wouldn't display in an email client (Thunderbird, Roundcube).
>- mimeDEFANG looked possible, but couldn't figure out how to use that
>as a standalone script.
>- PHP solutions including the promising
>https://github.com/php-mime-mail-parser/php-mime-mail-parser seem only
>to be able to save attachments from the email, not delete it.
>
>I'll keep going I guess. I can't believe I'm the only person in the
>world to want to do this though ...
>
>P.
>
>On 19/03/2021 07.31, Joseph Tam wrote:
>> On Thu, 18 Mar 2021, Plutocrat wrote:
>> 
>>> I've been looking around for a solution to this problem. I want to
>prune down the attachments on a server before a migration. Some of the
>emails are 7 years old and have 40Mb attachments, so this seems like a
>good opportunity to rationalize things. So perhaps I'd like to "Remove
>all attachments from emails older than 2 years, in the .Sent
>directory", or "Attachments over 10Mb anywhere in the mail tree"
>>>
>>> I've found the strip_attachments.pl script here
>
>which works fine on mbox (as tested on my local Thunderbird mboxes),
>but not on maildir which is on the dovecot server. My Perl isn't strong
>enough to re-purpose it.
>> 
>> It you have anything that works on mbox, it will probably work on
>Maildir
>> as each file can be considered a single message mbox.  You can
>combine
>> the script with
>> 
>>  find ~user/MailDir -type f ... -exec /path/to/mbox-strip {} \;
>> 
>> The ... can be replaced with more file tests (like minimum size or
>age
>> or only within */cur/) to cut down on processing.
>> 
>> I wrote a gawk script to slim down a multi-Gb Outlook mbox
>> for a user, but it wasn't really complicated, just matching for
>> /^Content-Transfer-Encoding:.*base64/i header (virtually all bulky
>data
>> will be encoded this way), buffering the base64 data part, then
>outputting
>> it if it was small, or deleting/replacing/extracting it otherwise.
>> 
>> It was a one-off discarded tool but I can hunt for it if you're hard
>up.
>> 
>>> I've looked at ripmime and mpack/munpack, and although they seem
>like useful tools to do the job of deconstructing the mail into its
>constituent parts, it doesn't seem to help in re-building the email. I
>think they could be used with a bit of study into mail MIME structure,
>and used with a helper script.
>>>
>>> So before I take a deep dive into scripting my own solution, I just
>wanted to check if anyone else on the list has been through this and
>has some resources or pointers they can share, or maybe even someone to
>tell me "Duh, you can do it with doveadm of course".
>> 
>> MIMEDefang may help.
>> 
>> Joseph Tam 

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.