sendEmail: envío de emails desde la consola

Posted by Gomix Wed, 16 Jul 2008 14:26:00 GMT

¡Mosca! No confunda sendEmail con sendmail.

Sitio del proyecto: http://caspian.dotconf.net/menu/Software/SendEmail/

Dos virtudes, corre en Linux y en MS Windows, entre otros OS.

Instalación en Fedora

Está disponible un srpm en el sitio del proyecto.

$ wget http://www.invoca.ch/pub/packages/sendemail/sendEmail-1.55-1.src.rpm
$ rpmbuild --rebuild sendEmail-1.55-1.src.rpm
... la magia ...

$ ls ~/rpmbuild/RPMS/noarch/
sendEmail-1.55-1.noarch.rpm
$ sudo yum -C --nogpgcheck localinstall rpmbuild/RPMS/noarch/sendEmail-1.55-1.noarch.rpm

Note que he usado par de opciones de yum, -C y –nogpgcheck, el segundo es importante porque el paquete no se ha firmado y es necesario para poder instalar este paquete a falta de una firma provista por el empaquetador, de hecho lo hemos compilado nosotrosos mismos. El primero es una de esas banderas útiles para cuando no estamos conectados a nuestros repositorios configurados donde quiera que se encuentren, usualmente Internet, y se le indica a Yum que realice la operación con su cache, esto también acelera la operación.

Uso Básico de sendEmail

Para no mandarle a leer la ayuda de entrada, veamos un ejemplo simple con toda la música.

$ sendEmail -f guillermo.gomez@gmail.com -t staff@freenode.net -s email-alba -u "Banned IP?" -m "It seems 190.74.190.211 its banned, what should i do to get unbanned? regards, Guillermo" -v
Jul 16 10:33:19 movix sendEmail[17448]: DEBUG => Connecting to email-alba:25
Jul 16 10:33:19 movix sendEmail[17448]: DEBUG => My IP address is: 10.140.30.113
Jul 16 10:33:23 movix sendEmail[17448]: SUCCESS => Received:    220 email-alba.localdomain ESMTP Postfix (Debian/GNU)
Jul 16 10:33:23 movix sendEmail[17448]: INFO => Sending:    EHLO movix.gomix.org
Jul 16 10:33:23 movix sendEmail[17448]: SUCCESS => Received:    250-email-alba.localdomain, 250-PIPELINING, 250-SIZE 10240000, 250-VRFY, 250-ETRN, 250-ENHANCEDSTATUSCODES, 250-8BITMIME, 250 DSN
Jul 16 10:33:23 movix sendEmail[17448]: INFO => Sending:    MAIL FROM:
Jul 16 10:33:23 movix sendEmail[17448]: SUCCESS => Received:    250 2.1.0 Ok
Jul 16 10:33:23 movix sendEmail[17448]: INFO => Sending:    RCPT TO:
Jul 16 10:33:23 movix sendEmail[17448]: SUCCESS => Received:    250 2.1.5 Ok
Jul 16 10:33:23 movix sendEmail[17448]: INFO => Sending:    DATA
Jul 16 10:33:23 movix sendEmail[17448]: SUCCESS => Received:    354 End data with .
Jul 16 10:33:23 movix sendEmail[17448]: INFO => Sending message body
Jul 16 10:33:23 movix sendEmail[17448]: SUCCESS => Received:    250 2.0.0 Ok: queued as A56AD1C502
Jul 16 10:33:23 movix sendEmail[17448]: Email was sent successfully!  From:  To:  Subject: [Banned IP?] Server: [email-alba:25]

La ayuda la obtiene con --help.

$ sendEmail --help

sendEmail-1.55 by Brandon Zehm 

Synopsis:  sendEmail -f ADDRESS [options]

  Required:
    -f ADDRESS                from (sender) email address
    * At least one recipient required via -t, -cc, or -bcc
    * Message body required via -m, STDIN, or -o message-file=FILE

  Common:
    -t ADDRESS [ADDR ...]     to email address(es)
    -u SUBJECT                message subject
    -m MESSAGE                message body
    -s SERVER[:PORT]          smtp mail relay, default is localhost:25

  Optional:
    -a   FILE [FILE ...]      file attachment(s)
    -cc  ADDRESS [ADDR ...]   cc  email address(es)
    -bcc ADDRESS [ADDR ...]   bcc email address(es)
    -xu  USERNAME             username for SMTP authentication
    -xp  PASSWORD             password for SMTP authentication

  Paranormal:
    -b BINDADDR[:PORT]        local host bind address
    -l LOGFILE                log to the specified file
    -v                        verbosity, use multiple times for greater effect
    -q                        be quiet (i.e. no STDOUT output)
    -o NAME=VALUE             advanced options, for details try: --help misc
        -o message-file=FILE         -o message-format=raw
        -o message-header=HEADER     -o message-charset=CHARSET
        -o reply-to=ADDRESS          -o timeout=SECONDS
        -o username=USERNAME         -o password=PASSWORD
        -o tls=         -o fqdn=FQDN

  Help:
    --help                    the helpful overview you're reading now
    --help addressing         explain addressing and related options
    --help message            explain message body input and related options
    --help networking         explain -s, -b, etc
    --help output             explain logging and other output options
    --help misc             explain -o options, TLS, SMTP auth, and more

Comments

Leave a response

Comments


body> body>