Google グループは Usenet の新規の投稿と購読のサポートを終了しました。過去のコンテンツは引き続き閲覧できます。
Dismiss

Sendmail - Redirect Mail From Specific Sender

閲覧: 774 回
最初の未読メッセージにスキップ

Ken - Tech

未読、
2004/05/11 11:26:232004/05/11
To:

I have the need to put mail from a specific sender (som...@where.com) into
a specific mailbox regardless of the intended recipient (To:), not aliasing.

Example -> Mail From: som...@where.com intended for (To:)
us...@mydomain.com is delivered to us...@mydomain.com. All other e-mail to
us...@mydomain.com is delivered normally.

Can this be done?? If so, which config file would need to be edited.

Thanks - Ken


Andrzej Adam Filip

未読、
2004/05/11 15:43:002004/05/11
To:

Take a look at
http://anfi.homeunix.net/sendmail/smarttab.html

Use LOCAL_RULE_0 insted of LOCAL_NET_CONFIG in smarttable.m4 to make
smarrtable route message even for local recipients.

--
Andrzej [en:Andrew] Adam Filip an...@priv.onet.pl an...@xl.wp.pl
http://anfi.homeunix.net/ http://slashdot.org/~anfi
*Random Epigram* :
Mad, adj.:
Affected with a high degree of intellectual independence ...
-- Ambrose Bierce, "The Devil's Dictionary"

dave

未読、
2004/05/12 3:36:222004/05/12
To:
Andrzej Adam Filip wrote:
>
> Ken - Tech wrote:
> > I have the need to put mail from a specific sender (som...@where.com) into
> > a specific mailbox regardless of the intended recipient (To:), not aliasing.
> >
> > Example -> Mail From: som...@where.com intended for (To:)
> > us...@mydomain.com is delivered to us...@mydomain.com. All other e-mail to
> > us...@mydomain.com is delivered normally.
> >
> > Can this be done?? If so, which config file would need to be edited.
>
> Take a look at
> http://anfi.homeunix.net/sendmail/smarttab.html
>
> Use LOCAL_RULE_0 insted of LOCAL_NET_CONFIG in smarttable.m4 to make
> smarrtable route message even for local recipients.

Will this do what the OP requested? Smarttab seems to determine which
smart-host the message is forwarded to rather than rewriting the
recipient address. The smarttable file has entries such as:

te...@mike.com popular.mailhub.com

whereas the OP (and I) would like to use entries like:

te...@mike.com alte...@mydomain.com
--
Dave

Andrzej Adam Filip

未読、
2004/05/12 7:09:062004/05/12
To:

1) smartable selects smart host

I suggested using LOCAL_RULE_0 insted of default LOCAL_NET_CONFIG.
It will make smarttable work for any recipients (including local
recipients).

2) rewriting recipients

You can use the following smarttable entry:
som...@where.com local:user2

If you want to send messages to another host then use
som...@where.com local:some_local_alias

smarttable accepts the same syntax of RHS as mailertable.

P.S. I think I was not wrong [this time] :-)

The biggest difference between time and space is that you can't reuse time.
-- Merrick Furst

dave

未読、
2004/05/13 2:49:562004/05/13
To:
Andrzej Adam Filip wrote:

> > Will this do what the OP requested? Smarttab seems to determine which
> > smart-host the message is forwarded to rather than rewriting the
> > recipient address. The smarttable file has entries such as:
> >
> > te...@mike.com popular.mailhub.com
> >
> > whereas the OP (and I) would like to use entries like:
> >
> > te...@mike.com alte...@mydomain.com
>
> 1) smartable selects smart host
>
> I suggested using LOCAL_RULE_0 insted of default LOCAL_NET_CONFIG.
> It will make smarttable work for any recipients (including local
> recipients).
>
> 2) rewriting recipients
>
> You can use the following smarttable entry:
> som...@where.com local:user2
>
> If you want to send messages to another host then use
> som...@where.com local:some_local_alias
>
> smarttable accepts the same syntax of RHS as mailertable.
>
> P.S. I think I was not wrong [this time] :-)

Yes that works fine. Many thanks.
--
Dave

dave

未読、
2004/05/13 3:08:232004/05/13
To:

Oops no it doesn't quite. The incoming message is recognised and the
recipient rewritten, but that name isn't then routed according to
mailertable - sendmail tries to deliver locally.

To illustrate, /etc/mail/smarttab says:

al...@virus.scan.company local:virusalert

and in /etc/aliases we have:

virusalert: virus...@our.domain.com

while /etc/mailertable includes:

our.domain.com smtp:[our.internal.mta]

Sendmail attempts to deliver the message to user virusalert on the
external mta which doesn't exist.

Sendmail version is 8.12.9 BTW.
--
Dave

Andrzej Adam Filip

未読、
2004/05/13 4:15:002004/05/13
To:
dave wrote:
> [...]

> Oops no it doesn't quite. The incoming message is recognised and the
> recipient rewritten, but that name isn't then routed according to
> mailertable - sendmail tries to deliver locally.
>
> To illustrate, /etc/mail/smarttab says:
>
> al...@virus.scan.company local:virusalert
>
> and in /etc/aliases we have:
>
> virusalert: virus...@our.domain.com
>
> while /etc/mailertable includes:
>
> our.domain.com smtp:[our.internal.mta]
>
> Sendmail attempts to deliver the message to user virusalert on the
> external mta which doesn't exist.
>
> Sendmail version is 8.12.9 BTW.

