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
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"
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:
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] :-)
--
Andrzej [en:Andrew] Adam Filip an...@priv.onet.pl an...@xl.wp.pl
http://anfi.homeunix.net/ http://slashdot.org/~anfi
*Random Epigram* :
The biggest difference between time and space is that you can't reuse time.
-- Merrick Furst
> > 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
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
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
--
Andrzej [en:Andrew] Adam Filip an...@priv.onet.pl an...@xl.wp.pl
http://anfi.homeunix.net/ http://slashdot.org/~anfi
*Random Epigram* :
You ask what a nice girl will do?
She won't give an inch, but she won't say no.
-- Marcus Valerius Martialis
> > 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
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 ?
--
Andrzej [en:Andrew] Adam Filip an...@priv.onet.pl an...@xl.wp.pl
http://anfi.homeunix.net/ http://slashdot.org/~anfi
*Random Epigram* :
I'll never get off this planet.
-- Luke Skywalker
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