Mail rule to modify e-mail header (via external command line tool)

Hello,
Apple Mail lets me add AppleScripts which will be executed whenever this rule is being called.
I have some command line tools that lets me add some information to the e-mail's header. For example, spamprobe (a anti spam tool, which works perfectly for me) would add an e-mail header like
X-SpamProbe: SPAM 0.9999749 8aba943058c55bb20bd974fc534b71cc
or clamdscan would add (in combination with the command line tool formail) add information about viruses into the e-mail header, such as
X-Virus: [clamscan] Heuristics.Phishing.Email.SpoofedDomain FOUND
After marking the e-mails, spam can be easily filtered out. Currently I'm using procmail to call all those external tools. They work much more accurate for me than Apple Mail's built-in spamfilter.
Now, however, I want to keep my mail on an IMAP server, thus, procmail does not work anymore. (procmail works only on local e-mails.) Is there any way to "stamp" incoming mails with Apple Mail by an external command line tool, leaving the mail at the end on the IMAP server? It should be the following workflow:
Apple Mail checks new mails and calls a rule on any e-mail which sends a copy of the mail to an external command line tool
The command line tool adds information to the given e-mail (e.g., virus or spam information)
Apple Mail "replaces" the e-mail on the IMAP server with the altered e-mail
Apple Mail calls another rule which filters all detected spam e-mails
Is Mail + AppleScript that flexible to include the use of external command line tools?
Certainly, an even better alternative would be to have a tool like procmail which could work directly on messages on IMAP servers. However, I'm not aware of any that could do that.
Thanks for any comment.
Claus

If you want to execute a command line as a mail rule you could define an apple script that executes the command line,
for example
tell application "Finder"
  do shell script "ls"
end tell
executes the shell command "ls"
For "ls" substitute your command line command.

