Community Discussions and Support
How do I have Mercury process mail already delivered?

This might help if you have lots of users to process.

It steps through the user folders, if there is a forward file it extracts the destination address and queues up any existing CNM's for delivery to that, then moves them out of the way.

Adjust the paths to suit.

(no warrantee etc. :))

[quote]

@echo off
set queue=c:\mercury\queuetest
set store=c:\mercury\mailstore
set FROM=slave@mydomain.com

cd %store%
for /f %%D in ('dir /a:d /b') do (
    if exist %%D\FORWARD (
        mkdir %%D\done
        echo $$ %FROM%>> header.txt
        for /f "delims=<> tokens=2" %%T in ('findstr /B "Forward-To:" %%D\FORWARD') do echo T %%T>> header.txt
        echo.>> header.txt
        for %%a in (%%D\*.cnm) do (
            copy /A header.txt + %%a %queue%\%%~na.101
            move %%a %%D\done
        )
        del header.txt
    )
)

[/quote]

&lt;p&gt;This might help if you have lots of users to process.&lt;/p&gt;&lt;p&gt;It steps through the user folders, if there is a forward file it extracts the destination address and queues up any existing CNM&#039;s for delivery to that, then moves them out of the way.&lt;/p&gt;&lt;p&gt;Adjust the paths to suit. &lt;/p&gt;&lt;p&gt;(no warrantee etc. :)) &lt;/p&gt;&lt;p&gt;[quote]&lt;/p&gt;&lt;p&gt;@echo off set queue=c:\mercury\queuetest set store=c:\mercury\mailstore set FROM=slave@mydomain.com cd %store% for /f %%D in (&#039;dir /a:d /b&#039;) do ( &amp;nbsp;&amp;nbsp;&amp;nbsp; if exist %%D\FORWARD ( &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; mkdir %%D\done &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; echo $$ %FROM%&amp;gt;&amp;gt; header.txt &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; for /f &quot;delims=&amp;lt;&amp;gt; tokens=2&quot; %%T in (&#039;findstr /B &quot;Forward-To:&quot; %%D\FORWARD&#039;) do echo T %%T&amp;gt;&amp;gt; header.txt &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; echo.&amp;gt;&amp;gt; header.txt &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; for %%a in (%%D\*.cnm) do ( &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; copy /A header.txt + %%a %queue%\%%~na.101 &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; move %%a %%D\done &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ) &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; del header.txt &amp;nbsp;&amp;nbsp;&amp;nbsp; ) )&lt;/p&gt;&lt;p&gt;[/quote] &lt;/p&gt;

Hello I have a rather unique problem:

I am using Mercury to forward mail for my users from an OLD domain to a NEW domain. My users use a forward file in their user account directory 

During a period of misconfiguration (read, FUBAR) mail was delivered into the user directories.

What I need is to have that mail processed by Mercury and forwarded properly without an addition from line introduced into the mail message.

How can I have mercury process the mail that is already delivered without using a mail client?

Thanks for your help 

&lt;p&gt;Hello I have a rather unique problem:&lt;/p&gt;&lt;p&gt;I am using Mercury to forward mail for my users from an OLD domain to a NEW domain. My users use a forward file in their user account directory&amp;nbsp;&lt;/p&gt;&lt;p&gt;During a period of misconfiguration (read, FUBAR) mail was delivered into the user directories.&lt;/p&gt;&lt;p&gt;What I need is to have that mail processed by Mercury and forwarded properly without an addition from line introduced into the mail message.&lt;/p&gt;&lt;p&gt;How can I have mercury process the mail that is already delivered without using a mail client?&lt;/p&gt;&lt;p&gt;Thanks for your help&amp;nbsp;&lt;/p&gt;

Is NEW domain hosted on Mercury too?

If so, just move the .cnm's to the new user folder.

 Otherwise, add glue headers to the top of each message and drop into the queue dir as a .101 file. See here - http://community.pmail.com/forums/thread/21011.aspx

&lt;p&gt;Is NEW domain hosted on Mercury too? &lt;/p&gt;&lt;p&gt;If so, just move the .cnm&#039;s to the new user folder.&lt;/p&gt;&lt;p&gt;&amp;nbsp;Otherwise, add glue headers to the top of each message and drop into the queue dir as a .101 file. See here - http://community.pmail.com/forums/thread/21011.aspx &lt;/p&gt;

Thank you for the quick reply,

No, the new domain is not on the same machine. I read the post you directed me to.

I believe this will work but sadly I have hundreds of messages perhaps even thousands.

I dont suppose you happen to know of a scripted way to add the glue headers. It would have to be taken from the message body itself since I dont want to add an addition from line. I can see this as an easy problem in linux but I am on a windows machine.

I suppose I will need to search for windows awk and sed tools. Thanks for your help. 

&lt;p&gt;Thank you for the quick reply,&lt;/p&gt;&lt;p&gt;No, the new domain is not on the same machine. I read the post you directed me to.&lt;/p&gt;&lt;p&gt;I believe this will work but sadly I have hundreds of messages perhaps even thousands.&lt;/p&gt;&lt;p&gt;I dont suppose you happen to know of a scripted way to add the glue headers. It would have to be taken from the message body itself since I dont want to add an addition from line. I can see this as an easy problem in linux but I am on a windows machine.&lt;/p&gt;&lt;p&gt;I suppose I will need to search for windows awk and sed tools. Thanks for your help.&amp;nbsp;&lt;/p&gt;

You should just be able to use the NEW address & OLD address for the headers (for each user, obviously).

That is just what the FORWARD file does.

They are only used for the 'SMTP envelope' addresses and do not alter the original msg or add another From: header.

edit: Also for msg's with multi recipients, you really don't want to be resending to all of them, and BCC mails won't have the needed address in them anyway.

&lt;p&gt;You should just be able to use the NEW address &amp;amp; OLD address for the headers (for each user, obviously).&lt;/p&gt;&lt;p&gt;That is just what the FORWARD file does.&lt;/p&gt;&lt;p&gt;They are only used for the &#039;SMTP envelope&#039; addresses and do not alter the original msg or add another From: header. &lt;/p&gt;&lt;p&gt;edit: Also for msg&#039;s with multi recipients, you really don&#039;t want to be resending to all of them, and BCC mails won&#039;t have the needed address in them anyway. &lt;/p&gt;
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft