How can I reject messages for users no longer with our company?

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

How can I reject messages for users no longer with our company?

Charles Marcus
I know about the 'relocated_maps', and was thinking that I could use
this, but I don't want it to say "User has MOVED to blah", I just want
it to say something like "The person you are trying to reach - $user -
is no longer with $OurCompany."

Is there a way to customize the entire reject message - or another way
to accomplish this easily?

Lots of googling doesn't show a way to customize the *entire* reject
message (ie, the beginning part)...

Thanks...

--

Best regards,

Charles
Reply | Threaded
Open this post in threaded view
|

Re: How can I reject messages for users no longer with our company?

Brian Evans - Postfix List
Charles Marcus wrote:

> I know about the 'relocated_maps', and was thinking that I could use
> this, but I don't want it to say "User has MOVED to blah", I just want
> it to say something like "The person you are trying to reach - $user -
> is no longer with $OurCompany."
>
> Is there a way to customize the entire reject message - or another way
> to accomplish this easily?
>
> Lots of googling doesn't show a way to customize the *entire* reject
> message (ie, the beginning part)...
A bounce is a bounce.  Each mail software will report the message
differently.

One example:
smtpd_recipient_restrictions = permit_mynetworks,
reject_unauth_destination, check_recipient_access
hash:/etc/postfix/reject_old

reject_old:
[hidden email]   REJECT   This user is no longer here blah blah
blah...

The user will get what you send them, but may be several lines into the
text.

Only an auto-responder can send a fully custom message.
This has its downside as well because undeliverable spams may clog your
queue.

Brian
Reply | Threaded
Open this post in threaded view
|

Re: How can I reject messages for users no longer with our company?

Noel Jones-2
In reply to this post by Charles Marcus
Charles Marcus wrote:

> I know about the 'relocated_maps', and was thinking that I could use
> this, but I don't want it to say "User has MOVED to blah", I just want
> it to say something like "The person you are trying to reach - $user -
> is no longer with $OurCompany."
>
> Is there a way to customize the entire reject message - or another way
> to accomplish this easily?
>
> Lots of googling doesn't show a way to customize the *entire* reject
> message (ie, the beginning part)...
>
> Thanks...
>

With relocated you can use something like:
# relocated
[hidden email]  unknown address

Or you can use a transport_maps entry and customize the whole
message with something like:
# transport
[hidden email]  error:5.1.1 recipient no longer here


--
Noel Jones
Reply | Threaded
Open this post in threaded view
|

Re: How can I reject messages for users no longer with our company?

Charles Marcus
In reply to this post by Brian Evans - Postfix List
On 6/5/2008 11:16 AM, Brian Evans wrote:

> A bounce is a bounce.  Each mail software will report the message
> differently.
>
> One example:
> smtpd_recipient_restrictions = permit_mynetworks,
> reject_unauth_destination, check_recipient_access
> hash:/etc/postfix/reject_old
>
> reject_old:
> [hidden email]   REJECT   This user is no longer here blah blah
> blah...
>
> The user will get what you send them, but may be several lines into the
> text.

Yes, which is the same as when using the relocated_maps, but is not a
problem for me...

Thanks, I was thinking about trying something like the above, glad to
know I was on the right track.

--

Best regards,

Charles
Reply | Threaded
Open this post in threaded view
|

Re: How can I reject messages for users no longer with our company?

Charles Marcus
In reply to this post by Noel Jones-2
On 6/5/2008, Noel Jones ([hidden email]) wrote:
> With relocated you can use something like:
> # relocated
> [hidden email]  unknown address

Hmmm... but doesn't the built-in rejection message that is used when
relocated_maps is used start with 'User has moved to...'?

What would the full rejection text look like if the above were implemented?

Guess its time to go experiment and stop asking questions... ;)

--

Best regards,

Charles
Reply | Threaded
Open this post in threaded view
|

Re: How can I reject messages for users no longer with our company?

Noel Jones-2
Charles Marcus wrote:

> On 6/5/2008, Noel Jones ([hidden email]) wrote:
>> With relocated you can use something like:
>> # relocated
>> [hidden email]  unknown address
>
> Hmmm... but doesn't the built-in rejection message that is used when
> relocated_maps is used start with 'User has moved to...'?
>
> What would the full rejection text look like if the above were implemented?
>
> Guess its time to go experiment and stop asking questions... ;)
>

"user has moved to unknown address" makes sense to most
people, even if it's not exactly what you want.


--
Noel Jones
Reply | Threaded
Open this post in threaded view
|

Re: How can I reject messages for users no longer with our company?

Charles Marcus
On 6/5/2008, Noel Jones ([hidden email]) wrote:
> "user has moved to unknown address" makes sense to most people, even
> if it's not exactly what you want.

I'm not understanding why the initial part of this message is
hard-coded... is there a technical reason?

--

Best regards,

Charles
Reply | Threaded
Open this post in threaded view
|

Re: How can I reject messages for users no longer with our company?

Wietse Venema
Charles Marcus:
> On 6/5/2008, Noel Jones ([hidden email]) wrote:
> > "user has moved to unknown address" makes sense to most people, even
> > if it's not exactly what you want.
>
> I'm not understanding why the initial part of this message is
> hard-coded... is there a technical reason?

Without the "user has moved" prefix, there would be too little
value over access maps (or per-recipient transport maps).

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: How can I reject messages for users no longer with our company?

Charles Marcus
On 6/5/2008 3:15 PM, Wietse Venema wrote:
> Without the "user has moved" prefix, there would be too little
> value over access maps (or per-recipient transport maps).

Oh... right... kindof obvious, now  that you said it... ;)

--

Best regards,

Charles
Reply | Threaded
Open this post in threaded view
|

Re: How can I reject messages for users no longer with our company?

Victor Duchovni
On Thu, Jun 05, 2008 at 04:46:14PM -0400, Charles Marcus wrote:

> On 6/5/2008 3:15 PM, Wietse Venema wrote:
> >Without the "user has moved" prefix, there would be too little
> >value over access maps (or per-recipient transport maps).
>
> Oh... right... kindof obvious, now  that you said it... ;)

The relocated_maps facility is subsumed by per-user transport
table entries (that's essentially how it works):

transport:
    [hidden email] error:5.1.1 User has moved to [hidden email]
    [hidden email] error:5.1.6 User has moved, no forwarding address

http://tools.ietf.org/html/rfc3463#section-3.2

--
        Viktor.

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the "Reply-To" header.

To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:
<mailto:[hidden email]?body=unsubscribe%20postfix-users>

If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.
Reply | Threaded
Open this post in threaded view
|

Re: How can I reject messages for users no longer with our company?

Charles Marcus
In reply to this post by Brian Evans - Postfix List
On 6/5/2008, Brian Evans ([hidden email]) wrote:
> One example:
> smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_destination, check_recipient_access hash:/etc/postfix/reject_old
>
> reject_old:
> [hidden email]   REJECT   This user is no longer here blah blah blah...

Before I let the boss go crazy and break something...

Is there a limit (# of characters) to how long this custom reject
message can be?

--

Best regards,

Charles
Reply | Threaded
Open this post in threaded view
|

Re: How can I reject messages for users no longer with our company?

Wietse Venema
Charles Marcus:

> On 6/5/2008, Brian Evans ([hidden email]) wrote:
> > One example:
> > smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_destination, check_recipient_access hash:/etc/postfix/reject_old
> >
> > reject_old:
> > [hidden email]   REJECT   This user is no longer here blah blah blah...
>
> Before I let the boss go crazy and break something...
>
> Is there a limit (# of characters) to how long this custom reject
> message can be?

It's a good idea to stay well below the RFC821 reply length limit,
to avoid problems with implementations that don't follow RFCs.

        Wietse

      4.5.3.  SIZES

         There are several objects that have required minimum maximum
         sizes.  That is, every implementation must be able to receive
         objects of at least these sizes, but must not send objects
         larger than these sizes.

                                   
          ****************************************************
          *                                                  *
          *  TO THE MAXIMUM EXTENT POSSIBLE, IMPLEMENTATION  *
          *  TECHNIQUES WHICH IMPOSE NO LIMITS ON THE LENGTH *
          *  OF THESE OBJECTS SHOULD BE USED.                *
          *                                                  *
          ****************************************************

            user

               The maximum total length of a user name is 64 characters.

            domain

               The maximum total length of a domain name or number is 64
               characters.

            path

               The maximum total length of a reverse-path or
               forward-path is 256 characters (including the punctuation
               and element separators).

            command line

               The maximum total length of a command line including the
               command word and the <CRLF> is 512 characters.

            reply line

               The maximum total length of a reply line including the
               reply code and the <CRLF> is 512 characters.

            text line

               The maximum total length of a text line including the
               <CRLF> is 1000 characters (but not counting the leading
               dot duplicated for transparency).

            recipients buffer

               The maximum total number of recipients that must be
               buffered is 100 recipients.

                                   
          ****************************************************
          *                                                  *
          *  TO THE MAXIMUM EXTENT POSSIBLE, IMPLEMENTATION  *
          *  TECHNIQUES WHICH IMPOSE NO LIMITS ON THE LENGTH *
          *  OF THESE OBJECTS SHOULD BE USED.                *
          *                                                  *
          ****************************************************

         Errors due to exceeding these limits may be reported by using
         the reply codes, for example:

            500 Line too long.

            501 Path too long

            552 Too many recipients.

            552 Too much mail data.
Reply | Threaded
Open this post in threaded view
|

Re: How can I reject messages for users no longer with our company?

Charles Marcus
On 6/8/2008, Wietse Venema ([hidden email]) wrote:
>> Is there a limit (# of characters) to how long this custom reject
>> message can be?

> It's a good idea to stay well below the RFC821 reply length limit,
> to avoid problems with implementations that don't follow RFCs.

<snip>

>      reply line
>
>         The maximum total length of a reply line including the
>         reply code and the <CRLF> is 512 characters.

Cool... 512 characters should be plenty.

Thanks Wietse...

--

Best regards,

Charles
Reply | Threaded
Open this post in threaded view
|

Re: How can I reject messages for users no longer with our company?

mouss-2
Charles Marcus wrote:

> On 6/8/2008, Wietse Venema ([hidden email]) wrote:
>>> Is there a limit (# of characters) to how long this custom reject
>>> message can be?
>
>> It's a good idea to stay well below the RFC821 reply length limit,
>> to avoid problems with implementations that don't follow RFCs.
>
> <snip>
>
>>      reply line
>>
>>         The maximum total length of a reply line including the
>>         reply code and the <CRLF> is 512 characters.
>
> Cool... 512 characters should be plenty.


Note that the error message may be "converted" by the sender MTA, so
there is no guarantee that the user will not see "Mailbox action not
taken".
Reply | Threaded
Open this post in threaded view
|

Re: How can I reject messages for users no longer with our company?

Charles Marcus
On 6/8/2008 2:44 PM, mouss wrote:
> Note that the error message may be "converted" by the sender MTA, so
> there is no guarantee that the user will not see "Mailbox action not
> taken".

Understood... there are no guarantees in life... this is 'good enough'
for me, and for the boss. He's actually pretty good about listening to
reason about things like this - he even listened to me and acquiesced
when he initially wanted me to add a disclaimer to every outbound email
and I explained why this is a bad idea...

--

Best regards,

Charles