linux-admin.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Proper procedure for bounced mails?
@ 2002-07-22  8:29 Jens Knoell
  2002-07-22 12:28 ` James
  0 siblings, 1 reply; 6+ messages in thread
From: Jens Knoell @ 2002-07-22  8:29 UTC (permalink / raw)
  To: Linux Admin ML

It's probably somewhat OT - is there an established procedure for bouncing
mails? Special headers and the like? A net search wasn't exactly helpful...
does anyone know a good resource to read up on that?

Thanks
Jens


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Proper procedure for bounced mails?
  2002-07-22  8:29 Proper procedure for bounced mails? Jens Knoell
@ 2002-07-22 12:28 ` James
  2002-07-22 19:24   ` Jens Knoell
  0 siblings, 1 reply; 6+ messages in thread
From: James @ 2002-07-22 12:28 UTC (permalink / raw)
  To: Linux Admin ML

On Mon, Jul 22, 2002 at 02:29:59AM -0600, Jens Knoell wrote:
| It's probably somewhat OT - is there an established procedure for bouncing
| mails? Special headers and the like? A net search wasn't exactly helpful...
| does anyone know a good resource to read up on that?

How and why do you want to bounce email?

Sendmail and friends automatically bounce mail if the recipient address
is unknown. I don't recommend bouncing spam as the sender address is
likely to be fake and you could accidentally mailbomb someone innocent.

And it's probably not OT if you're using Linux mail servers ;-)

-- 
I will not aim for the head  
 
PGP Fingerprint [6AD6 865A BF6E 76BB 1FC2 E4C4 DEEA 7D08 D511 E149]
PGP Public key  [www.piku.org.uk/public-key.asc] - Home [www.piku.org.uk]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Proper procedure for bounced mails?
  2002-07-22 12:28 ` James
@ 2002-07-22 19:24   ` Jens Knoell
  2002-07-22 21:11     ` Glynn Clements
  0 siblings, 1 reply; 6+ messages in thread
From: Jens Knoell @ 2002-07-22 19:24 UTC (permalink / raw)
  To: Linux Admin ML

From: "James" <james@piku.org.uk>
> On Mon, Jul 22, 2002 at 02:29:59AM -0600, Jens Knoell wrote:
> | It's probably somewhat OT - is there an established procedure for
bouncing
> | mails? Special headers and the like? A net search wasn't exactly
helpful...
> | does anyone know a good resource to read up on that?
>
> How and why do you want to bounce email?

How: from a custom, not-yet-totally-finished script that is supposed to
filter all incoming mail based on certain per-user conditions in an SQL
database.

The idea is to bounce mails only once per sender per day. So far, I've been
using "custom" reply mails, as well as informing the recipient by sending
them some tiny email. So far so good - but I'd like to re-format the reply
mails to be a little more compliant to standards (if there are any for such
things).

> Sendmail and friends automatically bounce mail if the recipient address
> is unknown. I don't recommend bouncing spam as the sender address is
> likely to be fake and you could accidentally mailbomb someone innocent.

Correct. That's why I'd like to make sure the bounces are somewhat
conforming to standard formats. On the other hand, bouncing spam does get
people off spamlists - yet I can't just pretend that the user doesn't exist,
as that will confuse the rare legit sender whose mail gets rejected for one
reason or another.
Unconditionally dropping them doesn't get people off spamlists either
(tested that in lengthy experiments). To prevent mailbombing, I'd rather
like to use a "warn once per day" filter on my side.

> And it's probably not OT if you're using Linux mail servers ;-)

*G* I am using sendmail, and started off with the old AMaViS mailfilter...
by now it's not AMaViS anymore, but yes, it's Linux+sendmail+mySQL+... all
the way :)

Before anyone asks: The script isn't ready for prime time yet (too
site-specific, lots of things hardcoded, still a few critical bugs), but I
am considering to wrap it up and release it someday, although probably not
in the near future - it is too embarrassing at the moment ;)

Jens


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Proper procedure for bounced mails?
  2002-07-22 19:24   ` Jens Knoell
@ 2002-07-22 21:11     ` Glynn Clements
  2002-07-22 22:45       ` Jens Knoell
  0 siblings, 1 reply; 6+ messages in thread
From: Glynn Clements @ 2002-07-22 21:11 UTC (permalink / raw)
  To: Jens Knoell; +Cc: Linux Admin ML


Jens Knoell wrote:

> > | It's probably somewhat OT - is there an established procedure for bouncing
> > | mails? Special headers and the like? A net search wasn't exactly helpful...
> > | does anyone know a good resource to read up on that?
> >
> > How and why do you want to bounce email?
> 
> How: from a custom, not-yet-totally-finished script that is supposed to
> filter all incoming mail based on certain per-user conditions in an SQL
> database.
> 
> The idea is to bounce mails only once per sender per day. So far, I've been
> using "custom" reply mails, as well as informing the recipient by sending
> them some tiny email. So far so good - but I'd like to re-format the reply
> mails to be a little more compliant to standards (if there are any for such
> things).

Whereabouts in the message delivery chain does the script sit? Does it
process the message as it comes in, or is it fed the message after the
SMTP server has acknowledged its acceptance?

For the former (e.g. if the script is registered as a mailer in
sendmail.cf, or called from a procmail rule), it should simply report
a failure via its exit code, so that the SMTP server indicates an
error immediately. This eliminates the need to construct a bounce
message.

For the latter, then it needs to send a bounce message to the
*envelope* sender address; sending bounces to any other address may
result in your domain being blacklisted by mailing lists.

As for the format, see RFCs 2822 (Internet Message Format) and
2045-2049 (Multipurpose Internet Mail Extensions). Or just mimic the
format of a sendmail-generated bounce message.

-- 
Glynn Clements <glynn.clements@virgin.net>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Proper procedure for bounced mails?
  2002-07-22 21:11     ` Glynn Clements
@ 2002-07-22 22:45       ` Jens Knoell
  2002-07-23  1:01         ` Glynn Clements
  0 siblings, 1 reply; 6+ messages in thread
From: Jens Knoell @ 2002-07-22 22:45 UTC (permalink / raw)
  To: Linux Admin ML

From: "Glynn Clements" <glynn.clements@virgin.net>
> Whereabouts in the message delivery chain does the script sit? Does it
> process the message as it comes in, or is it fed the message after the
> SMTP server has acknowledged its acceptance?

It uses the Mlocal part of sendmail's config, so it is possible to use the
exit code, as far as I know. But to the best of my knowledge, it's not
possible to return some custom string to indicate the reason for failure, is
there?

> For the former (e.g. if the script is registered as a mailer in
> sendmail.cf, or called from a procmail rule), it should simply report
> a failure via its exit code, so that the SMTP server indicates an
> error immediately. This eliminates the need to construct a bounce
> message.

Absolutely - IF I can somehow return a custom error message like "Message
appears to be spam - look at http://blah.blubb.bleh/spampolicy.html" or some
such...?

> For the latter, then it needs to send a bounce message to the
> *envelope* sender address; sending bounces to any other address may
> result in your domain being blacklisted by mailing lists.

That's what I currently do, I think.

Good point about mimicking sendmail's generic error messages... I hadn't
thought of doing it that way.

Thanks a lot
Jens


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Proper procedure for bounced mails?
  2002-07-22 22:45       ` Jens Knoell
@ 2002-07-23  1:01         ` Glynn Clements
  0 siblings, 0 replies; 6+ messages in thread
From: Glynn Clements @ 2002-07-23  1:01 UTC (permalink / raw)
  To: Jens Knoell; +Cc: Linux Admin ML


Jens Knoell wrote:

> > Whereabouts in the message delivery chain does the script sit? Does it
> > process the message as it comes in, or is it fed the message after the
> > SMTP server has acknowledged its acceptance?
> 
> It uses the Mlocal part of sendmail's config, so it is possible to use the
> exit code, as far as I know. But to the best of my knowledge, it's not
> possible to return some custom string to indicate the reason for failure, is
> there?

AFAICT, anything which the mailer writes to stderr is included in the
error message.

-- 
Glynn Clements <glynn.clements@virgin.net>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-07-23  1:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-22  8:29 Proper procedure for bounced mails? Jens Knoell
2002-07-22 12:28 ` James
2002-07-22 19:24   ` Jens Knoell
2002-07-22 21:11     ` Glynn Clements
2002-07-22 22:45       ` Jens Knoell
2002-07-23  1:01         ` Glynn Clements

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).