Re: Copying IMAP folders with mutt
On Sat, Oct 15, 2022 at 10:27:29PM +0100, Chris Green wrote: How do I get it into interactive mode? I.e. run imapfilter with the /home/chris/.imapfilter/config.lua configuration and then allow me to run some commands to actually do things. All the examples I can find seem to actually put "things to run" in the /home/chris/.imapfilter/config.lua file which seems rather odd. I've tried running 'imapfilter -i' and it gets me an imapfilter command prompt but it seems to have forgotten everything in the configuration file. Working interactively isn't very confortable or easy, in my opinion, since the interactive prompt doesn't autocompletion or anything. I place all the commands into the configuration file and run them from there. I also have aditional configuration files for things I do at different times and I run them from cron at different intervals (hourly, daily, weekly) depending on what they actually do. Cheers, Ángel
Re: Copying IMAP folders with mutt
On Sat, Oct 15, 2022 at 10:27:29PM +0100, Chris Green wrote: How do I get it into interactive mode? I.e. run imapfilter with the /home/chris/.imapfilter/config.lua configuration and then allow me to run some commands to actually do things. All the examples I can find seem to actually put "things to run" in the /home/chris/.imapfilter/config.lua file which seems rather odd. I've tried running 'imapfilter -i' and it gets me an imapfilter command prompt but it seems to have forgotten everything in the configuration file. Try imapfilter -c $HOME/.imapfilter/config.lua Cheers, Ángel
Re: [SPAM] Copying IMAP folders with mutt
On Sat, Oct 15, 2022 at 09:04:37PM +0100, Chris Green wrote: > On Sat, Oct 15, 2022 at 08:46:17PM +0100, Chris Green wrote: > > Hmmm. > > > > I've installed imapfilter on my xubuntu linux system and I've created > > an imapfilter config file:- > > > > cwebin { > > server = 'mail.gridhost.co.uk', > > username = 'c...@isbd.co.uk', > > password = '', > > ssl = 'auto' > > } > > > > cwebout { > > server = 'x.y.zzz', > > username = 'c...@isbd.co.uk', > > password = '', > > ssl = 'auto' > > } > > > > ... and when I run imapfilter it just says:- > > > > chris$ imapfilter > > imapfilter: /home/chris/.imapfilter/config.lua:1: attempt to call global > > 'cwebin' (a nil value) > > stack traceback: > > [C]: in function 'cwebin' > > /home/chris/.imapfilter/config.lua:1: in main chunk > > chris$ > > > > Not being a lua guru I'm a bit stuck! > > > OK, looking at some examples I've got a bit further, imapfilter is now:- > > local cwebin = IMAP { > server = 'mail.gridhost.co.uk', > username = 'c...@isbd.co.uk', > password = 'brzmibew', > ssl = 'auto' > } > > local cwebout = IMAP { > server = 'x.y.zzz', > username = 'c...@isbd.co.uk', > password = 'brzmibew', > ssl = 'auto' > } > > It works, sort of. > > How do I get it into interactive mode? I.e. run imapfilter with the > /home/chris/.imapfilter/config.lua configuration and then allow me to > run some commands to actually do things. > All the examples I can find seem to actually put "things to run" in the /home/chris/.imapfilter/config.lua file which seems rather odd. I've tried running 'imapfilter -i' and it gets me an imapfilter command prompt but it seems to have forgotten everything in the configuration file. -- Chris Green
Re: [SPAM] Copying IMAP folders with mutt
On Sat, Oct 15, 2022 at 08:46:17PM +0100, Chris Green wrote: > Hmmm. > > I've installed imapfilter on my xubuntu linux system and I've created > an imapfilter config file:- > > cwebin { > server = 'mail.gridhost.co.uk', > username = 'c...@isbd.co.uk', > password = '', > ssl = 'auto' > } > > cwebout { > server = 'x.y.zzz', > username = 'c...@isbd.co.uk', > password = '', > ssl = 'auto' > } > > ... and when I run imapfilter it just says:- > > chris$ imapfilter > imapfilter: /home/chris/.imapfilter/config.lua:1: attempt to call global > 'cwebin' (a nil value) > stack traceback: > [C]: in function 'cwebin' > /home/chris/.imapfilter/config.lua:1: in main chunk > chris$ > > Not being a lua guru I'm a bit stuck! > OK, looking at some examples I've got a bit further, imapfilter is now:- local cwebin = IMAP { server = 'mail.gridhost.co.uk', username = 'c...@isbd.co.uk', password = 'brzmibew', ssl = 'auto' } local cwebout = IMAP { server = 'x.y.zzz', username = 'c...@isbd.co.uk', password = 'brzmibew', ssl = 'auto' } It works, sort of. How do I get it into interactive mode? I.e. run imapfilter with the /home/chris/.imapfilter/config.lua configuration and then allow me to run some commands to actually do things. -- Chris Green
Re: [SPAM] Copying IMAP folders with mutt
On Sat, Oct 15, 2022 at 08:10:03PM +0200, Angel M Alganza wrote: > Hi Chris, > > On Sat, Oct 15, 2022 at 06:29:37PM +0100, Chris Green wrote: > > > I'm now considering using mutt to move some IMAP folders from one > > server to another, both IMAP servers will be remote. Is this a > > sensible idea or should I look for a specialised tool? > > I have ocasionally used Mutt with more than one IMAP server at the same > time, so I'm quite confident that could be done with just Mutt. > > I would use Imapfilter, though, which I believe would be a more > appropriate tool for that. It would take very minimal configuration, > just the servers configuration (account1 and account2) and a couple of > lines for the origin and destination folders, something like: > > messages = account1["INBOX"]:select_all() > messages:copy_messages(account2["INBOX"]) > > to copy everything to the new server, or to move it, replacing the > second line with something like this one: > > messages:move_messages(account2["INBOX"]) > Hmmm. I've installed imapfilter on my xubuntu linux system and I've created an imapfilter config file:- cwebin { server = 'mail.gridhost.co.uk', username = 'c...@isbd.co.uk', password = '', ssl = 'auto' } cwebout { server = 'x.y.zzz', username = 'c...@isbd.co.uk', password = '', ssl = 'auto' } ... and when I run imapfilter it just says:- chris$ imapfilter imapfilter: /home/chris/.imapfilter/config.lua:1: attempt to call global 'cwebin' (a nil value) stack traceback: [C]: in function 'cwebin' /home/chris/.imapfilter/config.lua:1: in main chunk chris$ Not being a lua guru I'm a bit stuck! -- Chris Green
Re: [SPAM] Copying IMAP folders with mutt
Hi Chris, On Sat, Oct 15, 2022 at 06:29:37PM +0100, Chris Green wrote: I'm now considering using mutt to move some IMAP folders from one server to another, both IMAP servers will be remote. Is this a sensible idea or should I look for a specialised tool? I have ocasionally used Mutt with more than one IMAP server at the same time, so I'm quite confident that could be done with just Mutt. I would use Imapfilter, though, which I believe would be a more appropriate tool for that. It would take very minimal configuration, just the servers configuration (account1 and account2) and a couple of lines for the origin and destination folders, something like: messages = account1["INBOX"]:select_all() messages:copy_messages(account2["INBOX"]) to copy everything to the new server, or to move it, replacing the second line with something like this one: messages:move_messages(account2["INBOX"]) It's only a one off requirement, once it's done I won't be using mutt with IMAP again. It just seems that as I'm fairly familiar with mutt it might be the easiest way to do this. It's only five or six accounts I want to move, with only a few (mostly just the default ones) IMAP folders. Since you say you never use Mutt with IMAP, I asume you either already have your mail locally or you will want to fetch it later. So, another very good way to do the move from one IMAP server to another one would be using mbsync (iSync), which is desined to synchronise IMAP folders. I would first mbsync the folders in the origin server to localhost folders and then localhost folders to the destination server. I hope any of the two alternatives help, should you decide use a dedicated tool instead of doing the move with Mutt. Cheers, Ángel
Re: Copying IMAP folders with mutt
On Saturday, 15.10.2022 at 18:29 +0100, Chris Green wrote: > I am a long time user of mutt (many, many years). I use it with mail > delivered directly to a maildir hierarchy. > > I have occasionally tried it with IMAP4 but it never seemed to be > ideal to me. However I'm now considering using mutt to move some IMAP > folders from one server to another, both IMAP servers will be remote. > Is this a sensible idea or should I look for a specialised tool? It's > only a one off requirement, once it's done I won't be using mutt with > IMAP again. It just seems that as I'm fairly familiar with mutt it > might be the easiest way to do this. It's only five or six accounts I > want to move, with only a few (mostly just the default ones) IMAP > folders. > > So, to a couple of specific questions:- > > Can mutt handle folders on more than one IMAP4 server? > > Can I use a numeric IP for a server? > > Is there a 'move folder' command which can have a different IMAP > server for 'from' and 'to'? No problem using Mutt for this. I've done exactly this. The answer to your first two questions is definitely Yes. The answer to 'move folder' is I don't think so, but what I did was create empty folders on the target folder and then tag-and-select-all-messages for each folder in turn to copy across. Dave. -- Dave Ewart, da...@sungate.co.uk signature.asc Description: PGP signature
Copying IMAP folders with mutt
I am a long time user of mutt (many, many years). I use it with mail delivered directly to a maildir hierarchy. I have occasionally tried it with IMAP4 but it never seemed to be ideal to me. However I'm now considering using mutt to move some IMAP folders from one server to another, both IMAP servers will be remote. Is this a sensible idea or should I look for a specialised tool? It's only a one off requirement, once it's done I won't be using mutt with IMAP again. It just seems that as I'm fairly familiar with mutt it might be the easiest way to do this. It's only five or six accounts I want to move, with only a few (mostly just the default ones) IMAP folders. So, to a couple of specific questions:- Can mutt handle folders on more than one IMAP4 server? Can I use a numeric IP for a server? Is there a 'move folder' command which can have a different IMAP server for 'from' and 'to'? -- Chris Green