[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: change subject of emails on ISP's IMAP server

On Mon, Dec 15, 2014 at 05:38:03PM +0000, Darac Marjal wrote:
> On Fri, Dec 12, 2014 at 08:53:51PM -0500, Rob Owens wrote:
> > When my ISP encounters an email that it cannot scan for viruses, it
> > prepends ***UNCHECKED*** to the subject.  This occurs on every encrypted
> > email I receive.  It's highly annoying, and the ISP refuses to fix this.
> > 
> > What tools can I use to detect this tag and delete it?  I'd prefer to
> > modify the subject of the email as it resides on my ISP's IMAP server.
> > But if I have to rely on my email client (mutt) to do that, that's ok
> > too I guess.
> > 
> > Any suggestions would be welcome.  
> Apparently, this is what imapfilter will do. You'll need to write a lua
> script to tell it what to do, but it looks like it comes with some
> hackable examples.

Thanks.  I see the following example in some of the imapfilter docs.  I'll have
to stare at it until it makes sense.  If anybody can offer any assistance, 
please chime in.  Until then, I will be reading lua documentation.

-- Messages can be appended to a mailbox.  One can fetch a message from a
-- mailbox, optionally process it, and then upload it to the same or different
-- mailbox, at the same or different mail servers.  In the following example a
-- header field is added to all messages, and the processed messages are then
-- appended to a different mailbox.

all = myaccount.mymailbox:select_all()

for _, mesg in ipairs(all) do
    mbox, uid = table.unpack(all)
    header = mbox[uid]:fetch_header()
    body = mbox[uid]:fetch_body()
    message = header:gsub('[\r\n]+$', '\r\n') ..
              'My-Header: My-Content\r\n' .. '\r\n' .. body

Attachment: signature.asc
Description: Digital signature

Reply to: