Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Cloudron Forum

Apps | Demo | Docs | Install

Run script on new email

Scheduled Pinned Locked Moved Solved Support
mail
10 Posts 5 Posters 284 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • yusfY Offline
    yusfY Offline
    yusf
    wrote on last edited by girish
    #1

    Can I possibly trigger a script to run when email arrives in a Cloudron inbox?

    girishG 1 Reply Last reply
    0
  • girishG Offline
    girishG Offline
    girish Staff
    replied to yusf on last edited by
    #2

    @yusf what kind of script ? sieve essentially does this, can you create a mail rule?

    yusfY 1 Reply Last reply
    0
  • yusfY Offline
    yusfY Offline
    yusf
    replied to girish on last edited by yusf
    #3

    @girish I don’t know as I’ve zero experience with Sieve. I want to curl with POST to an external server. Ideally containing the email contents but at least its sender and subject data.

    girishG murgeroM 2 Replies Last reply
    0
  • robiR Offline
    robiR Offline
    robi
    wrote on last edited by
    #4

    In the old days of mail in unix terminals, you could do that with a .forward file which could run shell scripts.

    What's the bigger purpose?

    Since all email goes through spam filtering, there's an opportunity to hook into what you need there too.

    Life of sky tech

    1 Reply Last reply
    1
  • girishG Offline
    girishG Offline
    girish Staff
    replied to yusf on last edited by girish
    #5

    @yusf generally, the 'robust' way to do this is to implement this, is in the app and not in the mail server. This takes care of situations where the app is down, app is busy etc. For example, chatwoot, freescout, gitlab all have built-in support for IMAP.

    1 Reply Last reply
    2
  • murgeroM Offline
    murgeroM Offline
    murgero App Dev
    replied to yusf on last edited by
    #6

    @yusf why not run a script in cron (on the cloudron server) that monitors the mailbox via imap?

    --
    https://urgero.org
    ~ Professional Nerd. Freelance Programmer. ~
    Matrix: @murgero:urgero.org

    yusfY 1 Reply Last reply
    0
  • yusfY Offline
    yusfY Offline
    yusf
    replied to murgero on last edited by
    #7

    @murgero Sounds excellent, show me how 😊

    murgeroM timconsidineT 2 Replies Last reply
    0
  • murgeroM Offline
    murgeroM Offline
    murgero App Dev
    replied to yusf on last edited by
    #8

    @yusf Sadly I am not sure on specifics, but this answer on stackexchange really goes into detail on options you can do in bash: https://unix.stackexchange.com/a/537196

    --
    https://urgero.org
    ~ Professional Nerd. Freelance Programmer. ~
    Matrix: @murgero:urgero.org

    1 Reply Last reply
    2
  • timconsidineT Offline
    timconsidineT Offline
    timconsidine App Dev
    replied to yusf on last edited by
    #9

    @yusf depending what you want to do exactly, 2 excellent utilities I have used previously are :

    • imapfilter (https://github.com/lefcha/imapfilter)
    • offlineimap (http://www.offlineimap.org/)
      You will probably need to write the meat of your script in bash or php or whatever, but this will get you access to raw email.
      And can be run by cron and targeted to mail in certain folders.
    1 Reply Last reply
    2
  • yusfY Offline
    yusfY Offline
    yusf
    wrote on last edited by
    #10

    Thanks guys, I check out those resources provided ❤

    1 Reply Last reply
    0
  • girishG girish marked this topic as a question on
  • girishG girish has marked this topic as solved on

  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Login

  • Don't have an account? Register

  • Login or register to search.