LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-23-2021, 06:12 AM   #1
mike1950r
LQ Newbie
 
Registered: Oct 2021
Posts: 27

Rep: Reputation: Disabled
procmail: Skipped "{" and procmail: Closing brace unexpected


Hi,

I'm knew in the forum.
Hello to everybody.

I have two messages in procmail.log, which i don't find the reason for:

procmail: Skipped "{"
procmail: Closing brace unexpected

I just know it comes from a rule in procmailrc.
The rule is to forward email to two addresses with different, changed subjects. The rule is working fine, like it should.

:0 c
* (^TO_|for.*)myaddress@mydomain.com
{
:0 c
{
:0 hfw
* ^Subject:\/.+
| formail -I "Subject: FORWARDED:$MATCH"
:0 a
! first.address@firstdomain.com
}
{
:0 hfw
* ^Subject:\/.+
| formail -I "Subject: FORWARDED2:$MATCH"
:0 a
! second.address@seconddomain.com
}
}

If somebody could explain me the error I would be very thankful.

cheers mike

Last edited by mike1950r; 10-23-2021 at 07:12 AM.
 
Old 10-23-2021, 07:44 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,797

Rep: Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002
Quote:
Originally Posted by mike1950r View Post
Hi,
I'm knew in the forum. Hello to everybody. I have two messages in procmail.log, which i don't find the reason for:
Code:
procmail: Skipped "{"
procmail: Closing brace unexpected
I just know it comes from a rule in procmailrc. The rule is to forward email to two addresses with different, changed subjects. The rule is working fine, like it should.
Code:
:0 c
* (^TO_|for.*)myaddress@mydomain.com
{
	:0 c
	{
		:0 hfw
		* ^Subject:\/.+
		| formail -I "Subject: FORWARDED:$MATCH"
		:0 a
		! first.address@firstdomain.com
	}
	{
		:0 hfw
		* ^Subject:\/.+
		| formail -I "Subject: FORWARDED2:$MATCH"
		:0 a
		! second.address@seconddomain.com
	}
}
If somebody could explain me the error I would be very thankful.
Please post such things in CODE tags...and if you read the message, it's fairly clear. It's telling you that somewhere you've got mismatched braces. You've posted one small part of your procmailrc file; the error is elsewhere. Since we don't have the file, we can't tell you where.
 
Old 10-23-2021, 10:14 AM   #3
mike1950r
LQ Newbie
 
Registered: Oct 2021
Posts: 27

Original Poster
Rep: Reputation: Disabled
Hi,
thanks for answering.

Here is the whole file as attachment:

Hope this helps.

cheers mike

Code:
DROPPRIVS=yes
VERBOSE=yes
LOGABSTRACT=all
LOGFILE=/var/log/procmail.log

:0 fw
* <512000
| /usr/bin/spamc

:0
* ^X-Spam-Status: Yes
/dev/null

:0 c
* (^TO_|for.*)myaddress@mydomain.com
{
	:0 c
	{
		:0 hfw
		* ^Subject:\/.+
		| formail -I "Subject: FORWARDED:$MATCH"
		:0 a
		! anotheraddress@anotherdomain.com
	}
	{
		:0 hfw
		* ^Subject:\/.+
		| formail -I "Subject: FORWARDED2:$MATCH"
		:0 a
		! anotheraddress2@anotherdomain2.com
	}
}

:0 c
* (^TO_|for.*)myotheraddress@mydomain.com
{
	:0 hfw
	* ^Subject:\/.+
	| formail -I "Subject: FORWARDED:$MATCH"
	:0 a
	! anotheraddress3@anotherdomain2.comanotheraddress2@anotherdomain3.com
}
 
Old 10-23-2021, 10:33 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,797

Rep: Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002
Quote:
Originally Posted by mike1950r View Post
Hi, thanks for answering.
Here is the whole file as attachment: Hope this helps. cheers mike
Code:
DROPPRIVS=yes
VERBOSE=yes
LOGABSTRACT=all
LOGFILE=/var/log/procmail.log

:0 fw
* <512000
| /usr/bin/spamc

:0
* ^X-Spam-Status: Yes
/dev/null

:0 c
* (^TO_|for.*)myaddress@mydomain.com
{
	:0 c
	{
		:0 hfw
		* ^Subject:\/.+
		| formail -I "Subject: FORWARDED:$MATCH"
		:0 a
		! anotheraddress@anotherdomain.com
	}
	{
		:0 hfw
		* ^Subject:\/.+
		| formail -I "Subject: FORWARDED2:$MATCH"
		:0 a
		! anotheraddress2@anotherdomain2.com
	}
}

:0 c
* (^TO_|for.*)myotheraddress@mydomain.com
{
	:0 hfw
	* ^Subject:\/.+
	| formail -I "Subject: FORWARDED:$MATCH"
	:0 a
	! anotheraddress3@anotherdomain2.comanotheraddress2@anotherdomain3.com
}
Yes; check the procmail docs; there is a section dealing with your exact errors, and also explanations about the braces:
https://porkmail.org/era/procmail/mini-faq.html#skipped
 
Old 10-23-2021, 11:13 AM   #5
mike1950r
LQ Newbie
 
Registered: Oct 2021
Posts: 27

Original Poster
Rep: Reputation: Disabled
Angry

Hi again,

thanks for your advice.

I have read the links of you, but did not get it working.

If you could modify my code I could learn much better by this example.
Like I said: My code is working,
I just get these two error messages.

Cheers mike
 
Old 10-23-2021, 01:18 PM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,797

Rep: Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002Reputation: 8002
Quote:
Originally Posted by mike1950r View Post
Hi again, thanks for your advice.

I have read the links of you, but did not get it working.

If you could modify my code I could learn much better by this example. Like I said: My code is working, I just get these two error messages.
Sorry, no...not going to write your code/configs for you, for free; read the "Question Guidelines" and LQ Rules.

Since you learn by example, there are plenty of them in the material you were given, along with explanations of both of those errors...that gives you everything you need.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Brace expansion with variables and arrays: eval to the rescue LXer Syndicated Linux News 0 04-22-2020 03:02 AM
Command line execution error: unexpected EOF while looking for matching `"' bash: -c: line 25: syntax error: unexpected end of file maheshreddy690 Linux - Newbie 1 12-25-2018 01:13 PM
[SOLVED] parsing with gnu-flex and bison fails for space and brace RudraB Programming 9 05-25-2013 05:41 PM
[SOLVED] "skipped services in runlevel 5"; stuck in command mode; init 5 fails wiliamvw SUSE / openSUSE 2 03-15-2011 05:04 PM
Building "no development" LFS - which packages can be skipped? midiox Linux From Scratch 1 05-16-2006 03:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration