procmail
[Top] [All Lists]

Re: mailbounce tool

2001-12-12 23:08:38
At 20:54 2001-12-12 -0600, David W. Tamkin wrote:

One part of the problem: you have to forward it in such a way that the
envelope-sender address remains unchanged and is not repointed to you as the
forwarder (as it usually should be for most forwarding).

:0
* somecondition
| $SENDMAIL -oi $BOGUSADDR -f $SENDER

Where $BOGUSADDR is set to your bogified address, either statically, or dynamically from the message addressing (say, extract your address/domain portion and pipe it through sed to change/insert a hostname):

# simply set our bounce address - it's at a separate hostname than where
# we normally take mail.
BOGUSADDR=myusername(_at_)lutefisk(_dot_)professional(_dot_)org

And $SENDER is the envelope address (be nice and don't do this to unsuspecting MAILING LISTS) previously extracted from the message.

-f requires the user be a member of the "trusted" user class in the sendmail config, or it'll stuff a warning message into the header.

This is untested - I don't do it, but should I have a need to bounce things, this would be the route I'd consider. I also figure it'd make a handy facility for post-processing bounces for mailboxes you're rummaging through after the messages have been stored.

address really bounced and shouldn't be used any more.  I guess you could
bounce to jdoe%real(_dot_)site(_at_)example(_dot_)com or 
jdoe=real(_dot_)site(_at_)example(_dot_)com, so maybe
that's no problem at all.

For those who operate their own networks: why not just create a host into your DNS zone (or urge your syadm to do so) which you can use for this (I use "lutefisk.professional.org" -- I point it and a couple of other hosts' MX at the mail server of the last corporate twit to tick me off enough with a spam to make me update the DNS to point to them - it's also the hostname I use in my "replace this with that to send email replies" usenet posts). Either you define a nonexistant MX host, or you point it at some spewmaster's server and their server ends up churning a message about how they don't relay or they don't accept mail for that recipient, etc.

If you point it at your OWN MX, and configure sendmail correctly (it must accept mail for that subdomain - well, you could have it not, but then the error would be different and the sender would be left with the impression that you were running a crappy server), using virtusertable for that whole subdomain:

@lutefisk.professional.org   ERROR:nouser User unknown

(this would require that I redefine lutefisk to use my host for MX, rather than pointint it at a corpspamtwit server)

The sendmail bat book, S 30.5.2.1, defines the DSN strings (nouser used above, but there are a variety of others, and you can still redefine the specific message anyway).

By doing this, you'd have a generic host which you can forward messages to generate bounces on your behalf (this will bounce *ALL* users at the domain, unless there are specific virtusertable entries for other addresses, which will be unaffected by this catch-all). You could have specific usernames intended for bouncing "No longer at this domain" type messages (ref: post processing a saved mailbox).

The sender would then just get the impression that your specific mail host got stuffed in the bounce message as part of a rewrute (not uncommon with corporate mailers and large ISPs - "user(_at_)msn(_dot_)com" -> "user(_at_)email(_dot_)msn(_dot_)com").

(I wrote much of this, then had to do something else, and by the time I'd returned to it, but before actually getting this fired off, I saw Andrews post which also provided pretty much the same answer, though I note that his solution involves having a _specific_ address listed, whereas this permits a generic refusal capability for any address since you're using an alternate hostname).

There was a third part I had in  mind, but it's fallen out of my head.
Darn.

No, I still hear it rattling around in there.  Sounds like a jingle-bell.  <g>

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>