Bug#813609: cron-apt: XHEADER config option messes up mail headers

2016-06-14 Thread Ola Lundqvist
Hi

I realize now that I only sent to the bug id and not to you?

Thanks! Yes I missed that. Thanks. I'll give credits to you in the debian
changelog. Is it ok if I write the email address there?


// Ola

On Tue, May 17, 2016 at 2:59 PM, Ola Lundqvist  wrote:

> Thanks! Yes I missed that. Thanks. I'll give credits to you in the debian
> changelog. Is it ok if I write the email address there?
>
> / Ola
>
> Sent from a phone
> Den 17 maj 2016 14:24 skrev "Geoff" :
>
>> Hi,
>>
>> The temporary IFS overriding is necessary IMHO, otherwise the test on
>> $VAL non-emptiness might failed/raised an error for header with space, for
>> instance with header like: "X-My-Header: string".
>>
>> To remove IFS overriding completely, we need to quote $VAL i think:
>>
>> 8<-
>> while [ ! -z "$VAL" ] ; do
>> XHEADERS="$XHEADERS -a \"$VAL\""
>> i=$(( $i + 1 ))
>> eval "VAL=\${XHEADER$i}"
>> echo $XHEADERS
>> done
>> >8-
>>
>> I tested the cron-apt functions you sent with the above patch, it looks
>> ok.
>>
>> Le 17/05/2016 12:46, Ola Lundqvist wrote :
>>
>>> Hi again
>>>
>>> I have done some more changes. Can you test with this file?
>>>
>>> // Ola
>>>
>>> On Tue, May 17, 2016 at 10:59 AM, Geoff >> > wrote:
>>>
>>> Hi,
>>>
>>> Le 03/05/2016 23:51, Ola Lundqvist a écrit :
>>>
>>> Hi again
>>>
>>> No sorry, replace the  with nothing or space. That should
>>> do the trick.
>>>
>>>
>>> Replacing "" with nothing is not enough.
>>> Each XHEADER has to be quoted as well.
>>> Mail command with cli options is then eval.
>>>
>>> Here is a quick and not so pretty patch, please review.
>>>
>>> Tested on debian 8.2.
>>>
>>> Cheers,
>>> Geoff
>>>
>>>
>>>
>>>
>>> --
>>>   --- Inguza Technology AB --- MSc in Information Technology 
>>> / o...@inguza.com Folkebogatan
>>> 26\
>>> | o...@debian.org    654 68
>>> KARLSTAD|
>>> | http://inguza.com/Mobile: +46 (0)70-332 1551 |
>>> \  gpg/f.p.: 7090 A92B 18FE 7994 0C36 4FE4 18A1 B1CF 0FE5 3DD9  /
>>>   ---
>>>
>>>


-- 
 --- Inguza Technology AB --- MSc in Information Technology 
/  o...@inguza.comFolkebogatan 26\
|  o...@debian.org   654 68 KARLSTAD|
|  http://inguza.com/Mobile: +46 (0)70-332 1551 |
\  gpg/f.p.: 7090 A92B 18FE 7994 0C36 4FE4 18A1 B1CF 0FE5 3DD9  /
 ---


Bug#813609: cron-apt: XHEADER config option messes up mail headers

2016-05-17 Thread Ola Lundqvist
Thanks! Yes I missed that. Thanks. I'll give credits to you in the debian
changelog. Is it ok if I write the email address there?

/ Ola

Sent from a phone
Den 17 maj 2016 14:24 skrev "Geoff" :

> Hi,
>
> The temporary IFS overriding is necessary IMHO, otherwise the test on $VAL
> non-emptiness might failed/raised an error for header with space, for
> instance with header like: "X-My-Header: string".
>
> To remove IFS overriding completely, we need to quote $VAL i think:
>
> 8<-
> while [ ! -z "$VAL" ] ; do
> XHEADERS="$XHEADERS -a \"$VAL\""
> i=$(( $i + 1 ))
> eval "VAL=\${XHEADER$i}"
> echo $XHEADERS
> done
> >8-
>
> I tested the cron-apt functions you sent with the above patch, it looks ok.
>
> Le 17/05/2016 12:46, Ola Lundqvist wrote :
>
>> Hi again
>>
>> I have done some more changes. Can you test with this file?
>>
>> // Ola
>>
>> On Tue, May 17, 2016 at 10:59 AM, Geoff > > wrote:
>>
>> Hi,
>>
>> Le 03/05/2016 23:51, Ola Lundqvist a écrit :
>>
>> Hi again
>>
>> No sorry, replace the  with nothing or space. That should
>> do the trick.
>>
>>
>> Replacing "" with nothing is not enough.
>> Each XHEADER has to be quoted as well.
>> Mail command with cli options is then eval.
>>
>> Here is a quick and not so pretty patch, please review.
>>
>> Tested on debian 8.2.
>>
>> Cheers,
>> Geoff
>>
>>
>>
>>
>> --
>>   --- Inguza Technology AB --- MSc in Information Technology 
>> / o...@inguza.com Folkebogatan
>> 26\
>> | o...@debian.org    654 68
>> KARLSTAD|
>> | http://inguza.com/Mobile: +46 (0)70-332 1551 |
>> \  gpg/f.p.: 7090 A92B 18FE 7994 0C36 4FE4 18A1 B1CF 0FE5 3DD9  /
>>   ---
>>
>>


Bug#813609: cron-apt: XHEADER config option messes up mail headers

2016-05-17 Thread Geoff

Hi,

The temporary IFS overriding is necessary IMHO, otherwise the test on 
$VAL non-emptiness might failed/raised an error for header with space, 
for instance with header like: "X-My-Header: string".


To remove IFS overriding completely, we need to quote $VAL i think:

8<-
while [ ! -z "$VAL" ] ; do
XHEADERS="$XHEADERS -a \"$VAL\""
i=$(( $i + 1 ))
eval "VAL=\${XHEADER$i}"
echo $XHEADERS
done
>8-

I tested the cron-apt functions you sent with the above patch, it looks ok.

Le 17/05/2016 12:46, Ola Lundqvist wrote :

Hi again

I have done some more changes. Can you test with this file?

// Ola

On Tue, May 17, 2016 at 10:59 AM, Geoff > wrote:

Hi,

Le 03/05/2016 23:51, Ola Lundqvist a écrit :

Hi again

No sorry, replace the  with nothing or space. That should
do the trick.


Replacing "" with nothing is not enough.
Each XHEADER has to be quoted as well.
Mail command with cli options is then eval.

Here is a quick and not so pretty patch, please review.

Tested on debian 8.2.

Cheers,
Geoff




--
  --- Inguza Technology AB --- MSc in Information Technology 
/ o...@inguza.com Folkebogatan
26\
| o...@debian.org    654 68
KARLSTAD|
| http://inguza.com/Mobile: +46 (0)70-332 1551 |
\  gpg/f.p.: 7090 A92B 18FE 7994 0C36 4FE4 18A1 B1CF 0FE5 3DD9  /
  ---





Bug#813609: cron-apt: XHEADER config option messes up mail headers

2016-05-17 Thread Ola Lundqvist
Hi again

I have done some more changes. Can you test with this file?

// Ola

On Tue, May 17, 2016 at 10:59 AM, Geoff  wrote:

> Hi,
>
> Le 03/05/2016 23:51, Ola Lundqvist a écrit :
>
>> Hi again
>>
>> No sorry, replace the  with nothing or space. That should do the
>> trick.
>>
>
> Replacing "" with nothing is not enough.
> Each XHEADER has to be quoted as well.
> Mail command with cli options is then eval.
>
> Here is a quick and not so pretty patch, please review.
>
> Tested on debian 8.2.
>
> Cheers,
> Geoff
>



-- 
 --- Inguza Technology AB --- MSc in Information Technology 
/  o...@inguza.comFolkebogatan 26\
|  o...@debian.org   654 68 KARLSTAD|
|  http://inguza.com/Mobile: +46 (0)70-332 1551 |
\  gpg/f.p.: 7090 A92B 18FE 7994 0C36 4FE4 18A1 B1CF 0FE5 3DD9  /
 ---


functions
Description: Binary data


Bug#813609: cron-apt: XHEADER config option messes up mail headers

2016-05-17 Thread Ola Lundqvist
Hi Geoff

Thanks a lot! Yes this should solve the problem. I'll apply it soon.

// Ola

On Tue, May 17, 2016 at 10:59 AM, Geoff  wrote:

> Hi,
>
> Le 03/05/2016 23:51, Ola Lundqvist a écrit :
>
>> Hi again
>>
>> No sorry, replace the  with nothing or space. That should do the
>> trick.
>>
>
> Replacing "" with nothing is not enough.
> Each XHEADER has to be quoted as well.
> Mail command with cli options is then eval.
>
> Here is a quick and not so pretty patch, please review.
>
> Tested on debian 8.2.
>
> Cheers,
> Geoff
>



-- 
 --- Inguza Technology AB --- MSc in Information Technology 
/  o...@inguza.comFolkebogatan 26\
|  o...@debian.org   654 68 KARLSTAD|
|  http://inguza.com/Mobile: +46 (0)70-332 1551 |
\  gpg/f.p.: 7090 A92B 18FE 7994 0C36 4FE4 18A1 B1CF 0FE5 3DD9  /
 ---


Bug#813609: cron-apt: XHEADER config option messes up mail headers

2016-05-17 Thread Geoff

Hi,

Le 03/05/2016 23:51, Ola Lundqvist a écrit :

Hi again

No sorry, replace the  with nothing or space. That should do the trick.


Replacing "" with nothing is not enough.
Each XHEADER has to be quoted as well.
Mail command with cli options is then eval.

Here is a quick and not so pretty patch, please review.

Tested on debian 8.2.

Cheers,
Geoff
106,107c106,107
< 	IFS=`printf '\t'`
< i=1
---
> 	IFS=$(printf '\t')
> 	i=1
110,112c110,112
< 		XHEADERS="$XHEADERS   -a $VAL"
< 		i=$(( $i + 1 ))
< 		eval "VAL=\${XHEADER$i}"
---
> 			XHEADERS="$XHEADERS -a \"$VAL\""
> 			i=$(( $i + 1 ))
> 			eval "VAL=\${XHEADER$i}"
114,115d113
< 	#
< mail $XHEADERS -s "$SUBJECT" "$MAILTO" < "$MAIL"
116a115,116
> 	#
> 	eval mail $XHEADERS -s \"$SUBJECT\" \"$MAILTO\" < "$MAIL"


Bug#813609: cron-apt: XHEADER config option messes up mail headers

2016-05-03 Thread Ola Lundqvist
Hi again

No sorry, replace the  with nothing or space. That should do the trick.

// Ola

On Tue, May 3, 2016 at 11:45 PM, Ola Lundqvist  wrote:

