sendmail rules to determine is sending user is authenticated

Hi,

I currently have sendmail rules that allow me to determine if the recipient address is in a list of "protected" domains, and if the connecting host is among a defined set of relay hosts or coming from one of the addresses listed in access.db.

We use postini's spam/virus filtering service, and these rules allow me to determine if an inbound message destined for a postini-configured domain is indeed coming from postini's mail servers. With such rules enabled, we are able to block a HUGE amount of extra SPAM coming into our mail servers.

However, another possibility is a remote user on a dynamic address (who would not be listed in access.db) sending via an authenticated SMTP connection to a "protected" domain. This should be allowed, but I can't find a way to determine if the SMTP connection is authenticated in the sendmail rules.

Is there a ruleset I can use to determine if the connection is authenticated? Example?

Thank You!

Following are excerpts from the sendmail config:

LOCAL_RULESETS
Scheck_source
# Is the SMTP client one of postini's?
R12.158.34.$-:$+        $@ POSTINI:$2
R12.158.35.$-:$+        $@ POSTINI:$2
R63.240.161.$-:$+       $@ POSTINI:$2
R63.240.165.$-:$+       $@ POSTINI:$2

# Is the SMTP client in our access file?
# The lookup will return RELAY, if the address exists
# Otherwise, will just return the original address.
R$-.$-.$-.$-:$+ $: $( access $1.$2.$3.$4  $) :$5
RRELAY:$+       $@ RELAY:$1
R$-.$-.$-.$-:$+ $: $( access $1.$2.$3 $:$1.$2.$3.$4 $) :$5
RRELAY:$+       $@ RELAY:$1
R$-.$-.$-.$-:$+ $@ DIRECT:$5

Scheck_domain
# Is this domain a postini-protected domain?
# Isolate the recipient domain
R$*<$*@$*.>     $: $( Pdomains $3 $: NO $) : $1<$2@$3.>
RNO:$*  $@ $1
R$*:$*  $@ POSTINI:$2

SLocal_check_rcpt
# workspace is the recipient address to be checked.
R$*     $: $>3 $1
R$*<@$*>        $: $> check_domain $1<@$2>
RPOSTINI:$*<$*> $: $> check_source $&{client_addr}:$1<$2>
RPOSTINI:$*<$*> $@ ok
RRELAY:$*<$*>   $@ ok
# This following rule will refuse authenticated SMTP connections (valid).
# RDIRECT:$*<$*>        $#error $@ 5.1.3 $: "553 Ignoring MX records looks like
SPAM. Message refused."


hasslerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

kenfcampCommented:
is there any reason you haven't setup SMTP_AUTH, or alternatly pop-before-smtp ?

Either one of these will make your life easier by denying any un-authenticated (username/passwd) relay request
[note SMTP_AUTH is the current method used]
kenfcampCommented:
sorry, forgot to provide links ;)

SMTP_AUTH:
http://www.sendmail.org/~ca/email/auth.html
http://www.sendmail.org/m4/smtp_auth.html

Pop-before-smtp
http://popbsmtp.sourceforge.net/

Hope this helps

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
hasslerAuthor Commented:
THANK YOU !!!

I am using SMTP_AUTH (not my original message using the term "authenticated SMTP"), but couldn't figure out how to block non-authenticated sessions for specific domains.

That answered my question. I was able to build up rules invoking the $&{auth_authen} macro. Believe me, I had been searching for that capability for quite a while, but could not find it.

Part of my updated rules now looks like:
Scheck_domain
# Is this domain a postini-protected domain?
# Isolate the recipient domain
R$*<$*@$*.>     $: $( Pdomains $3 $: NO $) : $1<$2@$3.>
RNO:$*  $@ $1
R$*:$*  $@ POSTINI:$2

Scheck_auth
# Is this user logged in?
R$+:$+<$+>      $@ AUTH:$2<$3>
R$*:$+<$+>      $@ ANON:$2<$3>

SLocal_check_rcpt
# workspace is the recipient address to be checked.
R$*     $: $>3 $1
R$*<@$*>        $: $> check_domain $1<@$2>
RPOSTINI:$*<$*> $: $> check_source $&{client_addr}:$1<$2>
RPOSTINI:$*<$*> $@ ok
RRELAY:$*<$*>   $@ ok
RDIRECT:$*<$*>  $: $> check_auth $&{auth_authen}:$1<$2>
RAUTH:$*<$@>    $@ ok
RANON:$*<$*>    $#error $@ 4.5.0 $: "450 Ignoring MX records looks like SPAM. Message refused."
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Email Servers

From novice to tech pro — start learning today.