Syntax error in main.cf

2012-05-12 Thread gabrieltala
Hi all,

Im having a strange issue on a new postfix setup, when I run the command 
"postfix check" I receive the following error:

postfix: fatal: /etc/postfix/main.cf, line 30: missing '=' after attribute 
name: "This file lists only a subset"

However, when I check that line, all seems to be in order: 

queue_directory = /var/spool/postfix

Can somebody give me a hand in this?

Thanks in advance!
Enviado desde mi BlackBerry® de Claro Paraguay.

Re: Syntax error in main.cf

2012-05-12 Thread Reindl Harald


Am 13.05.2012 00:17, schrieb gabrielt...@gmail.com:
> Im having a strange issue on a new postfix setup, when I run the command 
> "postfix check" I receive the following error:
> 
> postfix: fatal: /etc/postfix/main.cf, line 30: missing '=' after attribute 
> name: "This file lists only a subset"
> 
> However, when I check that line, all seems to be in order: 
> 
> queue_directory = /var/spool/postfix
> Can somebody give me a hand in this?

not at least with seeing your whole file
nobody knows what is around your line 30



signature.asc
Description: OpenPGP digital signature


Re: Syntax error in main.cf

2012-05-12 Thread Peter
On 13/05/12 10:17, gabrielt...@gmail.com wrote:
> postfix: fatal: /etc/postfix/main.cf, line 30: missing '=' after
> attribute name: "This file lists only a subset"

WAG: Looks like you're missing a hash mark (#) at the beginning of the
line to denote a comment.

> queue_directory = /var/spool/postfix

That's not the line it's talking about.


Peter


Re: Syntax error in main.cf

2012-05-12 Thread gabrieltala
This is strange, when I go to the line that the error is refering (with nano 
+30 /etc/postfix/main.cf) the editor opens right in the queue_directory line, 
so I put a # in that line for testing and run postfix check again, and I then 
receive an error in the command_directory line, which is also with the default 
setting 
Enviado desde mi BlackBerry® de Claro Paraguay.

-Original Message-
From: Peter 
Sender: owner-postfix-us...@postfix.org
Date: Sun, 13 May 2012 11:37:31 
To: 
Subject: Re: Syntax error in main.cf

On 13/05/12 10:17, gabrielt...@gmail.com wrote:
> postfix: fatal: /etc/postfix/main.cf, line 30: missing '=' after
> attribute name: "This file lists only a subset"

WAG: Looks like you're missing a hash mark (#) at the beginning of the
line to denote a comment.

> queue_directory = /var/spool/postfix

That's not the line it's talking about.


Peter


Re: Syntax error in main.cf

2012-05-12 Thread Eliezer Croitoru

On 13/05/2012 04:59, gabrielt...@gmail.com wrote:

This is strange, when I go to the line that the error is refering (with nano 
+30 /etc/postfix/main.cf) the editor opens right in the queue_directory line, 
so I put a # in that line for testing and run postfix check again, and I then 
receive an error in the command_directory line, which is also with the default 
setting
Enviado desde mi BlackBerry® de Claro Paraguay.

just open the file with vi and run in the vi commands
:set list
it will show you end of the line characters which will make more sense 
of this message.


Eliezer


-Original Message-
From: Peter
Sender: owner-postfix-us...@postfix.org
Date: Sun, 13 May 2012 11:37:31
To:
Subject: Re: Syntax error in main.cf

On 13/05/12 10:17, gabrielt...@gmail.com wrote:

postfix: fatal: /etc/postfix/main.cf, line 30: missing '=' after
attribute name: "This file lists only a subset"


WAG: Looks like you're missing a hash mark (#) at the beginning of the
line to denote a comment.


queue_directory = /var/spool/postfix


That's not the line it's talking about.


Peter



--
Eliezer Croitoru
https://www1.ngtech.co.il
IT consulting for Nonprofit organizations
eliezer  ngtech.co.il


Re: Syntax error in main.cf

2012-05-12 Thread Peter
Please don't top post, it's annoying.

On 13/05/12 13:59, gabrielt...@gmail.com wrote:
> From: Peter 
> Date: Sun, 13 May 2012 11:37:31 
> 
> On 13/05/12 10:17, gabrielt...@gmail.com wrote:
>> postfix: fatal: /etc/postfix/main.cf, line 30: missing '=' after
>> attribute name: "This file lists only a subset"
> 
> WAG: Looks like you're missing a hash mark (#) at the beginning of the
> line to denote a comment.
> 
>> queue_directory = /var/spool/postfix
> 
> That's not the line it's talking about.

> This is strange, when I go to the line that the error is refering
> (with nano +30 /etc/postfix/main.cf) the editor opens right in the
> queue_directory line, so I put a # in that line for testing and run
> postfix check again, and I then receive an error in the
> command_directory line, which is also with the default setting

You're not paying attention to what I said.  Look for the line with the
text, "This file lists only a subset".  Your error message specifically
references that text as being the problem.


Peter


Re: Syntax error in main.cf

2012-05-13 Thread Ralf Hildebrandt
* gabrielt...@gmail.com :
> Hi all,
> 
> Im having a strange issue on a new postfix setup, when I run the command 
> "postfix check" I receive the following error:
> 
> postfix: fatal: /etc/postfix/main.cf, line 30: missing '=' after attribute 
> name: "This file lists only a subset"

Line 30 seems to contain "This file lists only a subset"

-- 
Ralf Hildebrandt
  Geschäftsbereich IT | Abteilung Netzwerk
  Charité - Universitätsmedizin Berlin
  Campus Benjamin Franklin
  Hindenburgdamm 30 | D-12203 Berlin
  Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962
  ralf.hildebra...@charite.de | http://www.charite.de



Re: Syntax error in main.cf

2012-05-13 Thread gabrieltala
Hi all,
Indeed the error was in the line with the text "This file lists only a 
subset..", but I find that text in the line 4,  really far away from the line 
stated in the error message, after commenting that line I ran postfix check 
again succesfully.
Thanks alot for the help provided!
Enviado desde mi BlackBerry® de Claro Paraguay.

-Original Message-
From: Ralf Hildebrandt 
Sender: owner-postfix-us...@postfix.org
Date: Sun, 13 May 2012 13:18:50 
To: 
Reply-To: postfix-users@postfix.org
Subject: Re: Syntax error in main.cf

* gabrielt...@gmail.com :
> Hi all,
> 
> Im having a strange issue on a new postfix setup, when I run the command 
> "postfix check" I receive the following error:
> 
> postfix: fatal: /etc/postfix/main.cf, line 30: missing '=' after attribute 
> name: "This file lists only a subset"

Line 30 seems to contain "This file lists only a subset"

-- 
Ralf Hildebrandt
  Geschäftsbereich IT | Abteilung Netzwerk
  Charité - Universitätsmedizin Berlin
  Campus Benjamin Franklin
  Hindenburgdamm 30 | D-12203 Berlin
  Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962
  ralf.hildebra...@charite.de | http://www.charite.de



Re: Syntax error in main.cf

2012-05-13 Thread Jerry
On Sat, 12 May 2012 22:17:31 +
gabrielt...@gmail.com articulated:

>Im having a strange issue on a new postfix setup, when I run the
>command "postfix check" I receive the following error:
>
>postfix: fatal: /etc/postfix/main.cf, line 30: missing '=' after
>attribute name: "This file lists only a subset"
>
>However, when I check that line, all seems to be in order: 
>
>queue_directory = /var/spool/postfix

Please follow the directions posted at:

for reporting problems to this list. Specifically, the complete,
unaltered, output of: "postconf -n". If you have Postfix => 9.x, then
you can use "postconf -nf" to get a better display.

-- 
Jerry ✌
postfix-u...@seibercom.net
_
TO REPORT A PROBLEM see http://www.postfix.org/DEBUG_README.html#mail
TO (UN)SUBSCRIBE see http://www.postfix.org/lists.html


Re: Syntax error in main.cf

2012-05-13 Thread Reindl Harald


Am 13.05.2012 13:45, schrieb Jerry:
> On Sat, 12 May 2012 22:17:31 +
> gabrielt...@gmail.com articulated:
> 
>> Im having a strange issue on a new postfix setup, when I run the
>> command "postfix check" I receive the following error:
>>
>> postfix: fatal: /etc/postfix/main.cf, line 30: missing '=' after
>> attribute name: "This file lists only a subset"
>>
>> However, when I check that line, all seems to be in order: 
>>
>> queue_directory = /var/spool/postfix
> 
> Please follow the directions posted at:
> 
> for reporting problems to this list. Specifically, the complete,
> unaltered, output of: "postconf -n". If you have Postfix => 9.x, then
> you can use "postconf -nf" to get a better display.

this would NOT have been helpful in this case!
read the tread until it's end, read again the original post

the only thing you can post in such a case is the "main.cf"

general rules are not the solution for each case, really



signature.asc
Description: OpenPGP digital signature


Re: Syntax error in main.cf

2012-05-13 Thread Wietse Venema
Ralf Hildebrandt:
> * gabrielt...@gmail.com :
> > Hi all,
> > 
> > Im having a strange issue on a new postfix setup, when I run the command 
> > "postfix check" I receive the following error:
> > 
> > postfix: fatal: /etc/postfix/main.cf, line 30: missing '=' after attribute 
> > name: "This file lists only a subset"
> 
> Line 30 seems to contain "This file lists only a subset"

This is an easy-to-fix mis-feature in the way line numbers are
reported in error messages.

postconf reports the last line number of multi-line text, for
example:

% cat -n /tmp/main.cf
 1  some random free text
 2other free text
 3  name = value

% postconf -c /tmp
postconf: fatal: /tmp/main.cf, line 2: missing '=' after attribute
name: "some random free text  other free text"

The fix is easy: report both the first and last line number.

% postconf -c /tmp
postconf: fatal: /tmp/main.cf, line 1:2: missing '=' after
attribute name: "some random free text"

The error message is similar with commented text between bad and
good text:

% cat -n /tmp/main.cf
 1  some random free text
 2  # some commented-out text
 3  name = value

% postconf -c /tmp
postconf: fatal: /tmp/main.cf, line 2: missing '=' after attribute
name: "some random free text"

To reproduce the original problem (postconf reports a line number for
an apparently "good" parameter setting) I have to indent the "good"
setting.

% cat -n /tmp/main.cf
 1  some random text
 2  # some comment text
 3  name = value

% postconf -c /tmp
postconf: fatal: /tmp/main.cf, line 3: missing '=' after attribute

With the fix to show the first AND last line number in the error
message, this would be:

% bin/postconf -c /tmp
bin/postconf: fatal: /tmp/main.cf, line 1:3: missing '=' after
attribute name: "some random textname = value"

This points out where the problem begins (line 1) and also helps
the user figure out that line 3 is not what they intended.

Wietse


PATCH: Syntax error in main.cf

2012-05-13 Thread Wietse Venema
Wietse Venema:
> postconf reports the last line number of multi-line text, for
> example:
> 
> % cat -n /tmp/main.cf
>1  some random free text
>2other free text
>3  name = value
> 
> % postconf -c /tmp
> postconf: fatal: /tmp/main.cf, line 2: missing '=' after attribute
> name: "some random free text  other free text"
> 
> The fix is easy: report both the first and last line number.
> 
> % postconf -c /tmp
> postconf: fatal: /tmp/main.cf, line 1:2: missing '=' after
> attribute name: "some random free text"

See the patch below.

Wietse

20120513

Cleanup: report "first:last" line number for syntax errors
in main.cf-like files, instead of reporting the last line
number only. File: util.dict.c.

*** /var/tmp/postfix-2.10-20120426/src/util/dict.c  Tue Jan 24 19:41:08 2012
--- src/util/dict.c Sun May 13 10:07:44 2012
***
*** 424,429 
--- 424,430 
  VSTRING *buf;
  char   *member;
  char   *val;
+ int old_lineno;
  int lineno;
  const char *err;
  struct stat st;
***
*** 434,447 
   */
  DICT_FIND_FOR_UPDATE(dict, dict_name);
  buf = vstring_alloc(100);
! lineno = 0;
  
  if (fstat(vstream_fileno(fp), &st) < 0)