What is reported by the command below:
sendmail -d27.2 -d60.1 -fa...@virus.scan.company -bv postmaster

1) Try to use ~virusalert/.procmailrc (it will change envelope sender)
or use "set/change envelope sender alias"

virusalert: \
"|/usr/sbin/sendmail -oi -f postmaster virus...@our.domain.com"

OR
2) add custom R lines to exclude virus...@our.domain.com recipient
from smarttable lookups

You ask what a nice girl will do?
She won't give an inch, but she won't say no.
-- Marcus Valerius Martialis

dave

未読、
2004/05/13 5:35:442004/05/13
To:
Andrzej Adam Filip wrote:
>
> dave wrote:

> > Sendmail attempts to deliver the message to user virusalert on the
> > external mta which doesn't exist.
>

> What is reported by the command below:
> sendmail -d27.2 -d60.1 -fa...@virus.scan.company -bv postmaster

map_lookup(host, virus.scan.com) => virus.scan.com.(0)
map_lookup(dequote, "") => (0)
map_lookup(smarttable, @) => NOT FOUND (0)
map_lookup(mailertable, virus.scan.com) => NOT FOUND (0)
map_lookup(mailertable, .scan.com) => NOT FOUND (0)
map_lookup(mailertable, .com) => NOT FOUND (0)
map_lookup(mailertable, .) => NOT FOUND (0)
map_lookup(host, virus.scan.com) => virus.scan.com.(0)
map_lookup(dequote, postmaster) => NOT FOUND (0)
alias(postmaster)
postmaster (, postmaster) aliased to root
map_lookup(dequote, root) => NOT FOUND (0)
self_reference(root)
... no self ref
alias(root)
root (, root) aliased to da...@our.domain.com
map_lookup(host, our.domain.com) => our.domain.com. (0)
map_lookup(dequote, ""al...@virus.scan.com) => alert@virus.
scan.com (0)
map_lookup(smarttable, al...@virus.scan.com) => local:virusalert (0)
self_reference(da...@our.domain.com)
... no self ref
alias(virusalert)
da...@our.domain.com (da...@our.domain.com, virusalert) aliased to
virus...@our.domain.com
map_lookup(host, our.domain.com) => our.domain.com. (0)
map_lookup(dequote, ""al...@virus.scan.com) => al...@virus.scan.com (0)
map_lookup(smarttable, al...@virus.scan.com) => local:virusalert (0)
self_reference(virus...@our.domain.com)
... no self ref
alias(virusalert)
virus...@our.domain.com (virus...@our.domain.com, virusalert)
aliased to virus...@our.domain.com
map_lookup(host, our.domain.com) => our.domain.com. (0)
map_lookup(dequote, ""al...@virus.scan.com) => alert@virus.
scan.com (0)
map_lookup(smarttable, al...@virus.scan.com) => local:virusalert (0)
self_reference(virus...@our.domain.com)
... getpwnam(virusalert)... failed
... getpwnam(virusalert)... failed
... getpwnam(virusalert)... failed
... getpwnam(root)... found
virus...@our.domain.com... User unknown
forward(root)
include(/root/.forward.gateway)
include(/root/.forward)
root... deliverable: mailer local, user root

--
Dave

Andrzej Adam Filip

未読、
2004/05/13 11:50:002004/05/13
To:
dave wrote:
> Andrzej Adam Filip wrote:
>>dave wrote:
>
>>>Sendmail attempts to deliver the message to user virusalert on the
>>>external mta which doesn't exist.
>>
>>What is reported by the command below:
>>sendmail -d27.2 -d60.1 -fa...@virus.scan.company -bv postmaster
>
> map_lookup(host, virus.scan.com) => virus.scan.com.(0)
> map_lookup(dequote, "") => (0)
> map_lookup(smarttable, @) => NOT FOUND (0)
> map_lookup(mailertable, virus.scan.com) => NOT FOUND (0)
> [...]

In the above output smarttable does not see $f set via -f command line
option [$f is non set (empty)].

The above command sets $f on my home system (sendmail-8.13.0.Beta2).

Which sendmail version do you use ?

I'll never get off this planet.
-- Luke Skywalker

dave

未読、
2004/05/14 3:11:512004/05/14
To:
Andrzej Adam Filip wrote:
>
> dave wrote:
> > Andrzej Adam Filip wrote:
> >>dave wrote:
> >
> >>>Sendmail attempts to deliver the message to user virusalert on the
> >>>external mta which doesn't exist.
> >>
> >>What is reported by the command below:
> >>sendmail -d27.2 -d60.1 -fa...@virus.scan.company -bv postmaster
> >
> > map_lookup(host, virus.scan.com) => virus.scan.com.(0)
> > map_lookup(dequote, "") => (0)
> > map_lookup(smarttable, @) => NOT FOUND (0)
> > map_lookup(mailertable, virus.scan.com) => NOT FOUND (0)
> > [...]
>
> In the above output smarttable does not see $f set via -f command line
> option [$f is non set (empty)].
>
> The above command sets $f on my home system (sendmail-8.13.0.Beta2).
>
> Which sendmail version do you use ?

8.12.9 (Mandrake 9.2).

I've now got it working using your second suggestion, by creating a user
called virusalert on the MTA and using the ~/.procmailrc to forward
messages on.
--
Dave

新着メール 0 件