Journal d'un linuxien

[Ubuntu] Envoyer des fichiers avec thunderbird

Un petit cadeau pour les utilisateurs de Linux : un script pour Nautilus qui permet d’envoyer des fichiers et des dossiers (qui sont alors compressés en .rar) via email avec Thunderbird par un simple clic droit.

Dépendances : rar, zenity

1. Placer le script dans : ~/.gnome2/nautilus-scripts

2. Rendez-le exécutable : chmod u+x Mailto

3. Selectionnez autant de fichiers et de dossiers que vous voulez envoyer et faites clic droit ==> Scripts ==> Mailto

N’hésitez pas à me faire des retours !

 

#!/bin/bash
########################################################################
# Mailto - Version 1.3 - Send files/folders via email with thunderbird.#
# Found at http://www.soft.freem2.fr                                   #
########################################################################
# 1. Place this file in ~/.gnome2/nautilus-scripts                     #
# 2. Make it executable chmod u+x Mailto                               #
# 3. Do not work in command line.                                      #
########################################################################

args=$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
prefix="file://"; 
suffix="_mailto.rar";
title="Select files to send";

if [ -Z $args ]; # if no args then pop-up select window
then	
	args=$prefix`zenity --file-selection --multiple --title="$title" --separator=",$prefix"`;	
	# Send the email
	if [ $PIPESTATUS -eq 0 ]; then thunderbird -compose "attachment='$args'"; fi
else	
	IFS=$'\n' && for i in $args
	do
		if [ -d $i ]; 
		then 	
			rar a ${i##*/}$suffix `basename $i`;
			app+=$prefix/$i$suffix",";
			tmp+=$i$suffix" ";
		else	
			app+=$prefix/$i","; 
		fi
	done

	# Delete final separators
	length=${#app};	app=${app:0:$length-1};
	length=${#tmp};	tmp=${tmp:0:$length-1};

	# Send the email & remove .rar files
	thunderbird -compose "attachment='$app'";	
	IFS=$' ' && for f in $tmp 
	do rm $f; done
fi
exit(0);

  • Pascal CROZET

    in « http://soft.freem2.fr/2010/05/21/envoyer-des-fichiers-avec-thunderbird/images/stories/documents/mailto%20v1.3.sh »

    Error 404 – Not Found
    Apologies, but the page you requested could not be found.

    • Furinkazan

      Je corrige ça …

    • Furinkazan

      Voilà qui est fait !