I have a procmail recipe that looks for a particular X-header and when it finds it, it extracts the email address behind it and forwards the email to that address.
This works fine as long as the only thing behind the X-header is a straight email address.
But if there is a real name involved, it doesn't handle it right.
I tried changing the RegEx and it did actually send it to the X-Sender email , but it didn't exactly fix the problem.
So......my question: Is there a way to get procmail to match the full email address and use it in a sendmail execution without replacing the spaces with commas?
_________
Rott Paws
...It's not a bug. It's an undocumented feature!!!
Code:
[b]procmail recipe[/b]
:0c BH
* ^X-Sender: \/[^ ]+
! $MATCH
This works fine as long as the only thing behind the X-header is a straight email address.
Code:
[b]X-header[/b]
X-Sender: user.name@domain.com
[b]procmail log[/b]
procmail: Assigning "MATCH="
procmail: Matched "user.name@domain.com"
procmail: Match on "^X-Sender: \/[^ ]+"
procmail: Executing "/usr/sbin/sendmail,-oi,user.name@domain.com"
procmail: Assigning "LASTFOLDER=/usr/sbin/sendmail -oi user.name@domain.com"
But if there is a real name involved, it doesn't handle it right.
Code:
[b]X-header[/b]
X-Sender: "Real Name" <user.name@domain.com>
[b]procmail log[/b]
procmail: Assigning "MATCH="
procmail: Matched ""Real"
procmail: Match on "^X-Sender: \/[^ ]+"
procmail: Executing "/usr/sbin/sendmail,-oi,"Real"
procmail: Assigning "LASTFOLDER=/usr/sbin/sendmail -oi "Real"
[i]Results in an unknown user error[/i]
(reason: 550 5.1.1 <Real@myserver.domain.com>... User unknown)
(expanded from: "Real)
I tried changing the RegEx and it did actually send it to the X-Sender email , but it didn't exactly fix the problem.
Code:
[b]X-header[/b]
X-Sender: "Real Name" <user.name@domain.com>
[b]procmail log[/b]
procmail: Assigning "MATCH="
procmail: Matched "[COLOR=red yellow]"Real Name" <user.name@domain.com>[/color]"
procmail: Match on "^X-Sender: \/[COLOR=red yellow].+[/color]"
procmail: Executing "/usr/sbin/sendmail,-oi,"Real[COLOR=red yellow],[/color]Name"[COLOR=red yellow],[/color]<user.name@domain.com>"
procmail: Assigning "LASTFOLDER=/usr/sbin/sendmail -oi "Real Name" <user.name@domain.com>"
[i]Results in an unknown user errors[/i]
(reason: 550 5.1.1 <Real@myserver.domain.com>... User unknown)
(expanded from: "Real)
(reason: 550 5.1.1 <Name@myserver.domain.com>... User unknown)
(expanded from: Name)
So......my question: Is there a way to get procmail to match the full email address and use it in a sendmail execution without replacing the spaces with commas?
_________
Rott Paws
...It's not a bug. It's an undocumented feature!!!