Hot answers tagged

21

mailx can use SMTP. It's configure file is ~/.mailrc One example is mailx using Gmail's SMTP. The configure can even be in one command: mailx -v -s "$EMAIL_SUBJECT" \ -S smtp-use-starttls \ -S ssl-verify=ignore \ -S smtp-auth=login \ -S smtp=smtp://smtp.gmail.com:587 \ -S from="$FROM_EMAIL_ADDRESS($FRIENDLY_NAME)" \ -S smtp-auth-user=$FROM_EMAIL_ADDRESS ...


14

Normally, mail and derivatives (and almost any other Unix MUA) use the traditional sendmail interface - /usr/bin/sendmail, provided by almost all MTAs (postfix, exim, sendmail, courier). This is the traditional Unix way. Once a message is submitted through sendmail, your MTA handles message transmission. Depending on configuration, it may either connect ...


4

Just get rid of the account wrapper you put around the settings. nail.rc Instead of: # other mail config ... account gmail { set smtp-use-starttls set smtp-auth=login set smtp=smtp://smtp.gmail.com:587 set smtp-auth-user=username@gmail.com set smtp-auth-password="blahblah" } Use: # other mail config ... set smtp-use-starttls set ...


4

Found it. To open without being kicked out if there's no new mail: mailx -f To get the header list again once in: h


4

I would advise to use sendEmail: sendEmail-1.56 by Brandon Zehm <caspian@dotconf.net> 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 ...


3

The mail terminal program should do the trick. It usually works "straight out of the box" to allow users/programs to send messages locally, inside the system. Type mail -s 'subject line' someone@gmail.com and hit return. Then type your message and close/send using Ctl-D.


2

If this computer is located on a home network connection, you are likely blocked by your ISP from sending mail directly. Most ISPs expect you to authenticate to their mail server to send mail. In that case, follow these slackware specific directions to set up Client-Side SMTP AUTH + SMART_HOST


2

Have you read the mailx manpage (archived, active) ?  Look for the write (w) command. This can write attachments.


2

I just had a similar problem. In my case it was due to a newline at the end of an email list causing mailx to receive an empty address.


2

The easiest way would be to call sendmail fom within your script. That way you can control whether or not any mail is sent to you. Alternatively, you could make your script return a success code if it fails and run sendmail only if the script exits "correctly": $ my-job >/tmp/message && cat /tmp/message | sendmail The && tells bash to ...


2

Instead of specifying the recipient on the command line, call sendmail with -t and have your script generate a to: header. (You might as well do a subj: header while you're at it.) Then when there's no output, there's no recipient, and thus no mail.


2

A few things to try. #!/bin/sh -xv Try redirecting stderr with two greater than signs, 2>>&1 . The first will give you step-by-step output of your script. I'd try it first without redirecting stderr to your log file. Cron should mail you a copy of the output. You can see exactly where it goes wrong. The second. Maybe you have an error that's ...


1

If you want to maintain multiple accounts but select one by default, add an account command after the accounts are defined to select it Example rc file: account myimap { set folder=imap://user@host set record=+Sent set imap-keepalive="5" } account local { set folder=.local/maildir unset record } # Now select myimap as default account on ...


1

You are sure the cron job works, as per your comments - however, you have tested it manually running the job while you are logged-in. The thing is that the jobs ran by cron do not take into account the settings and environment variables you have with your current user, so you probably need to source the .bash_profile settings file for the user as a step ...


1

Neither using -r nor setting the from variable worked in my environment. I always got something like: send-mail: 550 5.7.1 ... Invalid from address .... What worked for me was adding an sSMTP alias to /etc/ssmtp/revaliases, e.g. accountname:root@machinename.example.com:smtp.example.com


1

I just tested this in Ubuntu 14.04 and using the -S parameter worked for me: -S variable[=value] Sets the internal option variable and, in case of a string option, assigns value to it. So, the following command sets the from address to "test@exmaple.org": echo "This is my test" | mail -S from="test@example.org" -s "This is my subject" ...


1

The following depends on your installed MTA, but because of security implications, mail is usually not delivered to root. You need to set up root as a mail alias to one of your "normal" users and read root's mail in that mailbox.


1

there is an alternative without local mta like sendmail/postix. debian package ssmtp info from rpm description: Summary : Extremely simple MTA to get mail off the system to a Mailhub URL : http://packages.debian.org/stable/mail/ssmtp License : GPLv2+ Description : A secure, effective and simple way of getting mail off a system to your mail ...



Only top voted, non community-wiki answers of a minimum length are eligible