* Best hacks for multiple sent_source folders
@ 2014-12-21 4:17 Matthew Bloch
2014-12-22 11:23 ` [sup] " Ruthard Baudach
2014-12-29 14:21 ` Matthew Bloch
0 siblings, 2 replies; 4+ messages in thread
From: Matthew Bloch @ 2014-12-21 4:17 UTC (permalink / raw)
To: supmua
[-- Attachment #1.1: Type: text/plain, Size: 410 bytes --]
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
[-- Attachment #1.2: Type: text/html, Size: 454 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [sup] Best hacks for multiple sent_source folders
2014-12-21 4:17 Best hacks for multiple sent_source folders Matthew Bloch
@ 2014-12-22 11:23 ` Ruthard Baudach
2014-12-24 11:31 ` Gaute Hope
2014-12-29 14:21 ` Matthew Bloch
1 sibling, 1 reply; 4+ messages in thread
From: Ruthard Baudach @ 2014-12-22 11:23 UTC (permalink / raw)
To: supmua
[-- Attachment #1: Type: text/plain, Size: 1589 bytes --]
>== Auszüge aus der Nachricht von Matthew Bloch vom 2014-12-21 05:17:
> 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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [sup] Best hacks for multiple sent_source folders
2014-12-22 11:23 ` [sup] " Ruthard Baudach
@ 2014-12-24 11:31 ` Gaute Hope
0 siblings, 0 replies; 4+ messages in thread
From: Gaute Hope @ 2014-12-24 11:31 UTC (permalink / raw)
To: Ruthard Baudach, supmua
Excerpts from Ruthard Baudach's message of December 22, 2014 12:23:
>>== Auszüge aus der Nachricht von Matthew Bloch vom 2014-12-21 05:17:
>> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Best hacks for multiple sent_source folders
2014-12-21 4:17 Best hacks for multiple sent_source folders Matthew Bloch
2014-12-22 11:23 ` [sup] " Ruthard Baudach
@ 2014-12-29 14:21 ` Matthew Bloch
1 sibling, 0 replies; 4+ messages in thread
From: Matthew Bloch @ 2014-12-29 14:21 UTC (permalink / raw)
To: supmua
[-- Attachment #1.1: Type: text/plain, Size: 1002 bytes --]
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 = {
"matthew@work" => "#{BASE}/Work/Sent",
"matthew@personal" => "#{BASE}/Personal/Sent",
"matthew@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
[-- Attachment #1.2: Type: text/html, Size: 1334 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-12-29 14:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-21 4:17 Best hacks for multiple sent_source folders Matthew Bloch
2014-12-22 11:23 ` [sup] " Ruthard Baudach
2014-12-24 11:31 ` Gaute Hope
2014-12-29 14:21 ` Matthew Bloch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox