How to properly configure multiple accounts in mutt

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












1














There are many articles on this topic none of which work for me. The .muttrc has the following related to multiple accounts (only IMAP is used + of course SMTP):



source "~/.mutt/account1"
folder-hook $folder 'source ~/.mutt/account1'
source "~/.mutt/account2"
folder-hook $folder 'source ~/.mutt/account2'

macro index <f2> '<sync-mailbox><enter-command>source ~/.mutt/account1<enter><change-folder>!<enter>'
macro index <f3> '<sync-mailbox><enter-command>source ~/.mutt/account2<enter><change-folder>!<enter>'

# Mailboxes
bind index G imap-fetch-mail
macro index gi "<change-folder>=INBOX<enter>" "Go to Inbox"
macro index gs "<change-folder>=$my_sent<enter>" "Go to Sent"
macro index gd "<change-folder>=$my_drafts<enter>" "Go to Drafts"
macro index gt "<change-folder>=$my_trash<enter>" "Go to Trash"


The account files are as (e.g. for account1, the other one would be the same but the names of the folders would be in different language):



set my_drafts = "Drafts"
set my_drafts_noquote = "Drafts"
set my_sent = "Sent<quote-char><space>Items"
set my_sent_noquote = "Sent Items"
set my_trash = "Deleted<quote-char><space>Items"
set my_trash_noquote = "Deleted Items"
set imap_user = "username"
set folder = "imaps://outlook.office365.com:993/"
set imap_authenticators = "login"
set mbox = "+INBOX"
set spoolfile = "+INBOX"
set record = +$my_sent_noquote
set postponed = +$my_drafts_noquote
set trash = +$my_trash_noquote
set smtp_url = "smtp://username@smtp.office365.com:587"
set smtp_authenticators = "login"
set copy = "yes"
account-hook $folder "set imap_user=username"


So after starting mutt, i end up being in INBOX for account2. If I press gs, gd or gt all of them get me where I want to be (Sent folder, drafts or trash). Then I switch to account on by F2 and get to INBOX folder correctly but gs, gt, gd no longer work (Note that account1 and account2 use different names for trash, drafts and sent). (What it shows is "Sent items" does not exist but the words "sent items" are written in language of account2 but with malformed characters).



How do i need to correct the configuration?