msg_fatal("fstat %s: %m", VSTREAM_PATH(fp));
! while (readlline(buf, fp, &lineno)) {
if ((err = split_nameval(STR(buf), &member, &val)) != 0)
!   msg_fatal("%s, line %d: %s: \"%s\"",
! VSTREAM_PATH(fp), lineno, err, STR(buf));
if (msg_verbose > 1)
msg_info("%s: %s = %s", myname, member, val);
if (dict->update(dict, member, val) != 0)
--- 435,448 
   */
  DICT_FIND_FOR_UPDATE(dict, dict_name);
  buf = vstring_alloc(100);
! old_lineno = lineno = 0;
  
  if (fstat(vstream_fileno(fp), &st) < 0)
msg_fatal("fstat %s: %m", VSTREAM_PATH(fp));
! for (/* void */; readlline(buf, fp, &lineno); old_lineno = lineno) {
if ((err = split_nameval(STR(buf), &member, &val)) != 0)
!   msg_fatal("%s, line %d:%d: %s: \"%s\"",
! VSTREAM_PATH(fp), old_lineno + 1, lineno, err, STR(buf));
if (msg_verbose > 1)
msg_info("%s: %s = %s", myname, member, val);
if (dict->update(dict, member, val) != 0)


Re: PATCH: Syntax error in main.cf

2012-05-14 Thread Phill Macey
On 14/05/2012 5:29 AM, "Wietse Venema"  wrote:
>
> >
> > The fix is easy: report both the first and last line number.
> >
> > % postconf -c /tmp
> > postconf: fatal: /tmp/main.cf, line 1:2: missing '=' after
> > attribute name: "some random free text"
>

Dunno about everyone else but when I see 'line 1:2' I tend to think  line 1
character 2. Why not use 'line 1-2' to specify a range instead?

Just throwing the thought out there. Thanks Wietse for a great piece of
software.

Phill Macey


Re: PATCH: Syntax error in main.cf

2012-05-14 Thread Wietse Venema
Phill Macey:
[ Charset UTF-8 unsupported, converting... ]
> On 14/05/2012 5:29 AM, "Wietse Venema"  wrote:
> >
> > >
> > > The fix is easy: report both the first and last line number.
> > >
> > > % postconf -c /tmp
> > > postconf: fatal: /tmp/main.cf, line 1:2: missing '=' after
> > > attribute name: "some random free text"
> >
> 
> Dunno about everyone else but when I see 'line 1:2' I tend to think  line 1
> character 2. Why not use 'line 1-2' to specify a range instead?

The patch as posted is suitable for a stable release. The "nice"
solution requires a proper line number formatting primitive, to
represent the most common case as a single number.

Wietse


Re: PATCH: Syntax error in main.cf

2012-05-14 Thread Viktor Dukhovni
On Mon, May 14, 2012 at 11:16:27PM +1000, Phill Macey wrote:

> On 14/05/2012 5:29 AM, "Wietse Venema"  wrote:
> >
> > >
> > > The fix is easy: report both the first and last line number.
> > >
> > > % postconf -c /tmp
> > > postconf: fatal: /tmp/main.cf, line 1:2: missing '=' after
> > > attribute name: "some random free text"
> >
> 
> Dunno about everyone else but when I see 'line 1:2' I tend to think  line 1
> character 2. Why not use 'line 1-2' to specify a range instead?

How about a utf-8 ndash? :-) (Or for the TeXperts: "--")

The code for the snapshot release will probably use the plural
"lines" rather than the singular "line", when there is more than
one line involved, and will likely omit the second number when
there is only one line. At that point the choice of ":" vs. "-" vs.
"--" will be unimportant.

-- 
Viktor.

[ On Terrence Tao's blog post outlining his recent proof that "every
odd number larger than 1 is the sum of at most five primes" an
anonymous troll decided to post a comment to the effect that the
statement is ambiguous (or wrong) and say

41 = 2 + 3 + 5 + 7 + 11 + 13

is the sum of six primes. One can willfully overload almost any
natural language statement. In practice, the text just needs to be
sufficiently clear to the intended audience. ]

https://terrytao.wordpress.com/2012/02/01/every-odd-integer-larger-than-1-is-the-sum-of-at-most-five-primes/#comment-125910