Browse Source

tracim endpoint for email fetcher use now tracim config

Guénaël Muller 7 years ago
parent
commit
e2eb1cac7c
2 changed files with 5 additions and 4 deletions
  1. 2 1
      tracim/tracim/lib/daemons.py
  2. 3 3
      tracim/tracim/lib/email_fetcher.py

+ 2 - 1
tracim/tracim/lib/daemons.py View File

167
             user=cfg.EMAIL_REPLY_IMAP_USER,
167
             user=cfg.EMAIL_REPLY_IMAP_USER,
168
             password=cfg.EMAIL_REPLY_IMAP_PASSWORD,
168
             password=cfg.EMAIL_REPLY_IMAP_PASSWORD,
169
             folder=cfg.EMAIL_REPLY_IMAP_FOLDER,
169
             folder=cfg.EMAIL_REPLY_IMAP_FOLDER,
170
-            delay=cfg.EMAIL_REPLY_DELAY
170
+            delay=cfg.EMAIL_REPLY_DELAY,
171
+            endpoint=cfg.WEBSITE_BASE_URL + "/events"
171
         )
172
         )
172
         self._fetcher.run()
173
         self._fetcher.run()
173
 
174
 

+ 3 - 3
tracim/tracim/lib/email_fetcher.py View File

95
 
95
 
96
 class MailFetcher(object):
96
 class MailFetcher(object):
97
 
97
 
98
-    def __init__(self,host,port,user,password,folder,delay):
98
+    def __init__(self,host,port,user,password,folder,delay,endpoint):
99
         self._connection = None
99
         self._connection = None
100
         self._mails = []
100
         self._mails = []
101
-
102
         self.host = host
101
         self.host = host
103
         self.port = port
102
         self.port = port
104
         self.user = user
103
         self.user = user
105
         self.password = password
104
         self.password = password
106
         self.folder = folder
105
         self.folder = folder
107
         self.delay = delay
106
         self.delay = delay
107
+        self.endpoint = endpoint
108
 
108
 
109
         self._is_active = True
109
         self._is_active = True
110
 
110
 
181
                        "content": decoded_mail['body']
181
                        "content": decoded_mail['body']
182
                    }}
182
                    }}
183
 
183
 
184
-            requests.post('http://localhost:8080/events',json=msg)
184
+            requests.post(self.endpoint,json=msg)
185
             pass
185
             pass