[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Mails mit Anlage versenden, Probleme durch Linut auf einem managed Hostsystem



Hallo,

On 01/29/2015 11:40 AM, Ralf Prengel wrote:
> wir wollen von einem Debian-System das als managed Hostsystem bei
> Hosteurope läuft Mails mit Anlagen versenden.
> Das funktioniert leider nicht weil mutt eine temporäre Datei anlegen
> will aber der per default genutze Odner schreibgeschützt ist.
> Die Umgebunsvariable tmpdir kann ich auch nicht wirksam setzen.
> mailx ist keine Option da uuencode nicht verfügbar ist.
> Hat jemand Tips ausser die dateien per get oder scp zu übertragen? Ich
> möchte eigentlich den mailweg nutzen.
Aus einer anderen Not heraus, aber trotzdem vermutlich hilfreich hier,
verwende ich sowas:

> #! /usr/bin/env python
> 
> import getopt
> import re
> import subprocess
> import sys
> 
> def shellquote(s):
>     return '"%s"' % re.sub('[!"$]', lambda mo: '\\%s' % mo.group(), s)
> 
> profile = 'kleine-koenig.org'
> #profile = 'dummy'
> 
> print 'profile =', profile
> 
> if profile == 'kleine-koenig.org':
>     args = map(shellquote, sys.argv[1:])
>     ret = subprocess.call(['ssh', 'arcturus', '/usr/sbin/sendmail'] + args)
> elif profile == 'dummy':
>     args = map(shellquote, sys.argv[1:])
>     print args
>     ret = subprocess.call(['cat'])

Dieses Script liegt auf meinem Laptop in ~/bin/sendmail. Zusammen mit:

	export PERL_MAILERS="mail:/does/not/exists:sendmail:$HOME/bin/sendmail"

in .bashrc,

	git config --global sendemail.smtpserver "$HOME/bin/sendemail"

und

	set sendmail = "/home/uwe/bin/sendmail -oem -oi"

in .mutt/muttrc, funktioniert prima.

Uwe

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: