How to delete emails for mutt?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I need to know if there is a way to delete messages off mutt mailarchive. I tried to do it in the following way:



#!/bin/bash
#
#
# Usage:
# ~r : DELETE
# 1y! : 1 year
# 2y! : 2 years
# 7d! : 7 days
# 30d! : 30 days
#

mailbox="/path/to/user/mailbox"
deletePattern="7d!"

mutt -f $mailbox -F/dev/null -e "push <delete-pattern>~r>$deletePattern<enter><sync-mailbox>y<enter><exit>q"


But the syntax is not deleting the entire messages. This is the way that someone told me in order to do it manually:




  • ssh into the SMTP server.

  • Run the command: mutt -f /var/mail/mailarchive. After the command is finished running, press D

  • Then type in ~d dd/mm/yyyy-dd/mm/yyyy which is the date range to delete the files. Example: ~d 01/06/2018-15/06/2018

  • Press q to quit

  • Then a prompt will come up to confirm. Press y.

  • Pressing q and then y might need to be done a few times before the delete kicks off.

  • Then check in the Postfix portal in the user mailboxes to see if the deletion worked.









share|improve this question



























    up vote
    0
    down vote

    favorite












    I need to know if there is a way to delete messages off mutt mailarchive. I tried to do it in the following way:



    #!/bin/bash
    #
    #
    # Usage:
    # ~r : DELETE
    # 1y! : 1 year
    # 2y! : 2 years
    # 7d! : 7 days
    # 30d! : 30 days
    #

    mailbox="/path/to/user/mailbox"
    deletePattern="7d!"

    mutt -f $mailbox -F/dev/null -e "push <delete-pattern>~r>$deletePattern<enter><sync-mailbox>y<enter><exit>q"


    But the syntax is not deleting the entire messages. This is the way that someone told me in order to do it manually:




    • ssh into the SMTP server.

    • Run the command: mutt -f /var/mail/mailarchive. After the command is finished running, press D

    • Then type in ~d dd/mm/yyyy-dd/mm/yyyy which is the date range to delete the files. Example: ~d 01/06/2018-15/06/2018

    • Press q to quit

    • Then a prompt will come up to confirm. Press y.

    • Pressing q and then y might need to be done a few times before the delete kicks off.

    • Then check in the Postfix portal in the user mailboxes to see if the deletion worked.









    share|improve this question

























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I need to know if there is a way to delete messages off mutt mailarchive. I tried to do it in the following way:



      #!/bin/bash
      #
      #
      # Usage:
      # ~r : DELETE
      # 1y! : 1 year
      # 2y! : 2 years
      # 7d! : 7 days
      # 30d! : 30 days
      #

      mailbox="/path/to/user/mailbox"
      deletePattern="7d!"

      mutt -f $mailbox -F/dev/null -e "push <delete-pattern>~r>$deletePattern<enter><sync-mailbox>y<enter><exit>q"


      But the syntax is not deleting the entire messages. This is the way that someone told me in order to do it manually:




      • ssh into the SMTP server.

      • Run the command: mutt -f /var/mail/mailarchive. After the command is finished running, press D

      • Then type in ~d dd/mm/yyyy-dd/mm/yyyy which is the date range to delete the files. Example: ~d 01/06/2018-15/06/2018

      • Press q to quit

      • Then a prompt will come up to confirm. Press y.

      • Pressing q and then y might need to be done a few times before the delete kicks off.

      • Then check in the Postfix portal in the user mailboxes to see if the deletion worked.









      share|improve this question















      I need to know if there is a way to delete messages off mutt mailarchive. I tried to do it in the following way:



      #!/bin/bash
      #
      #
      # Usage:
      # ~r : DELETE
      # 1y! : 1 year
      # 2y! : 2 years
      # 7d! : 7 days
      # 30d! : 30 days
      #

      mailbox="/path/to/user/mailbox"
      deletePattern="7d!"

      mutt -f $mailbox -F/dev/null -e "push <delete-pattern>~r>$deletePattern<enter><sync-mailbox>y<enter><exit>q"


      But the syntax is not deleting the entire messages. This is the way that someone told me in order to do it manually:




      • ssh into the SMTP server.

      • Run the command: mutt -f /var/mail/mailarchive. After the command is finished running, press D

      • Then type in ~d dd/mm/yyyy-dd/mm/yyyy which is the date range to delete the files. Example: ~d 01/06/2018-15/06/2018

      • Press q to quit

      • Then a prompt will come up to confirm. Press y.

      • Pressing q and then y might need to be done a few times before the delete kicks off.

      • Then check in the Postfix portal in the user mailboxes to see if the deletion worked.






      bash mutt






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 9 at 20:41









      Rui F Ribeiro

      36.8k1272117




      36.8k1272117










      asked Aug 31 at 14:43









      user3513091

      12




      12

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f466058%2fhow-to-delete-emails-for-mutt%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f466058%2fhow-to-delete-emails-for-mutt%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay