Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

mail stuck in queue, can it be modified

Discussion in 'E-mail Discussion' started by keat63, Jun 21, 2018.

Tags:
  1. keat63

    keat63 Well-Known Member

    Joined:
    Nov 20, 2014
    Messages:
    1,030
    Likes Received:
    47
    Trophy Points:
    28
    cPanel Access Level:
    Root Administrator
    We have an automated system which sends out customer invoices.
    Occasionally, our end users may have inputted the customers email address into the automated system incorrectly.
    On such occasions, the invoice will get stuck in the mail queue until it falls off the end.

    Is it possible for me to correct these typos whilst the mail is stuck in the queue.

    I don't see anything in whm or mailscanner that will allow me to do this.
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,517
    Likes Received:
    425
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    There is no way to edit an email in transit that I'm aware of.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,775
    Likes Received:
    120
    Trophy Points:
    343
    cPanel Access Level:
    Root Administrator
    (Not for the faint of heart)

    If the message is stuck in the queue you can try modifying the files directly at:

    /var/spool/exim/input/%alphanumeric%/%messageid%-D
    /var/spool/exim/input/%alphanumeric%/%messageid%-H


    You will need to know the message ID of the specific message, and probably the easiest way to find these files is to use grep:

    grep -lr %messageid% /var/spool/exim/input

    The -H file is referring to the headers of the message.

    The -D file is referring to the message contents or body.

    (The %alphanumeric% code is going to be the last alphanumeric character before the first dash in the message id)

    I cannot vouch for this method and I don't really recommend it. But it would seem to be possible to do. Although I think there may be a checksum some where in this, so the message knows how big it's suppose to be. This means you can't remove 1 character and add 2 characters. It has to be a 1:1 change. Although I'm not entirely sure if that's correct.
     
    cPanelLauren likes this.
  4. cPanelLauren

    cPanelLauren Forums Analyst II
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    3,517
    Likes Received:
    251
    Trophy Points:
    193
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    I tested the method mentioned by @sparek-3 on my own server and found that it does indeed work. I modified the header of a message stuck in queue to change the recipient address. I should also point out that this method is not something that is supported by cPanel but I do hope it answers your question.

    I did

    Code:
    grep -r MessageID /var/spool/exim/input
    to find the message and used vi to modify the header portion.

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. keat63

    keat63 Well-Known Member

    Joined:
    Nov 20, 2014
    Messages:
    1,030
    Likes Received:
    47
    Trophy Points:
    28
    cPanel Access Level:
    Root Administrator
    I also tried this and it appeared to work.
    In my case the email address was missing a letter from the domain name, I added the missing letter and the mail went from the queue.
    So when I say it worked, it's no longer stuck in the queue, so I assume it did, however, i don't see it in mailscanner.

    I found the message ID from the mail queue, so no need to grep.

    I have CSF explorer installed, so it was pretty easy to not only navigate and identify the header, but also modify and save it.
    This is one that I will have to test a little more and document for future.
     
    #5 keat63, Jun 22, 2018
    Last edited: Jun 22, 2018
  6. cPanelLauren

    cPanelLauren Forums Analyst II
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    3,517
    Likes Received:
    251
    Trophy Points:
    193
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @keat63

    I'm glad it worked for you, I wouldn't recommend using it often but it's good to know it's an option when something like this occurs.

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice