SSMTP and revaliases?


Recommended Posts

Just installed the mail and ssmtp package and trying to test it out.  I'm getting an error

 

ssmtp: 550 5.7.1 Client does not have permissions to send as this sender

 

In looking over the debug output it's getting

 

MAIL FROM:<[email protected]>

 

In doing so research on ssmtp it appears I'd need to use the revaliases file to remap root to my email address which is permitted to sent through the server.

 

Where do I edit or create the revaliases file on the flash drive so it gets installed?

 

Thanks!

-Ed

Link to comment

I've never used that feature...

From my brief google search, the file is created in

/etc/ssmtp/revaliases

 

You'll be the first to use it I know on unRAID, but that just means your email provider is just a bit more picky than some others.

 

As far as its contents, google is your guide.  It will probably also need to not be world writable.

 

The ssmtp.conf file used by the program you installed through unMENU is at copied to

/usr/local/etc/ssmtp/ssmtp.conf

and used there by ssmtp.

 

You'll need to re-create the revaliases file every time you reboot, so you can add lines to your config/go script to copy a file on your boot drive into place.

Something like this at the end of the config/go script will do to copy a file you create located at /boot/revaliases into place every time you reboot:

cp /boot/revaliases /usr/local/etc/ssmtp/revaliases

 

Let me know how this works out... I can add a new field in the package manager config screen to create the file once we figure out how to use it.   Your experience may help others who follow.

 

Joe L.

Link to comment

Thanks for the structure primer there.... got it and all is working well now with a minor tweak.

 

1) Install ssmtp package

2) Create from scratch or grab from the flash at \packages\ssmtp\revaliases

 

Format is simple:

# sSMTP aliases

#

root:[email protected]

 

3) Place that in the root of the flash

4) Edit \config\go on the flash and stick this after the auto_install call

 

cp /boot/revaliases /usr/local/etc/ssmtp/revaliases

 

I had one last false start there.  Apparently it looks in the same location as the ssmtp.conf.  Anyway a quick full reboot to test everything and a manual call of /etc/cron.hourly/smtp_status.sh ended up with an email 1 second later.

 

I'm using myhosting.com with a hosted Exchange account and domain.  Apparently they are wee bit touchy about their SMTP server.

 

Thanks again... now on to Crashplan.

-Ed

Link to comment
  • 1 month later...

Same issue, I coped the file to the root of boot, edited with a valid email address in the org and added

"cp /boot/revaliases /usr/local/etc/ssmtp/revaliases" to "go" file after packages install line just as edentel stated/tested...

 

God bless you edentel, I was pulling hair out. I would have never figured this out. We allow any relaying of an internal subnet but this thing actually makes a connection... that why it wants credentials and all. Is there something that can be added to allow to just relay for does who can, etc... I hate adding credentials to anything. had to create an account just for unRAID to use, so it got hacked, etc due to this plain test input in the unmenu, I could just kill that account/mailbox no prev. to anything in the network.

 

Link to comment
  • 2 months later...
  • 2 weeks later...
  • 4 years later...

I apologize for resurrecting this old thread, but I am trying to configure the ssmtp package to send mail to my yahoo account.

 

I have the fields set as follows:

Forward "root" email to: [email protected]
Email server: smtp.mail.yahoo.com:587
Use TLS: Yes
Mail ID: email2
Mail Password: myPassword
Mail Domain: yahoo.com
From Line Override: Yes
Re-write Domain:
RevAliases = root:[email protected].

 

However, when I run a test with:

 

echo -e "Subject: a test\n\nThis is the email body." | ssmtp -d root

 

The MAIL FROM:<[email protected]> is used and so I get an error from yahoo saying "From address not verified - see ..."

 

I checked the /usr/local/etc/ssmtp directory and it does contain a revaliases.conf file with root:[email protected].

 

How do I get ssmtp to use the [email protected] instead of [email protected] for the From field?

 

I am running unRAID 5.0.5.

 

Edit:

It turns out the revaliases.conf file should be named revaliases (without the .conf).  I renamed the file and it fixed the problem.  Can we have the ssmtp package fix to name the file revaliases and not revaliases.conf in the /usr/local/etc/ssmtp directory?  I believe the man page for ssmtp specify revaliases and not revaliases.conf.

Link to comment
  • 10 months later...

Hello,

Sorry for waking up this topic, but I think that I have a very similar issue with SSMTP.

 

I've tried to use the revaliases to relay local mailboxes to our mail servers but failed.

 

As mifronte tried to use plain user name, the following example fails to deliver:

  echo "yarden testing workstation"|mail -s 'workstation testing' yarden

 

But when I use ssmtp directly, the mail gets delivered:

  ssmtp -d yarden < /home/yarden/Downloads/example_email

 

UPDATE: ssmtp is installing sendmail interface, using it also succeeds sending the mail from the local account (e.g. root or yarden)

 

 

Why this difference exists?

 

Thank you!

Yarden

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.