Discussion:
[sup] Best hacks for multiple sent_source folders
Matthew Bloch
2014-12-21 04:17:56 UTC
Permalink
Hello sup users,

I've nearly got my sup setup ready to replace various other clients. What's
everyone's current best advice for filing outgoing email in folders by
account? i.e. personal email to be filed in ~/mail/Personal/Sent, work
email to be filed in ~/mail/Work/Sent ? (both synchronised by offlineimap
for me)

I can see a few ways to make that happen but nothing too recent. Thanks!
--
Matthew
--
You received this message because you are subscribed to the Google Groups "The Sup email client" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supmua+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/supmua/d4b89c3f-9010-438a-804f-7c7d18d4134e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Ruthard Baudach
2014-12-22 11:23:00 UTC
Permalink
Post by Matthew Bloch
Hello sup users,
I've nearly got my sup setup ready to replace various other clients. What's
everyone's current best advice for filing outgoing email in folders by
account? i.e. personal email to be filed in ~/mail/Personal/Sent, work
email to be filed in ~/mail/Work/Sent ? (both synchronised by offlineimap
for me)
I can see a few ways to make that happen but nothing too recent. Thanks!
--
Matthew
This is an old wish from me, and as far as I know it, it's not possible
at the moment.

The suppish way to do this would be to automatically add labels to the
outgoing mail rather than putting them in folders. I don't know
offlineimap, as far as I got it, it synchronizes labels and imap
folders, thus completing this task.

The place to do this would be in the sendmail hook (or to create an
extra, let's say before-send hook for this, so that the sendmail hook
needs not to implement mail sending.)

Alas, the message object passed to this hook does not contain labels and
is not passed back to update anything in sup.

I did not manage to change this in a reasonable time, perhaps it would
indeed be easier to add a before-send hook to do this.

The place to do this would be in lib/sup/modes/edit-message-mode.rb, as
far as I found out.

So you could either polish up your ruby and look into it and submit a
patch, or wait till someone else does it.

Best Regards,

Ruthard
--
Please sign and encrypt mails!
My PGP-Id: 0xAC5AC6C2
--
You received this message because you are subscribed to the Google Groups "The Sup email client" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supmua+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/supmua/1419246610-sup-3120%40ruthard-lappi.
For more options, visit https://groups.google.com/d/optout.
Gaute Hope
2014-12-24 11:31:30 UTC
Permalink
Post by Ruthard Baudach
Post by Matthew Bloch
Hello sup users,
I've nearly got my sup setup ready to replace various other clients. What's
everyone's current best advice for filing outgoing email in folders by
account? i.e. personal email to be filed in ~/mail/Personal/Sent, work
email to be filed in ~/mail/Work/Sent ? (both synchronised by offlineimap
for me)
I can see a few ways to make that happen but nothing too recent. Thanks!
--
Matthew
This is an old wish from me, and as far as I know it, it's not possible
at the moment.
The suppish way to do this would be to automatically add labels to the
outgoing mail rather than putting them in folders. I don't know
offlineimap, as far as I got it, it synchronizes labels and imap
folders, thus completing this task.
The place to do this would be in the sendmail hook (or to create an
extra, let's say before-send hook for this, so that the sendmail hook
needs not to implement mail sending.)
Alas, the message object passed to this hook does not contain labels and
is not passed back to update anything in sup.
I did not manage to change this in a reasonable time, perhaps it would
indeed be easier to add a before-send hook to do this.
The place to do this would be in lib/sup/modes/edit-message-mode.rb, as
far as I found out.
So you could either polish up your ruby and look into it and submit a
patch, or wait till someone else does it.
Have a look at Matthieu's patch over at #320. You might try
rebasing it on top of latest 'develop'.

#320: https://github.com/sup-heliotrope/sup/pull/320

- gaute
--
You received this message because you are subscribed to the Google Groups "The Sup email client" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supmua+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/supmua/1419420510-astroid-1-kyzzesh3ck-5557%40strange.
For more options, visit https://groups.google.com/d/optout.
Matthew Bloch
2014-12-29 14:21:18 UTC
Permalink
Well, I'm not too proud, but this on a cron job does what I need! If I get
some time to dig into the sup source, I might have a stronger opinion about
how/whether to integrate this sort of thing. My instinct is "no", sup copes
with messages being moved around under it, and offlineimap does the right
thing too.

#!/usr/bin/ruby
require 'mail'

BASE = "/home/mattbee/mail"

SOURCE = "#{BASE}/sup.sent"

FROM_ADDRESS_TO_SENT_FOLDER_MAP = {
"***@work" => "#{BASE}/Work/Sent",
"***@personal" => "#{BASE}/Personal/Sent",
"***@othercompany" => "#{BASE}/Othercompany/Sent"
}

%w( cur new ).each do |d|
d = "#{SOURCE}/#{d}"
Dir.new(d).entries.each do |e|
f = "#{d}/#{e}"
next unless File.file?(f)
mail = Mail.read(f)
maildir = FROM_ADDRESS_TO_SENT_FOLDER_MAP[mail.from.first]
if !maildir
STDERR.print "Unknown From address in #{f}\n"
else
# STDERR.print "Moving #{f} to #{maildir}\n"
File.rename(f, "#{maildir}/cur/#{e}")
end
end
end
--
You received this message because you are subscribed to the Google Groups "The Sup email client" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supmua+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/supmua/4dd537d6-3651-4040-b313-c271e0842fbe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...