postsuper -r - but to different address?

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

postsuper -r - but to different address?

Charles Marcus
Hi,

I'm seeing certain messages getting stuck in my mailq, ultimately timing
out as undeliverable...

I am working with my ISP, Nuvox, who we relay all outbound mail through,
to try to see where the problem is.

My question is, is there a way to tell postfix to requeue a message
stuck in the queue to a *different* email address - ie, the techs email
address at Nuvox that I'm working with? As far as I can tell from the
man page, there's no way to do this with postsuper -r...

Ideally, I'd like it to be a NEW copy of the message, leaving the
original in the queue intact, but that is not a requirement, since it
most likely won't be delivered anyway...

The vast majority of mail (including to the recipients in the sample
problem below) is delivered without a problem.

some examples from the queue output:

-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
00EB037A086    57632 Wed Jun  4 15:24:05  [hidden email]
(conversation with smtp.nuvox.net[70.43.63.17] timed out while sending
message body)
                                          [hidden email]
                                          [hidden email]

7204137F531   155767 Tue Jun  3 16:35:46  [hidden email]
(conversation with smtp.nuvox.net[70.43.63.17] timed out while sending
message body)
                                          [hidden email]

AEF2D356626    51039 Wed Jun  4 14:38:48  prvs=original
sender=[hidden email]
(conversation with smtp.nuvox.net[70.43.63.17] timed out while sending
end of data -- message may be sent more than once)
                                          [hidden email]


Above text sanitized - myhost is my mail server

The messages destined for blackberry.net are forwards for my recipients
- they forward all incoming mail to their blackberry...

Thanks,

--

Best regards,

Charles
Reply | Threaded
Open this post in threaded view
|

Re: postsuper -r - but to different address?

mouss-2
Charles Marcus wrote:

> Hi,
>
> I'm seeing certain messages getting stuck in my mailq, ultimately
> timing out as undeliverable...
>
> I am working with my ISP, Nuvox, who we relay all outbound mail
> through, to try to see where the problem is.
>
> My question is, is there a way to tell postfix to requeue a message
> stuck in the queue to a *different* email address - ie, the techs
> email address at Nuvox that I'm working with? As far as I can tell
> from the man page, there's no way to do this with postsuper -r...
>
> Ideally, I'd like it to be a NEW copy of the message, leaving the
> original in the queue intact, but that is not a requirement, since it
> most likely won't be delivered anyway...


use postcat.

>
> The vast majority of mail (including to the recipients in the sample
> problem below) is delivered without a problem.
>
> some examples from the queue output:
>
> -Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
> 00EB037A086    57632 Wed Jun  4 15:24:05  [hidden email]
> (conversation with smtp.nuvox.net[70.43.63.17] timed out while sending
> message body)
>                                          [hidden email]
>                                          [hidden email]
>
> 7204137F531   155767 Tue Jun  3 16:35:46  [hidden email]
> (conversation with smtp.nuvox.net[70.43.63.17] timed out while sending
> message body)
>                                          [hidden email]
>
> AEF2D356626    51039 Wed Jun  4 14:38:48  prvs=original
> sender=[hidden email]
> (conversation with smtp.nuvox.net[70.43.63.17] timed out while sending
> end of data -- message may be sent more than once)
>                                          [hidden email]
>
>
> Above text sanitized - myhost is my mail server
>
> The messages destined for blackberry.net are forwards for my
> recipients - they forward all incoming mail to their blackberry...
>
> Thanks,
>

Reply | Threaded
Open this post in threaded view
|

Re: postsuper -r - but to different address?

Wietse Venema
In reply to this post by Charles Marcus
Charles Marcus:

> Hi,
>
> I'm seeing certain messages getting stuck in my mailq, ultimately timing
> out as undeliverable...
>
> I am working with my ISP, Nuvox, who we relay all outbound mail through,
> to try to see where the problem is.
>
> My question is, is there a way to tell postfix to requeue a message
> stuck in the queue to a *different* email address - ie, the techs email
> address at Nuvox that I'm working with? As far as I can tell from the
> man page, there's no way to do this with postsuper -r...

Yes there is. Use a virtual alias.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: postsuper -r - but to different address?

Charles Marcus
On 6/6/2008, Wietse Venema ([hidden email]) wrote:
>> My question is, is there a way to tell postfix to requeue a message
>> stuck in the queue to a *different* email address - ie, the techs email
>> address at Nuvox that I'm working with? As far as I can tell from the
>> man page, there's no way to do this with postsuper -r...

> Yes there is. Use a virtual alias.

At first I didn't understand, but then the lightbulb went on...

You're saying set up a temporary virtual alias for the destination
addresses, run postsuper -r for the queue ID in question, then delete
the virtual alias?

The only problem with that is, if any messages are sent to any of those
addresses while the virtual alias is activated, those messages will be
intercepted... and it is very possible that this could happen.

Hmmm...

Does postsuper work if postfix is stopped? If so, I could stop postfix,
activate the virtual alias, run the command, then start postfix...

Otherwise, I'll have to wait until late at night when the above is least
likely to occur, and just do it quickly...

--

Best regards,

Charles
Reply | Threaded
Open this post in threaded view
|

Re: postsuper -r - but to different address?

Charles Marcus
In reply to this post by mouss-2
On 6/6/2008 10:54 AM, mouss wrote:
>> My question is, is there a way to tell postfix to requeue a message
>> stuck in the queue to a *different* email address - ie, the techs
>> email address at Nuvox that I'm working with? As far as I can tell
>> from the man page, there's no way to do this with postsuper -r...

> use postcat.

Sorry, I must be dense... I don't see how to use postcat for this -
unless you're talking about some kind of complex script, which would be
outside my capabilities...

--

Best regards,

Charles
Reply | Threaded
Open this post in threaded view
|

Re: postsuper -r - but to different address?

Noel Jones-2
Charles Marcus wrote:

> On 6/6/2008 10:54 AM, mouss wrote:
>>> My question is, is there a way to tell postfix to requeue a message
>>> stuck in the queue to a *different* email address - ie, the techs
>>> email address at Nuvox that I'm working with? As far as I can tell
>>> from the man page, there's no way to do this with postsuper -r...
>
>> use postcat.
>
> Sorry, I must be dense... I don't see how to use postcat for this -
> unless you're talking about some kind of complex script, which would be
> outside my capabilities...
>


use postcat to extract the original message, then resubmit the
message to the new recipient.  This leaves the original
message intact.  Something like...
# postcat -q QUEUEID > /tmp/mymessage
# vi /tmp/mymessage
   {remove the queue file records at the top and bottom of the
message}
# sendmail -i -f [hidden email] [hidden email] <
/tmp/mymessage
at this point you can either remove the original message with
"postsuper -d QUEUEID" or just leave it to eventually deliver
or bounce.

Alternatives for redirecting the message include temporarily
adding a virtual alias, or adding a header_checks entry that
matches the Message-ID: header and returns REDIRECT
[hidden email].  The Message-ID trick is specific enough
to just affect one message.

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

Re: postsuper -r - but to different address?

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

> On 6/6/2008, Wietse Venema ([hidden email]) wrote:
>>> My question is, is there a way to tell postfix to requeue a message
>>> stuck in the queue to a *different* email address - ie, the techs
>>> email address at Nuvox that I'm working with? As far as I can tell
>>> from the man page, there's no way to do this with postsuper -r...
>
>> Yes there is. Use a virtual alias.
>
> At first I didn't understand, but then the lightbulb went on...
>
> You're saying set up a temporary virtual alias for the destination
> addresses, run postsuper -r for the queue ID in question, then delete
> the virtual alias?
>
> The only problem with that is, if any messages are sent to any of
> those addresses while the virtual alias is activated, those messages
> will be intercepted... and it is very possible that this could happen.
>
> Hmmm...
>
> Does postsuper work if postfix is stopped? If so, I could stop
> postfix, activate the virtual alias, run the command, then start
> postfix...
>
> Otherwise, I'll have to wait until late at night when the above is
> least likely to occur, and just do it quickly...
>

would disabling smtpd be enough (comment it out in master.cf while you
do your stuff).


Reply | Threaded
Open this post in threaded view
|

Re: postsuper -r - but to different address?

Charles Marcus
In reply to this post by Noel Jones-2
On 6/6/2008 12:46 PM, Noel Jones wrote:
>> My question is, is there a way to tell postfix to requeue a message
>> stuck in the queue to a *different* email address - ie, the techs
>> email address at Nuvox that I'm working with? As far as I can tell
>> from the man page, there's no way to do this with postsuper -r...

> use postcat to extract the original message, then resubmit the message
> to the new recipient.  This leaves the original message intact.  
> Something like...
> # postcat -q QUEUEID > /tmp/mymessage

Hmmm... finally got time to get back to this... I wonder if this is
significant...

Tried on one of the bad messages in the deferred queue:

myhost 0 # pwd
/var/spool/postfix/deferred/0
myhost 0 # postcat -q 0366137DF24 /home/myuser/tmp/badmessage

and at the end of the processing, got:

--------------070608030306050601000707--
*** HEADER EXTRACTED deferred/0/0366137DF24 ***
*** MESSAGE FILE END deferred/0/0366137DF24 ***
postcat: fatal: bad mail queue ID: /home/myuser/tmp/badmessage

/home/myuser/tmp dir exists and is writable...

--

Best regards,

Charles
Reply | Threaded
Open this post in threaded view
|

Re: postsuper -r - but to different address?

Charles Marcus
On 6/12/2008, Charles Marcus ([hidden email]) wrote:
> /home/myuser/tmp/badmessage

Maybe there is a special format to the name I give the resulting file?

--

Best regards,

Charles
Reply | Threaded
Open this post in threaded view
|

Re: postsuper -r - but to different address?

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

> On 6/6/2008 12:46 PM, Noel Jones wrote:
>>> My question is, is there a way to tell postfix to requeue a message
>>> stuck in the queue to a *different* email address - ie, the techs
>>> email address at Nuvox that I'm working with? As far as I can tell
>>> from the man page, there's no way to do this with postsuper -r...
>
>> use postcat to extract the original message, then resubmit the message
>> to the new recipient.  This leaves the original message intact.  
>> Something like...
>> # postcat -q QUEUEID > /tmp/mymessage
>
> Hmmm... finally got time to get back to this... I wonder if this is
> significant...
>
> Tried on one of the bad messages in the deferred queue:
>
> myhost 0 # pwd
> /var/spool/postfix/deferred/0
> myhost 0 # postcat -q 0366137DF24 /home/myuser/tmp/badmessage
>
> and at the end of the processing, got:
>
> --------------070608030306050601000707--
> *** HEADER EXTRACTED deferred/0/0366137DF24 ***
> *** MESSAGE FILE END deferred/0/0366137DF24 ***
> postcat: fatal: bad mail queue ID: /home/myuser/tmp/badmessage
>
> /home/myuser/tmp dir exists and is writable...
>

You forgot the ">" to redirect the output to the desired file.

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

Re: postsuper -r - but to different address?

Charles Marcus
In reply to this post by Noel Jones-2
On 6/6/2008, Noel Jones ([hidden email]) wrote:
> # vi /tmp/mymessage
>   {remove the queue file records at the top and bottom of the message}

I don't see anything about 'queue' at the beginning of the file:

The beginning of the message is:

*** ENVELOPE RECORDS deferred/0/0366137DF24 ***
message_size:         2961207             732               1
     0         2961207
message_arrival_time: Wed Jun 11 14:40:52 2008
create_time: Wed Jun 11 14:40:53 2008
named_attribute: rewrite_context=remote
named_attribute: sasl_method=PLAIN
named_attribute: sasl_username=[hidden email]
sender: [hidden email]
named_attribute: log_client_name=ws020.my-domain.com
named_attribute: log_client_address=192.168.1.30
named_attribute: log_client_port=2376
named_attribute: log_message_origin=ws020.my-domain.com[192.168.1.30]
named_attribute: log_helo_name=[192.168.1.30]
named_attribute: log_protocol_name=ESMTP
named_attribute: client_name=ws020.my-domain.com
named_attribute: reverse_client_name=ws020.my-domain.com
named_attribute: client_address=192.168.1.30
named_attribute: client_port=2376
named_attribute: helo_name=[192.168.1.30]
named_attribute: client_address_type=2
warning_message_time: Wed Dec 31 19:00:00 1969
named_attribute: dsn_orig_rcpt=rfc822;[hidden email]
original_recipient: [hidden email]
recipient: [hidden email]
*** MESSAGE CONTENTS deferred/0/0366137DF24 ***
Received: from [192.168.1.30] (ws020.my-domain.com [192.168.1.30])

Which line do I remove?

The end of the file is:

MDAwMDAgNjU1MzUgZg0KMDAwMDAwMDAwMCA2NTUzNSBmDQowMDAwMDAwMDAwIDY1NTM1IGYN
CjAwMDAwMDAwMDAgNjU1MzUgZg0KMDAwMDAwMDAwMCA2NTUzNSBmDQowMDAwMDAwMDAwIDY1
NTM1IGYNCjAwMDAwMDAwMDAgNjU1MzUgZg0KMDAwMDAwMDAwMCA2NTUzNSBmDQowMDAwMDAw
MDAwIDY1NTM1IGYNCjAwMDAwMDAwMDAgNjU1MzUgZg0KMDAwMDAwMDAwMCA2NTUzNSBmDQow
MDAwMDAwMDAwIDY1NTM1IGYNCjAwMDAwMDAwMDAgNjU1MzUgZg0KdHJhaWxlcg08PC9TaXpl
IDI2OD4+DXN0YXJ0eHJlZg0xMTYNJSVFT0YN
--------------070608030306050601000707--
*** HEADER EXTRACTED deferred/0/0366137DF24 ***
*** MESSAGE FILE END deferred/0/0366137DF24 ***

Is the last line, that begins with ID, what I remove?

Sorry for my ignorance...

--

Best regards,

Charles
Reply | Threaded
Open this post in threaded view
|

Re: postsuper -r - but to different address?

Noel Jones-2
Charles Marcus wrote:
> On 6/6/2008, Noel Jones ([hidden email]) wrote:
>> # vi /tmp/mymessage
>>   {remove the queue file records at the top and bottom of the message}
>
> I don't see anything about 'queue' at the beginning of the file:
>
> The beginning of the message is:
>

Remove from the next line:

> *** ENVELOPE RECORDS deferred/0/0366137DF24 ***
> message_size:         2961207             732               1    
> 0         2961207
> message_arrival_time: Wed Jun 11 14:40:52 2008
> create_time: Wed Jun 11 14:40:53 2008
> named_attribute: rewrite_context=remote
> named_attribute: sasl_method=PLAIN
> named_attribute: sasl_username=[hidden email]
> sender: [hidden email]
> named_attribute: log_client_name=ws020.my-domain.com
> named_attribute: log_client_address=192.168.1.30
> named_attribute: log_client_port=2376
> named_attribute: log_message_origin=ws020.my-domain.com[192.168.1.30]
> named_attribute: log_helo_name=[192.168.1.30]
> named_attribute: log_protocol_name=ESMTP
> named_attribute: client_name=ws020.my-domain.com
> named_attribute: reverse_client_name=ws020.my-domain.com
> named_attribute: client_address=192.168.1.30
> named_attribute: client_port=2376
> named_attribute: helo_name=[192.168.1.30]
> named_attribute: client_address_type=2
> warning_message_time: Wed Dec 31 19:00:00 1969
> named_attribute: dsn_orig_rcpt=rfc822;[hidden email]
> original_recipient: [hidden email]
> recipient: [hidden email]
> *** MESSAGE CONTENTS deferred/0/0366137DF24 ***

Down to the line just above.  ie. everything up to and
including the *** MESSAGE CONTENTS *** line.

The actual message starts with the next line.

> Received: from [192.168.1.30] (ws020.my-domain.com [192.168.1.30])
>
...
> MDAwMDAgNjU1MzUgZg0KMDAwMDAwMDAwMCA2NTUzNSBmDQowMDAwMDAwMDAwIDY1NTM1IGYN
> CjAwMDAwMDAwMDAgNjU1MzUgZg0KMDAwMDAwMDAwMCA2NTUzNSBmDQowMDAwMDAwMDAwIDY1
> NTM1IGYNCjAwMDAwMDAwMDAgNjU1MzUgZg0KMDAwMDAwMDAwMCA2NTUzNSBmDQowMDAwMDAw
> MDAwIDY1NTM1IGYNCjAwMDAwMDAwMDAgNjU1MzUgZg0KMDAwMDAwMDAwMCA2NTUzNSBmDQow
> MDAwMDAwMDAwIDY1NTM1IGYNCjAwMDAwMDAwMDAgNjU1MzUgZg0KdHJhaWxlcg08PC9TaXpl
> IDI2OD4+DXN0YXJ0eHJlZg0xMTYNJSVFT0YN
> --------------070608030306050601000707--

The message ends with the line above.  Remove the next two
lines and anything in between them.


> *** HEADER EXTRACTED deferred/0/0366137DF24 ***
> *** MESSAGE FILE END deferred/0/0366137DF24 ***
>
> Is the last line, that begins with ID, what I remove?
>
> Sorry for my ignorance...
>

been there, done that...  well, probably still there...

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

Re: postsuper -r - but to different address?

Charles Marcus
In reply to this post by Noel Jones-2
On 6/12/2008, Noel Jones ([hidden email]) wrote:
> You forgot the ">" to redirect the output to the desired file.

lol... ok, I'm going home now... time for a nap...

--

Best regards,

Charles
Reply | Threaded
Open this post in threaded view
|

Re: postsuper -r - but to different address?

Charles Marcus
In reply to this post by Noel Jones-2
On 6/12/2008 5:21 PM, Noel Jones wrote:

> Charles Marcus wrote:
>> On 6/6/2008, Noel Jones ([hidden email]) wrote:
>>> # vi /tmp/mymessage
>>>   {remove the queue file records at the top and bottom of the message}
>>
>> I don't see anything about 'queue' at the beginning of the file:
>>
>> The beginning of the message is:
>>
>
> Remove from the next line:

Ok, great... many thanks Noel... :)

--

Best regards,

Charles