Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

sending ampersand from virtusertable to procmail

24 views
Skip to first unread message

Jon P.

unread,
Apr 27, 2012, 6:15:33 AM4/27/12
to
The FAQ tip at http://www.sendmail.org/faq/section3#3.29 seems to rely
on the fact that the following entry in virtusertable:

@domain.com user+%1

will cause $1 in the .procmailrc config, e.g.:

ENV_TO=$1

to have the value "NNN" if mail being routed was addressed to
N...@domain.com.

what if instead of "NNN" I wanted to send the value "N...@domain.com"
to procmail?

@domain.com user+%1...@domain.com

will cause a too much recursion error,

@domain.com user+%1\@domain.com

seems to escape the ampersand, but rather than "N...@domain.com",
procmail will get "NNN\@domain.com". How does one get virtusertable
to send an ampersand without the escape character?

Or alternatively, how does one get procmail to remove the backslash?

Andrzej Adam Filip

unread,
Apr 27, 2012, 1:01:38 PM4/27/12
to
"Jon P." <jbp...@gmail.com> wrote:
> The FAQ tip at http://www.sendmail.org/faq/section3#3.29 seems to rely
> on the fact that the following entry in virtusertable:
>
> @domain.com user+%1
>
> will cause $1 in the .procmailrc config, e.g.:
>
> ENV_TO=$1
>
> to have the value "NNN" if mail being routed was addressed to
> N...@domain.com.
>
> what if instead of "NNN" I wanted to send the value "N...@domain.com"
> to procmail?
> [...]

Take a look at " Another possible _solution_ ..." link at the end of 3.29.
[ http://anfi.homeunix.org/sendmail/sharedmailbox.html ]
It should allow you to pass full envelope recipient address to procmail.

It is based on procmail script in /etc/procmailrcs/


Hugo Villeneuve

unread,
Apr 29, 2012, 7:11:08 AM4/29/12
to
Andrzej Adam Filip <an...@onet.eu> wrote:

> Take a look at " Another possible _solution_ ..." link at the end of 3.29.
> [ http://anfi.homeunix.org/sendmail/sharedmailbox.html ]
> It should allow you to pass full envelope recipient address to procmail.
>
> It is based on procmail script in /etc/procmailrcs/

From reading your anfi page, I didn't know you could put "!" on the
right side of a virtusertable entry to = the same thing as the left
side. I have been writing them in long form like mc/README mention.
Like:

us...@example.com user%3...@example.com

when I could have been using:

us...@example.com !



Andrzej Adam Filip

unread,
Apr 29, 2012, 8:06:22 AM4/29/12
to
hu...@EINTR.net (Hugo Villeneuve) wrote:_VIRTUSER_STOP_ONE_LEVEL_RECURSION
AFAIR Claus (?) stated sendmail.org position something like:
1) "!" handling in virtusertable reply should be treated as
"an undocumented feature" [It _MAY_ change without a notice]
2) Also undocumented _VIRTUSER_STOP_ONE_LEVEL_RECURSION_ is "more preferred".
It is merely described in comments in cf/m4/proto.m4 file.

sendmail-8.14.5/cf/m4/proto.m4 file:
#v+
1062 ifdef(`_VIRTUSER_STOP_ONE_LEVEL_RECURSION_',`dnl
1063 dnl this is not a documented option
1064 dnl it stops looping in virtusertable mapping if input and output
1065 dnl are identical, i.e., if address A is mapped to A.
1066 dnl it does not deal with multi-level recursion
#v-

sendmail.mc line to use it:
define(`_VIRTUSER_STOP_ONE_LEVEL_RECURSION_')dnl

virtusertable lines to make it work (as I understand it):
us...@example.com us...@example.com
us...@example.com %0

P.S. I prefer more detailed replies for benefits of future readers of
ancient postings archives.
0 new messages