1
  • I'm running Debian
  • I've set up ssmtp as my MTA and this works perfectly
  • I can send mail using both mail and mailx with a standard user account

BUT... When I run sudo apticron I get:

send-mail: RCPT TO:<[user]@[mydomain].com> (550 Sender verify failed)

Any ideas? (I've blanked the email details myself - that's not part of the error)


UPDATE:

When running mail or mailx as root, these break too! They only work when I run them under my standard user account.

Error message I receive as root when running:

echo "test" | mail -s "test" [user]@[mydomain].com 

is same as with apticron:

RCPT TO:[user]@[mydomain]> (550 Sender verify failed) 

UPDATE 2:

sudo mail -v etc... shows that the root user actually replaces the first part of the email address with 'root' despite /etc/ssmtp/ssmtp.conf specifying FromLineOverride=NO:

[<-] 220 and/or bulk e-mail.
[->] EHLO [user]@[mydomain].com
[<-] 250 HELP
[->] AUTH LOGIN
[<-] 334 VXNlcm5hbWU6
[->] [redacted Base64 username]
[<-] 334 UGFzc3dvcmQ6
[<-] 235 Authentication succeeded
[->] MAIL FROM:<root@[mydomain.com]>
[<-] 250 OK
[->] RCPT TO:<[user]@[mydomain].com>
[<-] 550 Sender verify failed
send-mail: RCPT TO:<[user]@[mydomain].com> (550 Sender verify failed)

EDIT:

I've removed previously pasted code from apticron as clearly the problem lies with root not being able to send emails (this is no longer limited to an individual program)

  • "sender verify" would sound like a problem with the from address. Not the recipient. – derobert Apr 15 '15 at 16:23
  • That's what I thought originally.. I've tried 4 different from addresses, all of which work perfectly with command line mail and mailx. Incidentally I think having a dash/hyphen in the from address breaks ssmtp, that's why I changed it originally. – toxefa Apr 15 '15 at 18:37
  • @derobert I still haven't manage to resolve this. Any other advice? How can it be that I can send emails without any problem when I do mail -s "something" my@emailaddress.com but apticron fails every time if they're both using the same MTA? – toxefa Apr 20 '15 at 11:50
  • Try a different MTA - exim is generally well supported on Debian, and see if that helps you figure it out. – Faheem Mitha Apr 20 '15 at 13:30
  • If you get an error, post it, If you don't get an error, that might tell you something too. – Faheem Mitha Apr 20 '15 at 13:40
2

Your remote mail server doesn't believe root@yourdomain in the SMTP envelope¹ is a valid email address, so it's refusing messages from you. And that's where apticron is trying to send from, so it doesn't work.

ssmtp allows you to override the default email address and relay on a per-user basis in the /etc/ssmtp/revaliases file. You can use this to set an acceptable (to your mail relay) address for root, by adding a line like:

root:EMAIL@DOMAIN:RELAY-HOST:RELAY-PORT

replacing the all-caps portions with email address and relay host you'd like to use.

Note: Much of this was from troubleshooting in chat, starting around this message.


1Note that the SMTP "envelope" sender is different than the From: field that shows up in your mail client. Though if you're lucky it's preserved in a different header.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.