Similar Messages

  • Checkin activity via DTR command line tool

    Hello,
    I tried to maintain Access Control Lists in my DTR (Web AS 640, SP16), and now I have a weird situation:
    The NW Developer Studio shows that acl.xml unter /ws is checked out by user superadmin (that's correct as I used that one to maintain the ACLs), but it doesn't show any activity of superadmin.
    DTR command line tool shows the activity:
    >acts -U superadmin -o -uf
    ActualName      State
    act_w_system_config_active_u_superadmin_t_2006_06_06_12_42_33_GMT_6dca269b-9cb4-4d96-a663-fbe98c715265  Open
    But when I try to checkin the tool cannot find the activity any more:
    >checkin -a act_w_system_config_active_u_superadmin_t_2006_06_06_12_42_33_GMT_6dca269b-9cb4-4d96-a663-fbe98c715265 -w //
    system/config/active/ -U superadmin
    The specified activity does not exist. Please check and try again.
    Any idea how I can get rid of this lock on acl.xml in /ws?
    Thanks and best regards,
    Cornelia

    Hi,
    perhaps your release is higher equal to 711.
    From 7.11 onwards the DI command line tools are not provided in the eclipse/tools folder anymore.
    Instead they are provdided in the SCA file DICLIENTS.SCA  --> tcdicmd_tools~sda.sda
    Extract this SDA file from the SCA and then unzip it to get the DI command line tools.
    Hint: Once you rename the SCA to zip, you can extract with a normal extractor like winzip or winrar. Once you managed to extract the file tcdicmd_tools~sda.sda rename it also to zip and extract it too using normal extractor tools. Then you'll have a similar folder structure like on lower releases in the eclipse/tools folder was.
    You find the SCA file here:
    http://service.sap.com/patches --> Browse our Download Catalog - SAP NetWeaver and complementary products
    -- SAP NETWEAVER CE -- SAP EHP1 FOR SAP NW CE 7.1 -- Entry by Component -- NW Development
    Infrastructure --> DI CLIENTS 7.11
    (Obviously if you have 720 or 730 then adjust the path accordingly)
    See also https://cw.sdn.sap.com/cw/docs/DOC-109423
    I hope this helps.
    Best Regards,
    Ervin

  • Launch remote control via a command line?

    Is is possible to launch a remote control session via a command line as well
    as the other "remote actions"?
    Thanks,
    Bryan

    On Wed, 29 Sep 2004 22:25:17 GMT, Bryan Miller wrote:
    > Is is possible to launch a remote control session via a command line as well
    > as the other "remote actions"?
    take a look at the online documentation which describes this..
    Marcus Breiden
    Please change -- to - to mail me.
    The content of this mail is my private and personal opinion.
    http://www.edu-magic.net

  • Can I manage resource designates via the command line?

    I would like to manage resource designates via the command line and
    the <i>"unires"</i> command does not seem to have this function. Could I use
    <i>"uniadmrights"</i>?
    # uniadmrights -e -add -resrc -n 10000
    <br>
    -e modify user rights, search filter
    <br>
    -add set user right on (-e only, default)
    <br>
    -resrc resource administration
    <p>
    The <I>uniadmrights</I> command is not able to assign designate rights. You can assign
    rights such as the ability to create and manage public and administration
    groups. The "Resource administration" flag exists so far only on the
    server side, and it is currently not used by the client. This is for future use.
    <p>
    There are two ways to assign a designate to a resource:
    <ol>
    <LI>Log on as the resource via the client. There are only a few commands
    available, one of them being the "Access Rights".
    <P>
    <LI>On the server side:
    <P>
    Edit the /users/unison/misc/resource.ini
    file and create a new section to specify the resource designate.
    <P>
    [DES]
    Designate0 = S=Lastname/G=Firstname
    <P>
    Run the unires command as follows:
    <P>
    % unires -mod "R=resourcename" -s DES 10000
    [sysOpPsw]
    </OL>
    <P>
    <B>Note:</B> The full resource name should be used eg. "R=Resource/N=1/CA=2/ID=2
    57"

    This sounds like a job for wget . You'll have to build and run it on Unix or Cygwin.
    You could also build a test suite to do this in various testing tools. You could even write a short Perl or Groovy script to do this, or a slightly longer Java class.

  • HT1428 How to change the account name in Mac OS X via a command line. I did a type-o on the account name. So instead of it saying "Company" it says "Comany"  for the account logon.

    How to change the account name in Mac OS X via a command line. When I created the account I mistyped the name. I have a management suite where I can execute remote scripts. I would like to run a script that changes the name from oldname to newname.
    None of these Macs have been used currently.
    Thank you,
    Brian

    If user account shortname, see Changing user account shortname

  • Fail to build SSIS/SSAS projects via VS2012 command line (devenv.exe) with SSDT BI tool installed

    Hello,
    I installed recently released SSDT BI tools for VS2012 and I can work on my existing SSIS/SSAS projects all well in VS2012. But when I try to build my SSIS/SSAS projects via the command line of VS2012, such as
    devenv.exe mySolution.sln /rebuild Release /out "C:\temp\buildLog.txt"
    I will get the error like below in the log file.
    Error: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
    Is this a known issue? If yes, any fix has been planned?
    Thanks
    Jimmy

    Hi Jimmy Jin,
    This sounds like .NET framework problem, please refer to:
    http://bchavez.bitarmory.com/archive/2007/08/23/catastrophic-failure-exception-from-hresult-0x8000ffff-e_unexpected.aspx
    http://bchavez.bitarmory.com/archive/2007/08/23/catastrophic-failure-exception-from-hresult-0x8000ffff-e_unexpected.aspx
    Thanks,
    Eileen
    If you have any feedback on our support, please click
    here
    Eileen Zhao
    TechNet Community Support

  • Setting proxy servers via the command line

    I am looking to find out how to set up the system to use http and https proxies via the command line instead of through system preferences. How do I do this. I have basic command line knowledge.

    This information is stored in a plist file and is easiest to manipulate with PlistBuddy. For example, to set the HTTP proxy name, use:
    /usr/libexec/PlistBuddy -c "Set NetworkServices:6CFBA910-E4A0-4418-82E5-66A6480EBC71:Proxies:HTTPProxy http://my.proxy.com" /Library/Preferences/SystemConfiguration/preferences.plist
    Note: 6CFBA910-E4A0-4418-82E5-66A6480EBC71 is a UUID and likely to be unique on each machine. I don't have another Mac handy to check this. If so, you'll need to do some heavy to find out which one is the interface you need to address.
    Try man PlistBuddy and/or a web search for more information on how this tool can be used.
    Try man PlistBuddy or a web searc for more info on using it.

  • I will starting afresh website in my iWeb, it shows only the head or the command line and the command new website is inactive - what do I need to start over

    Help........
    I will starting afresh website in my iWeb, when I start the program it only shows the head or the command line and the command new website is inactive - what do I need to start over - what have I done wrong

    Don't quite understand what you mean, but it says at the bottom that you are still using iWeb 08 so depending on what OSX you are running, you might consider upgrading to iWeb 09.  This works with Lion, Mountain Lion and Mavericks.
    Apple no longer sells iWeb so if you decide to upgrade, then you'll need to purchase iWeb by going to Amazon and buying the iLife 09 or 11 boxed sets, both of which contain iWeb 09.
    Install this on your Mac and it might solve your problems, or just ditch iWeb and start again with one of the newer programmes out there that are still being supported and updated, such as RapidWeaver, Sandvox, Freeway Pro/Express, Flux 4, WebAcapella 4 and EverWeb (http://www.everwebapp.com).

  • Automating sql files via a command line prompt

    Hi All
    I've set up an SQL file that extracts information about students in csv format. This information is then imported into another piece of software that creates students e-mail accounts etc..
    The program prompts the user to specify from when they want the data from e.g. list of student details that enrolled after 01-SEP-2002.
    The Network Manager has now asked me if there is any way the extraction of the student data and import into the e-mail creation software can be automated. He suggested command line prompts as used in DOS e.g. dir/od *.sql > test where dir gives the directory the od orders the files by date.
    The Network Manager wanted the extraction and import procedure run on a regular basis by simply just typing a 'command line'. The extraction would take place on an hourly basis especially during the main enrolment periods
    Can anybody help me?
    Thanks
    Jen

    I work mainly with UNIX, so cannot give you the actual DOS commands, but I would structure the program as below. I assume that you have some way of identifying the last enrollment you extract.
    In psuedo code:
    Set up any environment variables required
    sqlplus -s user/password@enrollment_server @student_extract.sql
      -- student_extract.sql would spool to a fixed name file say enrollment.txt
      -- after extracting, it would update a single column, single row table with the
      -- the identifying field for the last enrollment extracted (this would also
      -- be used in the extract query as the lower bound)
    Reset any environment variables required to connect to the email server
    sqlplus -s user/password@email_server @load_email.sql
      -- load_email.sql would read enrollment.txt and do whatever is required
    rename enrollment.txt to enrollment.txt.current-date-timeThis could be run out of an automatic scheduler if you have one, or manually from the command line.
    HTH
    John

  • How do I open a PDF to a specific page via the command line?

    Several questions about opening PDFs from the Mac OS X command line:
    1) How do I use the "open" command to open a PDF to a specific page? (I know I can open a document via: open doc_name.pdf)
    2) How do I use the "open" command to pass multiple arguments (page no, zoom scale, view mode, etc...) to open a PDF file in a specific manner?
    3) Does Preview handle the same parameters as Acrobat Reader? If not, what are the differences in options?
    I've spent hours searching for this answer and have come up dry. I've downloaded Adobe's "PDF Open Parameters" document -- it lists all of the parameters I need, however I can't get any of them to work from the command line.
    My goal: Open a PDF from the command line to a specific page. At first glance, I thought this would be simple to do and find -- however, after a lot of searching I haven't found an example on how to do it.
    Anyone have any experience doing this, and care to share?
    Much appreciated! ---> Kelsey

    I don't know of any way to do what you want using the 'open' command. It can probably be done with Applescript, which you could call from a shell script. The Preview application doesn't seem to be scriptable. I don't use Acrobat, so I can't tell you anything about that. Looking through the dictionaries of the apps I do have, it seems that Skim (another PDF viewer) has an AS 'page' class. Below are a couple of links that may get you started. Look for more specific guidance in Applescript forums.
    http://sourceforge.net/apps/mediawiki/skim-app/index.php?title=AppleScript
    http://links.tedpavlic.com/shell_scripts/skim

  • Sending Reporting Services report via the command line

    I would like to either execute a subscription that sends a report via email on demand.  That or just email the report without having to edit the subscription date.  Can this be done from the command line?  I see there is the rs.exe utility
    that allows you to deploy reports and run configuration commands, but I would like to execute and email the report.  Is this possible?

    The easiest way to run a subscription manually is to run the agent job in SQL server that is associated to the subscription.  You'll need to know the subscription ID to do that.  So, you could either run it through SSMS, or if it needs to be in
    command line, interact with SQL Server via command line and do so.
    You can use the ReportService2010 API methods and and powershell script to identify the subscription ID
    https://msdn.microsoft.com/en-us/library/reportservice2010.reportingservice2010.aspx?f=255&MSPPError=-2147217396

  • Method to restart Oracle Apps 11i OPP via Unix command line

    Hi All,
    Does any one knows if there any way to restart Oracle Apps 11i Output Post Processor (OPP) via the UNIX command line?
    Thanks

    Oracle-User wrote:
    Do you recommend that I set the profile option Concurrent: OPP Response Timeout to a higher value instead of increasing OPP Processes from 1 to 2? Yes.
    I'm thinking that increasing OPP Response Timeout to a higher value will not solve our issue as it seems that once we get our first OPP Timeout error, all of the requests that need the OPP fail. We've had this occur on a Saturday, which is a day where the volume of jobs that need the OPP is very low. The error you are getting is related to the timeout and it has nothing to do with the number of OPP processes you are running on. Please set this profile option and check then (after you bounce the OPP).
    Thanks,
    Hussein

  • How to initialize consumer from supplier via the command line ?

    We have a small directory that gets loaded from scratch every night.
    We also setted up replication to a couple of consumers (read only).
    The problem is that since the data is loaded everynight, we get compliants in logs "Replica has a different generation ID than local database"
    I can initialize the consumers via the gui. But how to do it from the command line from the master ? I know that an option is to do a db2ldif and then an ldif2db on the consumer but it's not an option for us.
    I also tried setting the nsds5beginreplicarefresh to start, but that doesn't seem to do a full init.
    There must be a way, as the gui actually does it.
    TIA

    Basically it's very simple. Supposing your replication is already setup and you reload data to your master. If you want the initialization pushed to all the replicas automatically, you can simply setup a flag in all the agreements. This flag is called nsDS5BeginReplicaRefresh.
    Please check the link:
    http://docs.sun.com/source/816-6699-10/confattr.html#18194
    nsDS5BeginReplicaRefresh
    Allows you to initialize a replica. This attribute is absent by default. However, if you add this attribute with a value of start, the server reinitializes the replica and removes the attribute value.
    Property
    Value
    Entry DN
    cn=ReplicationAgreementName,cn=replica,cn="suffixName",
    cn=mapping tree,cn=config
    Valid Range
    stop | start
    Default Value
    N/A
    Syntax
    DirectoryString
    Example
    nsDS5BeginReplicaRefresh: start
    Please note that this value is absent by default and will disappear whenever initialization to replica finished. Next time whenever you want it to happen again, use ldapmodify to set this flag up.
    Also, if you want this happen to all the master's replicas, you have to setup for all the agreements.
    I already tested and it turns out very magic.
    So what you should do is whenver your master get reloaded, when it gets finished, call ldapmodify to set the attribute to be "start".
    Hope it helps!

  • Rollbak of SPAM transaction via the command line

    Hi All,
    Can you please tell me, what command line can I exucute in order to rollbak the installation of an addon via SPAM?
    I can't not connect to my SAP solution manager via SAP GUI because the installation of the Addon failed.
    Thanks

    Once applied you cant uninstall the patch. So its better to open an OSS call with SAP to resolve your issue
    Thanks
    Prince Jose

  • Executing batch files via ODI cmd line tool

    Hi,
    I'm experiencing an issue when trying to run batch files via the ODI Cmmmand line tool with any agent that isn't the local agent. My call is simply the full filepath of the batch file. When I run with local agent everything works fine. However when I run with an agent configured in the Topology the process just hangs in the operator indefinately in a running state but never executes or produces any output and I have to kill it. Any ideas? The agent is installed on the same server as the ODI Studio instance I use when running the local agent

    Sounds like that on the remote agent, the batch job is waiting for a user key input and hence it appears in a hung state. You can add try to trace from Agent logs and echo combinations to know where is this happening
    In unix environment you can send keys programmatically. Not sure how to do that in the Windows environment.

Maybe you are looking for

  • CRM_SURVEY_SUITE, make survey available ouside your lan

    Hi, We would like to  run and analyze an E-Mail Campaign with a Survey. We had create the survey and generate the url for it , according https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/4057. [original link is broken] [original link is broken] [

  • Forward and backwards buttons?

    I want to be able to let my arrows at the top work as "next image" and "previous image" buttons. Cant figure out where to put my code to make this? Check it out here! And a bonus; I want to put my functions inside the startLoad() function outside thi

  • Bluetooth could not send files out

    pls kindly advise me how to use the bluetooth in this Nokia 3500C asi can receive file but not sending anything out with it. Thanks

  • Make an SSL connection to other server from ce WebAS

    Hi all, does anyone know what should I do to make an application that's running on my AS (I have the CE 7.1 SP4 installed) call a web service that is running on a remote server, which can be address only via ssl. I have installed the certificate from

  • Almost all of my effects and transitions are not working on my fcpx trial

    i don't know what happened or how to fix it, its getting extremely annoying now. it has happened before then i fixed it and i down really know how i just turned off my computer and it worked then a few days later i turned it off and turned it on it w