share|improve this question


























    1














    There are many articles on this topic none of which work for me. The .muttrc has the following related to multiple accounts (only IMAP is used + of course SMTP):



    source "~/.mutt/account1"
    folder-hook $folder 'source ~/.mutt/account1'
    source "~/.mutt/account2"
    folder-hook $folder 'source ~/.mutt/account2'

    macro index <f2> '<sync-mailbox><enter-command>source ~/.mutt/account1<enter><change-folder>!<enter>'
    macro index <f3> '<sync-mailbox><enter-command>source ~/.mutt/account2<enter><change-folder>!<enter>'

    # Mailboxes
    bind index G imap-fetch-mail
    macro index gi "<change-folder>=INBOX<enter>" "Go to Inbox"
    macro index gs "<change-folder>=$my_sent<enter>" "Go to Sent"
    macro index gd "<change-folder>=$my_drafts<enter>" "Go to Drafts"
    macro index gt "<change-folder>=$my_trash<enter>" "Go to Trash"


    The account files are as (e.g. for account1, the other one would be the same but the names of the folders would be in different language):



    set my_drafts = "Drafts"
    set my_drafts_noquote = "Drafts"
    set my_sent = "Sent<quote-char><space>Items"
    set my_sent_noquote = "Sent Items"
    set my_trash = "Deleted<quote-char><space>Items"
    set my_trash_noquote = "Deleted Items"
    set imap_user = "username"
    set folder = "imaps://outlook.office365.com:993/"
    set imap_authenticators = "login"
    set mbox = "+INBOX"
    set spoolfile = "+INBOX"
    set record = +$my_sent_noquote
    set postponed = +$my_drafts_noquote
    set trash = +$my_trash_noquote
    set smtp_url = "smtp://username@smtp.office365.com:587"
    set smtp_authenticators = "login"
    set copy = "yes"
    account-hook $folder "set imap_user=username"


    So after starting mutt, i end up being in INBOX for account2. If I press gs, gd or gt all of them get me where I want to be (Sent folder, drafts or trash). Then I switch to account on by F2 and get to INBOX folder correctly but gs, gt, gd no longer work (Note that account1 and account2 use different names for trash, drafts and sent). (What it shows is "Sent items" does not exist but the words "sent items" are written in language of account2 but with malformed characters).



    How do i need to correct the configuration?










    share|improve this question
























      1












      1








      1







      There are many articles on this topic none of which work for me. The .muttrc has the following related to multiple accounts (only IMAP is used + of course SMTP):



      source "~/.mutt/account1"
      folder-hook $folder 'source ~/.mutt/account1'
      source "~/.mutt/account2"
      folder-hook $folder 'source ~/.mutt/account2'

      macro index <f2> '<sync-mailbox><enter-command>source ~/.mutt/account1<enter><change-folder>!<enter>'
      macro index <f3> '<sync-mailbox><enter-command>source ~/.mutt/account2<enter><change-folder>!<enter>'

      # Mailboxes
      bind index G imap-fetch-mail
      macro index gi "<change-folder>=INBOX<enter>" "Go to Inbox"
      macro index gs "<change-folder>=$my_sent<enter>" "Go to Sent"
      macro index gd "<change-folder>=$my_drafts<enter>" "Go to Drafts"
      macro index gt "<change-folder>=$my_trash<enter>" "Go to Trash"


      The account files are as (e.g. for account1, the other one would be the same but the names of the folders would be in different language):



      set my_drafts = "Drafts"
      set my_drafts_noquote = "Drafts"
      set my_sent = "Sent<quote-char><space>Items"
      set my_sent_noquote = "Sent Items"
      set my_trash = "Deleted<quote-char><space>Items"
      set my_trash_noquote = "Deleted Items"
      set imap_user = "username"
      set folder = "imaps://outlook.office365.com:993/"
      set imap_authenticators = "login"
      set mbox = "+INBOX"
      set spoolfile = "+INBOX"
      set record = +$my_sent_noquote
      set postponed = +$my_drafts_noquote
      set trash = +$my_trash_noquote
      set smtp_url = "smtp://username@smtp.office365.com:587"
      set smtp_authenticators = "login"
      set copy = "yes"
      account-hook $folder "set imap_user=username"


      So after starting mutt, i end up being in INBOX for account2. If I press gs, gd or gt all of them get me where I want to be (Sent folder, drafts or trash). Then I switch to account on by F2 and get to INBOX folder correctly but gs, gt, gd no longer work (Note that account1 and account2 use different names for trash, drafts and sent). (What it shows is "Sent items" does not exist but the words "sent items" are written in language of account2 but with malformed characters).



      How do i need to correct the configuration?










      share|improve this question













      There are many articles on this topic none of which work for me. The .muttrc has the following related to multiple accounts (only IMAP is used + of course SMTP):



      source "~/.mutt/account1"
      folder-hook $folder 'source ~/.mutt/account1'
      source "~/.mutt/account2"
      folder-hook $folder 'source ~/.mutt/account2'

      macro index <f2> '<sync-mailbox><enter-command>source ~/.mutt/account1<enter><change-folder>!<enter>'
      macro index <f3> '<sync-mailbox><enter-command>source ~/.mutt/account2<enter><change-folder>!<enter>'

      # Mailboxes
      bind index G imap-fetch-mail
      macro index gi "<change-folder>=INBOX<enter>" "Go to Inbox"
      macro index gs "<change-folder>=$my_sent<enter>" "Go to Sent"
      macro index gd "<change-folder>=$my_drafts<enter>" "Go to Drafts"
      macro index gt "<change-folder>=$my_trash<enter>" "Go to Trash"


      The account files are as (e.g. for account1, the other one would be the same but the names of the folders would be in different language):



      set my_drafts = "Drafts"
      set my_drafts_noquote = "Drafts"
      set my_sent = "Sent<quote-char><space>Items"
      set my_sent_noquote = "Sent Items"
      set my_trash = "Deleted<quote-char><space>Items"
      set my_trash_noquote = "Deleted Items"
      set imap_user = "username"
      set folder = "imaps://outlook.office365.com:993/"
      set imap_authenticators = "login"
      set mbox = "+INBOX"
      set spoolfile = "+INBOX"
      set record = +$my_sent_noquote
      set postponed = +$my_drafts_noquote
      set trash = +$my_trash_noquote
      set smtp_url = "smtp://username@smtp.office365.com:587"
      set smtp_authenticators = "login"
      set copy = "yes"
      account-hook $folder "set imap_user=username"


      So after starting mutt, i end up being in INBOX for account2. If I press gs, gd or gt all of them get me where I want to be (Sent folder, drafts or trash). Then I switch to account on by F2 and get to INBOX folder correctly but gs, gt, gd no longer work (Note that account1 and account2 use different names for trash, drafts and sent). (What it shows is "Sent items" does not exist but the words "sent items" are written in language of account2 but with malformed characters).



      How do i need to correct the configuration?







      mutt






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 11 at 16:05









      leosenko

      1776




      1776




















          1 Answer
          1






          active

          oldest

          votes


















          0














          I finally found the resolution, so if someone got in the same issue, the answer is to add to the account1 and account2 files mapping for the sortcuts, that is from muttrc, the lines



          bind index G imap-fetch-mail
          macro index gi "<change-folder>=INBOX<enter>" "Go to Inbox"
          macro index gs "<change-folder>=$my_sent<enter>" "Go to Sent"
          macro index gd "<change-folder>=$my_drafts<enter>" "Go to Drafts"
          macro index gt "<change-folder>=$my_trash<enter>" "Go to Trash"


          also have to be at the end of sourced accout1 and account2 files. It seems that mutt fills in the value of the variables when reading the configuration for the first time rather than keeping the variable and evaluate the expression for shortcut each time the shortcut is run with the actual variable value.






          share|improve this answer




















            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',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            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%2f487380%2fhow-to-properly-configure-multiple-accounts-in-mutt%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I finally found the resolution, so if someone got in the same issue, the answer is to add to the account1 and account2 files mapping for the sortcuts, that is from muttrc, the lines



            bind index G imap-fetch-mail
            macro index gi "<change-folder>=INBOX<enter>" "Go to Inbox"
            macro index gs "<change-folder>=$my_sent<enter>" "Go to Sent"
            macro index gd "<change-folder>=$my_drafts<enter>" "Go to Drafts"
            macro index gt "<change-folder>=$my_trash<enter>" "Go to Trash"


            also have to be at the end of sourced accout1 and account2 files. It seems that mutt fills in the value of the variables when reading the configuration for the first time rather than keeping the variable and evaluate the expression for shortcut each time the shortcut is run with the actual variable value.






            share|improve this answer

























              0














              I finally found the resolution, so if someone got in the same issue, the answer is to add to the account1 and account2 files mapping for the sortcuts, that is from muttrc, the lines



              bind index G imap-fetch-mail
              macro index gi "<change-folder>=INBOX<enter>" "Go to Inbox"
              macro index gs "<change-folder>=$my_sent<enter>" "Go to Sent"
              macro index gd "<change-folder>=$my_drafts<enter>" "Go to Drafts"
              macro index gt "<change-folder>=$my_trash<enter>" "Go to Trash"


              also have to be at the end of sourced accout1 and account2 files. It seems that mutt fills in the value of the variables when reading the configuration for the first time rather than keeping the variable and evaluate the expression for shortcut each time the shortcut is run with the actual variable value.






              share|improve this answer























                0












                0








                0






                I finally found the resolution, so if someone got in the same issue, the answer is to add to the account1 and account2 files mapping for the sortcuts, that is from muttrc, the lines



                bind index G imap-fetch-mail
                macro index gi "<change-folder>=INBOX<enter>" "Go to Inbox"
                macro index gs "<change-folder>=$my_sent<enter>" "Go to Sent"
                macro index gd "<change-folder>=$my_drafts<enter>" "Go to Drafts"
                macro index gt "<change-folder>=$my_trash<enter>" "Go to Trash"


                also have to be at the end of sourced accout1 and account2 files. It seems that mutt fills in the value of the variables when reading the configuration for the first time rather than keeping the variable and evaluate the expression for shortcut each time the shortcut is run with the actual variable value.






                share|improve this answer












                I finally found the resolution, so if someone got in the same issue, the answer is to add to the account1 and account2 files mapping for the sortcuts, that is from muttrc, the lines



                bind index G imap-fetch-mail
                macro index gi "<change-folder>=INBOX<enter>" "Go to Inbox"
                macro index gs "<change-folder>=$my_sent<enter>" "Go to Sent"
                macro index gd "<change-folder>=$my_drafts<enter>" "Go to Drafts"
                macro index gt "<change-folder>=$my_trash<enter>" "Go to Trash"


                also have to be at the end of sourced accout1 and account2 files. It seems that mutt fills in the value of the variables when reading the configuration for the first time rather than keeping the variable and evaluate the expression for shortcut each time the shortcut is run with the actual variable value.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 15 at 14:30









                leosenko

                1776




                1776



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f487380%2fhow-to-properly-configure-multiple-accounts-in-mutt%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown






                    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