<div dir="ltr"><div>Eoin,</div><div><br></div>I think that would be a safer route to take.  It would be nice if you could just generate a new message ID, but I know the semantics of the message IDs are a little complex.</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 20, 2018 at 7:24 PM, Eoin Kim <span dir="ltr"><<a href="mailto:Eoin.Kim@rcst.com.au" target="_blank">Eoin.Kim@rcst.com.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div dir="ltr">
<div id="m_-217893108689232836divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hi Shawn,</p>
<p><br>
</p>
<p>Thanks for your response. I was thinking about it for a while but then I have to think about the source and destination in the rule. I think I have to use FromAndTo: but I am not sure with the syntax. I guess From should be my gateway (e.g. 127.0.0.1) and
 To should be the IP address of the Exchange server, is it? But can I actually put these two addresses on the same line in the rule file? I always used From: or To: separately, never used FromAndTo:, hence, I may need a bit of help with the syntax. Plus, what
 I am acutally worrying about is when I use a rule file, if this operation happening when releasing from quarantine only because I think every email is relayed from the gateway (Ah.... I wish I could speak in English better).<br>
</p>
<div><br>
</div>
I also was thinking about a different approach, touching the following file - <b>
MailWatch/mailscanner/<wbr>functions.php</b>. More specifically, the line below:
<div><span style="font-size:12pt"><br>
</span></div>
<blockquote style="margin:0 0 0 40px;border:none;padding:0px">
<div><span style="font-size:12pt">$cmd = QUARANTINE_SENDMAIL_PATH . ' -i -f ' . MAILWATCH_FROM_ADDR . ' ' . escapeshellarg(stripslashes($<wbr>to)) . ' < ';</span></div>
</blockquote>
<div>
<div><br>
</div>
<div>Say, if I could execute sed operation (I actually got help, thanks Schlake) beforehand, that would be alright to me. For example, like this:</div>
</div>
</div>
<blockquote style="margin:0 0 0 40px;border:none;padding:0px">
<div style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
<div>
<div><span style="font-size:12pt"><br>
</span></div>
<div><span style="font-size:12pt">1. Run sed -</span>i -e<span style="font-size:12pt"> "/^H??Message-ID: /s/\(Message-ID: .*\)@\(.*\)/\1-$$@\2/" <</span></div>
</div>
<div><span style="font-size:12pt">2. After that run $cmd</span></div>
</div>
</blockquote>
<div style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
<div>
<div><br>
</div>
<div>I am not really confident with PHP, well.... actually any languages :( but I think touching
<strong>functions.php</strong> file more makes sense to me because I believe this will only affect when releasing messages from quarantine, which I want. I don't want to put changing Message-ID operation in any other situations since RFC document recommends
 not to touch it.<br>
<br>
What do you think about this Shawn? Thanks again for your help.</div>
<div><br>
</div>
<div>Eoin<br>
<div style="color:rgb(0,0,0)">
<hr style="display:inline-block;width:98%">
<div id="m_-217893108689232836divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> MailScanner <mailscanner-bounces+eoin.kim=<a href="mailto:rcst.com.au@lists.mailscanner.info" target="_blank"><wbr>rcst.com.au@lists.mailscanner.<wbr>info</a>> on behalf of Shawn Iverson <<a href="mailto:iversons@rushville.k12.in.us" target="_blank">iversons@rushville.k12.in.us</a>><br>
<b>Sent:</b> Friday, 20 July 2018 6:17 PM<br>
<b>To:</b> MailScanner Discussion<br>
<b>Subject:</b> Re: [Question] I'd like to alter Message-ID when releasing from quarantine</font>
<div> </div>
</div>
<div>
<div dir="ltr">Eoin,
<div><br>
</div>
<div>Can you create a ruleset for header removal in MailScanner (I'm not sure removing the Message-ID is a good idea, but you could give it a try)?</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Fri, Jul 20, 2018 at 12:52 AM, Eoin Kim <span dir="ltr">
<<a href="mailto:Eoin.Kim@rcst.com.au" target="_blank">Eoin.Kim@rcst.com.au</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-AU">
<div class="m_-217893108689232836m_-3829824477673706556WordSection1">
<p class="MsoNormal">Hi all,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I am trying to configure MailScanner with MailWatch on Debian 9. Sorry, I didn’t want to involve MailWatch here but since I am trying to use a function from it, I included the name here. As the MTA, I installed Postfix. What I want to achieve
 is releasing mails from quarantine via sendmail not by a file (this is the feature from MailWatch). However, I am having a problem with this.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">There is a Microsoft Exchange server sitting behind this Debian host and it rejects the released email because of the duplicate Message-ID. My senior person doesn’t want to enable the feature of ignoring duplicate on Exchange server. I
 know there is a feature in MailScanner which removes Message-ID from the mail header. However, I don’t want to remove this from every single message. Are there any ways to alter Messag-ID only when the message is released from quarantine?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I know that if I release emails as a file, no worries. However, I don’t want to do so as there are a huge amount of users who don’t use MUA. I would really appreciate if I can get any helps. Thanks a lot.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><b><span lang="EN-GB" style="color:#0070c0">Eoin Kim<u></u><u></u></span></b></p>
<p class="MsoNormal"><span style="color:#1f497d">Systems Administrator</span><span lang="EN-GB" style="color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;color:black"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="color:black">RCS Telecommunications <u></u><u></u></span></b></p>
<p class="MsoNormal"><span style="font-size:10.0pt;color:black">Level 1 – The Annexe, 133 Mary Street<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;color:black">Brisbane, QLD, 4000, Australia<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;color:black">Office: 07 3228 0843<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="FR" style="font-size:10.0pt;color:black">Mobile: 0419 726 231</span><span style="font-size:10.0pt"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt">Email: <a href="mailto:eoin.kim@rcst.com.au" target="_blank">
eoin.kim@rcst.com.au</a><u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<br>
<br><span class="HOEnZb"><font color="#888888">
<br>
-- <br>
MailScanner mailing list<br>
<a href="mailto:mailscanner@lists.mailscanner.info" target="_blank">mailscanner@lists.mailscanner.<wbr>info</a><br>
<a href="http://lists.mailscanner.info/mailman/listinfo/mailscanner" rel="noreferrer" target="_blank">http://lists.mailscanner.info/<wbr>mailman/listinfo/mailscanner</a><br>
<br>
<br>
</font></span></blockquote><span class="HOEnZb"><font color="#888888">
</font></span></div><span class="HOEnZb"><font color="#888888">
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="m_-217893108689232836gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">Shawn Iverson, CETL
<div>Director of Technology</div>
<div>Rush County Schools</div>
<div>765-932-3901 x1171</div>
<div><a href="mailto:iversons@rushville.k12.in.us" target="_blank">iversons@rushville.k12.in.us</a></div>
<div><br>
</div>
<div><img width="96" height="96" style="font-size:12.8px" src="https://docs.google.com/uc?export=download&id=0Bw5iD0ToYvs_cy1OZFNIZ0drYVU&revid=0Bw5iD0ToYvs_UitIcHVIWkJVVTl2VGpxVUE0d0FQcHBIRXk4PQ"><img width="89" height="96" src="https://docs.google.com/uc?export=download&id=0Bw5iD0ToYvs_Zkh4eEs3R01yWXc&revid=0Bw5iD0ToYvs_QWpBK2Y2ajJtYjhOMDRFekZwK2xOamk5Q3Y0PQ"></div>
<div><img style="font-size:12.8px" src="https://docs.google.com/uc?export=download&id=1aBrlQou4gjB04FY-twHN_0Dn3GHVNxqa&revid=0Bw5iD0ToYvs_RnQ0eDhHcm95WHBFdkNRbXhQRXpoYkR6SEEwPQ"><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</font></span></div>
</div>
</div>
</div>
</div>
</div>
</div>

<br><br>
<br>
-- <br>
MailScanner mailing list<br>
<a href="mailto:mailscanner@lists.mailscanner.info">mailscanner@lists.mailscanner.<wbr>info</a><br>
<a href="http://lists.mailscanner.info/mailman/listinfo/mailscanner" rel="noreferrer" target="_blank">http://lists.mailscanner.info/<wbr>mailman/listinfo/mailscanner</a><br>
<br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr">Shawn Iverson, CETL<div>Director of Technology</div><div>Rush County Schools</div><div>765-932-3901 x1171</div><div><a href="mailto:iversons@rushville.k12.in.us" target="_blank">iversons@rushville.k12.in.us</a></div><div><br></div><div><img src="https://docs.google.com/uc?export=download&id=0Bw5iD0ToYvs_cy1OZFNIZ0drYVU&revid=0Bw5iD0ToYvs_UitIcHVIWkJVVTl2VGpxVUE0d0FQcHBIRXk4PQ" width="96" height="96" style="font-size:12.8px"><img src="https://docs.google.com/uc?export=download&id=0Bw5iD0ToYvs_Zkh4eEs3R01yWXc&revid=0Bw5iD0ToYvs_QWpBK2Y2ajJtYjhOMDRFekZwK2xOamk5Q3Y0PQ" width="89" height="96"></div><div><img src="https://docs.google.com/uc?export=download&id=1aBrlQou4gjB04FY-twHN_0Dn3GHVNxqa&revid=0Bw5iD0ToYvs_RnQ0eDhHcm95WHBFdkNRbXhQRXpoYkR6SEEwPQ" style="font-size:12.8px"><br></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div>