Want to automatically process email attachments based on username and subject

Iโ€™m looking for advice on setting up a mail gateway so that students can send me homework and the email will be processed automatically.

For example, if studenta@univ.edu sends me a message with the question "CS208 hw1", I would cross-check the student in the list of students accepting CS208, then take all the attached files, upload them to this student hw1 and reply with an email about which files were received and when. If the studentโ€™s email address was incorrect, for example, a bad subject or missing files, the service will send an email.

I have administrative access to a Linux machine on campus, which can be configured as a mail server.

Carelessly, I thought about using fetchmail and setting cron to sequentially read the assigned email of the user and execute the corresponding responses with a kind of script. Does this sound like a good way? Would I welcome better ideas?

+3
source share
3 answers

I expect that in practice there will be much more exceptions to the rules that you prescribe than there will be corresponding mail that will be properly handled. You will buy yourself a headache from manual corrections and "the computer ate my homework."

CS 200, , VCS. . 10- Google, , Mercurial git (gasp!) Subversion.

, Mercurial ( git) "" "" , , , , VCS .

, :

studenta@dorm$ hg clone https://Rich.univ.edu/studenta/cs208
$ cd cs208 ; broswer ./hw1.html
$ mkdir hw1 ; cd hw1 ; make my work files 
$ hg add * ; hg commit -m "perfect the first time!" # updates locally only
$ make lots of bug fixes
$ hg commit -m "okay really done now"
$ hg push 
# sleep, party, go to class with hangover
$ hg pull
$ browse hw2.html ; mkdir hw2 
...

, , . "" Rich.unix.edu, .

  • () script to hg init $student/cs208 Rich.univ.edu .
  • , HTTPS SSH .
  • - - ,
  • , , .
  • , .

, ,

$ hg export tip | mail -s "server down; assignment done" Rich@univ.edu

, , , , :

" , !"
" , ?"
", ".
", , , , ".
", - , !"

+2

, , , FTP-. , , , , . , . , , , , ftp-.

msw. . * tips hat to msw*

+2

If you have a webmail interface, iMacros for Firefox can be a good automation solution. You can use the built-in Javascript for more complex if / then solutions:

0
source

Source: https://habr.com/ru/post/1761037/


All Articles