Sometimes Apple Mail rules are not enough, so we have AppleScript to do whatever we want, this is how i automate mine:
tell application “Mail”
set |messages| to messages of mailbox “Inbox” of account “MyAccount”
repeat with |message| in |messages|
set |one day| to (30 * days)
set |date limit| to ((current date) – |one day|)
if date received of |message| is less than |date limit| and flagged status of |message| is false then
move |message| to mailbox “OldMail/Inbox” –on my mac
end if
end repeat
set |messages| to messages of mailbox “Spam” of account “MyAccount”
repeat with |message| in |messages|
set |one day| to (1 * days)
set |date limit| to ((current date) – |one day|)
if date received of |message| is less than |date limit| and flagged status of |message| is false then
delete |message| –account trash
end if
end tell
Source: http://luizsiqueiraneto.tumblr.com/post/26988382255/how-to-periodically-move-to-trash-old-messages, http://hints.macworld.com/article.php?story=20081019114709793
Wednesday, August 28, 2013
Convert PST to MBOX
Importing from outlook to apple mail not difficult at all, at your mac os terminal:
1) install libpst (macports required)
sudo port install libpst
2) convert the pst
readpst -o <output directory> <my pst file>.pst
3) Import
At apple mail: File > Import mailboxes > Files in mbox format
thats all
Thursday, May 3, 2012
telnet: sending a mail with smtp
How to test SMTP using telnet, just like this:
$telnet <smtpserver> 25
ehlo
mail from: <source mail>
rcpt to: <target mail>
data
<all content you want>
.
quit
$telnet <smtpserver> 25
ehlo
mail from: <source mail>
rcpt to: <target mail>
data
<all content you want>
.
quit
Monday, April 30, 2012
How to execute ssh command and stay logged in
After using implicit authentication a new challenge came, how to exec a command and stay logged in. just like this:
ssh -t <user>@<host> "ls -l; bash -login"
ssh -t <user>@<host> "ls -l; bash -login"
Thursday, April 26, 2012
look for a class on a bunch of jars...
Challenge: how to find a class inside a lot of jars which are inside an unknown directory hierarchy.
Answer: bash scripting
find . -name "*.jar" -exec jar tvf '{}' \; -print | grep -e "<classname>.class" -e "\./"
Answer: bash scripting
find . -name "*.jar" -exec jar tvf '{}' \; -print | grep -e "<classname>.class" -e "\./"
Wednesday, April 25, 2012
WCF JSON & SOAP Servce
Exposing services to mobile devices has some challenges, first JSON is efficient reason why iOS and Android make it them standard but SOAP is "the standard" and have a well defined contract. So we do not have to choose... we can have both using WCF.
Ill try to keep this simple, what we need to do is publish one WCF with two endpoints, one for JSON and one for SOAP, so this the solution:
Ill try to keep this simple, what we need to do is publish one WCF with two endpoints, one for JSON and one for SOAP, so this the solution:
Wednesday, July 18, 2007
About quering solved
Two months ago i write about real quering, trying to solve 3 issues in a single store procedure for SqlServer 2005: Dinamic criteria, dinamic paging and dinamic ordering. The solution i give last time doesnt contemplate using ordering, but i finally got it. I really dont know why no one have published something like this, cause i spend some hours around internet, in fact it makes me think i havent seen something, but from my point of view it works well.
Why i bother spending some time looking for this answer, if some post show the easy solution: generate the sentence dinamically inside the procedure, well... two smasing reasons... security and speed. And if you think, what others reasons do you have to make store procedures?, maybe none. So if you make the sentence dinamically you have to give permissions to the tables... no good, and therefore you lose speed cause SqlServer have compile the sentence each time it excecute... no good again.
Why i bother spending some time looking for this answer, if some post show the easy solution: generate the sentence dinamically inside the procedure, well... two smasing reasons... security and speed. And if you think, what others reasons do you have to make store procedures?, maybe none. So if you make the sentence dinamically you have to give permissions to the tables... no good, and therefore you lose speed cause SqlServer have compile the sentence each time it excecute... no good again.
Subscribe to:
Posts (Atom)