As of 2016-02-26, there will be no more posts for this blog. s/blog/pba/
Showing posts with label sendmail. Show all posts

I set up SSMTP with Gmail because I wanted to get mails for cron results.

I have these in /etc/ssmtp/ssmtp.conf:


Make sure this is only root-and-ssmtp-readable.

And /etc/ssmtp/revaliases:


You can test with

echo mailbody | mail -v -s "mail subject"
echo mailbody | sendmail -v

I dont have this mail command on my Gentoo, but it seems popular in every page I have read.

If you want to send a more complete test email via sendmail you can

echo -e "Subject: mail subject\nTo:\n\nmailbody" | sendmail -v

On Development Server

When I use Mail API with sendmail using the example as in Sending Mail doc, the recipient has to be pure email address:
cannot be
User <>
Or sendmail complains:
INFO     2008-10-29 06:57:53,884] MailService.Send
INFO     2008-10-29 06:57:53,884]   From:
INFO     2008-10-29 06:57:53,885]   To: User
INFO     2008-10-29 06:57:53,885]   Subject: Your account has been approved
INFO     2008-10-29 06:57:53,885]   Body:
INFO     2008-10-29 06:57:53,885]     Content-type: text/plain
INFO     2008-10-29 06:57:53,885]     Data length: 261
/bin/sh: -c: line 0: syntax error near unexpected token `newline'
/bin/sh: -c: line 0: `sendmail User <>'
ERROR    2008-10-29 06:57:53,927] Error sending mail using sendmail: [Errno 32] Broken pipe
I think this can be fixed by patching the

On Production Server

Sender must be:
The sender must be the email address of a registered administrator for the application, or the address of the current signed-in user.