> Hi
>
> Sorry for a long delay with the reply. I just saw this but report among a
> long list of auto-filed bug reports.
>
> I have no memory of adding this support myself and when looking through
> the code and your result I fully understand why it becomes like this. The
> code should most probably not have a  there but a \t string.
>
> Please make a try to change the "functions" file and change the two
> occurances of  with \t instead.
>
> Does it work then for you?
>
> Cheers
>
> // Ola
>
>
> On Wed, Feb 3, 2016 at 6:01 PM, Geoff  wrote:
>
>> Package: cron-apt
>> Version: 0.9.2
>> Severity: normal
>>
>> Dear Maintainer,
>>
>>* What led up to the situation?
>>Add the header option in the config file:
>>   XHEADER1="X-MYHDR-security: cron-apt"
>>
>>* What was the outcome of this action?
>>The mail header "To" ended up wrong:
>>
>>To: ,
>><"X-MYHDR-security:cron-apt"@host.example.org>
>>
>> Here is my config:
>> 8<---
>> # WARNING: Ansible managed conf file
>>
>> MAILON="upgrade"
>> RUNSLEEP=1200
>> ACTIONDIR="/etc/cron-apt/security.action.d"
>> XHEADER1="X-MYHDR-security: cron-apt"
>> 8<---
>>
>> Thanks for your work on cron-apt :)
>> Cheers
>>
>
>
>
> --
>  --- Inguza Technology AB --- MSc in Information Technology 
> /  o...@inguza.comAnnebergsslingan 37\
> |  o...@debian.org   654 65 KARLSTAD|
> |  http://inguza.com/Mobile: +46 (0)70-332 1551 |
> \  gpg/f.p.: 7090 A92B 18FE 7994 0C36 4FE4 18A1 B1CF 0FE5 3DD9  /
>  ---
>
>


-- 
 --- Inguza Technology AB --- MSc in Information Technology 
/  o...@inguza.comFolkebogatan 26\
|  o...@debian.org   654 68 KARLSTAD|
|  http://inguza.com/Mobile: +46 (0)70-332 1551 |
\  gpg/f.p.: 7090 A92B 18FE 7994 0C36 4FE4 18A1 B1CF 0FE5 3DD9  /
 ---


Bug#813609: cron-apt: XHEADER config option messes up mail headers

2016-05-03 Thread Ola Lundqvist
Hi

Sorry for a long delay with the reply. I just saw this but report among a
long list of auto-filed bug reports.

I have no memory of adding this support myself and when looking through the
code and your result I fully understand why it becomes like this. The code
should most probably not have a  there but a \t string.

Please make a try to change the "functions" file and change the two
occurances of  with \t instead.

Does it work then for you?

Cheers

// Ola


On Wed, Feb 3, 2016 at 6:01 PM, Geoff  wrote:

> Package: cron-apt
> Version: 0.9.2
> Severity: normal
>
> Dear Maintainer,
>
>* What led up to the situation?
>Add the header option in the config file:
>   XHEADER1="X-MYHDR-security: cron-apt"
>
>* What was the outcome of this action?
>The mail header "To" ended up wrong:
>
>To: ,
><"X-MYHDR-security:cron-apt"@host.example.org>
>
> Here is my config:
> 8<---
> # WARNING: Ansible managed conf file
>
> MAILON="upgrade"
> RUNSLEEP=1200
> ACTIONDIR="/etc/cron-apt/security.action.d"
> XHEADER1="X-MYHDR-security: cron-apt"
> 8<---
>
> Thanks for your work on cron-apt :)
> Cheers
>



-- 
 --- Inguza Technology AB --- MSc in Information Technology 
/  o...@inguza.comAnnebergsslingan 37\
|  o...@debian.org   654 65 KARLSTAD|
|  http://inguza.com/Mobile: +46 (0)70-332 1551 |
\  gpg/f.p.: 7090 A92B 18FE 7994 0C36 4FE4 18A1 B1CF 0FE5 3DD9  /
 ---


Bug#813609: cron-apt: XHEADER config option messes up mail headers

2016-02-03 Thread Geoff
Package: cron-apt
Version: 0.9.2
Severity: normal

Dear Maintainer,

   * What led up to the situation?
   Add the header option in the config file:
  XHEADER1="X-MYHDR-security: cron-apt"

   * What was the outcome of this action?
   The mail header "To" ended up wrong:

   To: ,
   <"X-MYHDR-security:cron-apt"@host.example.org>

Here is my config:
8<---
# WARNING: Ansible managed conf file

MAILON="upgrade"
RUNSLEEP=1200
ACTIONDIR="/etc/cron-apt/security.action.d"
XHEADER1="X-MYHDR-security: cron-apt"
8<---

Thanks for your work on cron-apt :)
Cheers