Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions mailit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env python

from smtplib import SMTP_SSL as SMTP
from email.mime.text import MIMEText
from email.MIMEMultipart import MIMEMultipart

me = ""
you = ""
smtp_host = "smtp.gmail.com"
smtp_port = 465
smtp_user = ""
smtp_pass = ""

def send_mail(sujet, text):
msg = MIMEMultipart()
msg['Subject'] = sujet
msg['From'] = me
msg['To'] = you
msg.attach(MIMEText(text))
s = SMTP(host=smtp_host, port=smtp_port )
s.login(smtp_user, smtp_pass )
s.sendmail(me, [you], msg.as_string())
s.quit()

def send_file(sujet, filename):
# the text file contains only ASCII characters.
fp = open(filename, 'rb')
msg = MIMEText(fp.read())
fp.close()

msg['Subject'] = sujet
msg['From'] = me
msg['To'] = you

s = SMTP(host=smtp_host, port=smtp_port )
s.login(smtp_user, smtp_pass )
s.sendmail(me, [you], msg.as_string())
s.quit()

31 changes: 23 additions & 8 deletions uploadr.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
################################################################################
# Location to scan for new files
################################################################################
FILES_DIR = "YourDir"
ROOT_DIR = "" # "/volume2/Photos/"
FILES_DIR = "YourDir" # "/volume2/Photos/2015/"

################################################################################
# Flickr settings
Expand All @@ -13,14 +14,28 @@ FILES_DIR = "YourDir"
FLICKR = {
"title" : "",
"description" : "",
"tags" : "auto-upload",
"tags" : "",
"is_public" : "0",
"is_friend" : "0",
"is_family" : "0",
"api_key" : "YourKey",
"secret" : "YourSecret"
"api_key" : "",
"secret" : ""
}

#-----------------
# Mail SMPT config
#-----------------
SMTP_USER = ""
SMTP_PASS = ""

#---------------------
# Time and Files limit
#---------------------
MAX_FILES = 0
MAX_MINUTES = 240

LOG_PATH = os.path.join(os.path.dirname(sys.argv[0]), 'log/')

################################################################################
# How often to check for new files to upload (in seconds)
################################################################################
Expand Down Expand Up @@ -50,7 +65,7 @@ TOKEN_PATH = os.path.join(os.path.dirname(sys.argv[0]), ".flickrToken")
################################################################################
# List of folder names you don't want to parse
################################################################################
EXCLUDED_FOLDERS = ["@eaDir","#recycle",".picasaoriginals","_ExcludeSync","Corel Auto-Preserve","Originals","Automatisch beibehalten von Corel"]
EXCLUDED_FOLDERS = ["@eaDir","#recycle",".picasaoriginals","_ExcludeSync","Corel Auto-Preserve","Originals","Automatisch beibehalten von Corel","[Originals]","[Fichiers originaux]"]

################################################################################
# List of filename regular expressions you wish to ignore
Expand All @@ -61,7 +76,7 @@ IGNORED_REGEX = []
################################################################################
# List of file extensions you agree to upload
################################################################################
ALLOWED_EXT = ["jpg","png","avi","mov","mpg","mp4","3gp"]
ALLOWED_EXT = ["jpg","jpeg","png","avi","mov","mpg","mp4","3gp"]

################################################################################
# RAW File Conversion (optional)
Expand All @@ -76,6 +91,6 @@ RAW_TOOL_PATH = "/volume1/photo/Image-ExifTool-9.69/"
FILE_MAX_SIZE = 50000000

################################################################################
# Do you want to verify each time if already uploaded files have been changed?
# Do you want to verify each time if already uploaded files have been changed?
################################################################################
MANAGE_CHANGES = True
MANAGE_CHANGES = False
Loading