2

I would like to start using nullmailer (version 1:2.2-3, according to dpkg-query) to forward to my personal Yahoo address any emails generated by programs (notably cron) running on my home desktop computer (Debian buster).

My home desktop computer connects to the internet through an ISP (Xfinity), and does not have a FQDN. In other words, when I run hostname --fqdn on it, the output is a string containing no periods. (For the purposes of this question, let's say that this output is simply, XXMYBOXXX1.)

Therefore, I would like to configure nullmailer to send all outgoing mail through an external relay host, namely smtp.mail.yahoo.com.

Here's what I've tried so far (without success).

I left the /etc/nullmailer/adminaddr and /etc/nullmailer/defaultdomain files empty, and put the following in the /etc/remotes file (modulo some redactions in all-caps, and leading and trailing XX)2:

smtp.mail.yahoo.com smtp --auth-login --port=465 --ssl --user=XXXMEXXX@yahoo.com --pass=XXXPASSWDXXX --insecure

...although I have tried many variations. In particular, I have changed --ssl to --tls, and I have tried both of these settings with and without the --insecure flag.

The next listing shows the ownerships and permissions for all the configuration files I have for nullmailer:

drwxr-xr-x 2 root root 4096 Apr 26 07:39 /etc/nullmailer/
-rw-r--r-- 1 root root    0 Apr 26 07:48 /etc/nullmailer/adminaddr
-rw-r--r-- 1 root root    0 Apr 26 07:46 /etc/nullmailer/defaultdomain
-rw------- 1 mail mail  115 Apr 26 08:11 /etc/nullmailer/remotes

As I said earlier, all the various nullmailer configurations I have attempted have failed. Here is a typical example of what this failure looks like. If I attempt to send a message to a test address using the following command

echo 'some text' | /usr/bin/mail -s 'some subject' XXTESTXX@XXMAILSVCXX.com

...I get nothing at XXTESTXX@XXMAILSVCXX.com (nor at XXXMEXXX@yahoo.com, for that matter), and the following lines get added to XXMYBOXXX's /var/log/mail.log:

Apr 26 09:01:33 XXMYBOXXX nullmailer: Trigger pulled.
Apr 26 09:01:33 XXMYBOXXX nullmailer: Rescanning queue.
Apr 26 09:01:33 XXMYBOXXX nullmailer: Starting delivery, 1 message(s) in queue.
Apr 26 09:01:33 XXMYBOXXX nullmailer: Starting delivery: host: smtp.mail.yahoo.com protocol: smtp file: 1619438493.9195
Apr 26 09:01:33 XXMYBOXXX nullmailer: From: <root@XXMYBOXXX> to: <XXTESTXX@XXMAILSVCXX.com>
Apr 26 09:01:33 XXMYBOXXX nullmailer: Message-Id: <1619438493.951858.9194.nullmailer@XXMYBOXXX>
Apr 26 09:01:35 XXMYBOXXX nullmailer: smtp: Failed: 550 Request failed; Mailbox unavailable
Apr 26 09:01:35 XXMYBOXXX nullmailer: Sending failed: Permanent error in sending the message
Apr 26 09:01:35 XXMYBOXXX nullmailer: Moving message 1619438493.9195 into failed
Apr 26 09:01:35 XXMYBOXXX nullmailer: Generating bounce for 1619438493.9195
Apr 26 09:01:36 XXMYBOXXX nullmailer: Delivery complete, 0 message(s) remain.
Apr 26 09:01:36 XXMYBOXXX nullmailer: Trigger pulled.
Apr 26 09:01:36 XXMYBOXXX nullmailer: Rescanning queue.
Apr 26 09:01:36 XXMYBOXXX nullmailer: Starting delivery, 1 message(s) in queue.
Apr 26 09:01:36 XXMYBOXXX nullmailer: Starting delivery: host: smtp.mail.yahoo.com protocol: smtp file: 1619438495.9198
Apr 26 09:01:36 XXMYBOXXX nullmailer: From: <> to: <root@XXMYBOXXX>
Apr 26 09:01:36 XXMYBOXXX nullmailer: Message-Id: <1619438496.000360.9199.nullmailer@XXMYBOXXX>
Apr 26 09:01:37 XXMYBOXXX nullmailer: smtp: Failed: 550 Request failed; Mailbox unavailable
Apr 26 09:01:37 XXMYBOXXX nullmailer: Sending failed: Permanent error in sending the message
Apr 26 09:01:37 XXMYBOXXX nullmailer: Moving message 1619438495.9198 into failed
Apr 26 09:01:37 XXMYBOXXX nullmailer: Not generating double bounce for 1619438495.9198
Apr 26 09:01:37 XXMYBOXXX nullmailer: Delivery complete, 0 message(s) remain.

How must I change my nullmailer configuration so that the mail command above will work?


Distro info:

% uname -ar
Linux debug-3 4.19.0-16-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64 GNU/Linux

1 Apologies for this obnoxious pseudonym. It was largely dictated by the pattern I used to indicate redactions throughtout this post.

2 The value I actually use for the --pass flag is an "app password" generated by https://login.yahoo.com/myaccount/security for an "app" called "nullmailer".

6
  • 1
    The configuration that always worked for me included adminaddr (with just an email address to send failures and errors to) and defaultdomain (just the domain to use when no other is specified) with just a domain in the file. I also had me and it would have one line of either \$hostname.example.com or \example.com, whichever seemed to work for the provider. Have you verified you can send email through Yahoo! with a different tool (e.g., Thunderbid)? Have you tried sending with something other than mail?
    – Paul
    Apr 29 at 13:03
  • @Paul: thank you for your suggestions. I have tried various values for adminaddr, and I think I now get what this config does. With defaultdomain, however, I have not found a useful value yet. If I put something like yahoo.com in it, then sometimes (depending on other config/invocation details) I see the (invalid) hostname XXMYBOXXX.yahoo.com mentioned in some of the generated output. Rearding your first question, I have not been able to send any mail from XXMYBOXXX. Regarding your second question, the answer is "no". Pardon my ignorance: what other programs besides mail...
    – kjo
    Apr 29 at 14:11
  • @Paul (cont'd) ...could I use to send mail?
    – kjo
    Apr 29 at 14:11
  • 1
    For the first question, I actually meant even besides with this specific device. Could be any device using an app password to verify the functionality even works. Some of these big freemailers aren't very friendly to tools merely meeting standards. For the second question, this can be anything else, usually something using sendmail command such as the PHP mail() function.
    – Paul
    Apr 29 at 14:22
  • 1
    You also may want to consider not using Yahoo! for this purpose, as they usually have something in their ToS about not doing what you are doing, though they usually tolerate a small quantity, the quantity has continually shrunk and become more restrictive over the years. I'm not clear on when tools like Sendgrid, Mailgun, etc., shouldn't be used because a freemailer is the better tool, but this is more commentary than answering your question.
    – Paul
    Apr 29 at 14:48
1

The configuration you have described looks pretty correct to me, except perhaps for the adminaddr file which in your case I think it would better be not empty, and instead indicate a valid, publicly reachable, address. However this small correction would not solve your main issue.

An error message like:

550 Request failed; Mailbox unavailable

is entirely from the Yahoo's own mail-server side. Your send operation is being rejected by Yahoo due to some policy of theirs that the operation does not comply with.

Problem is, that error message from Yahoo is so generic (probably purposefully so) that it is impossible to infer the exact adjustment you need to do on the nullmailer side. It can be due to (literally) any sort of restriction associated to the service referred to by that account of yours subscribed at Yahoo. It might even be something to do with some kind of blacklisting (even if just temporary) enforced by Yahoo to the particular IP address that your ISP has assigned to your connectivity.

However, one thing that I do notice, which is not at all wrong in itself but might violate a restriction enforced by Yahoo, is that you are not specifying an envelope sender, hence it gets dynamically "computed" by the mail command. It might be that Yahoo's policy requires that address to be the same as the account associated to the service, or perhaps the same as the account used for the SMTP authentication (if this differs from the account associated to the service).

So, try specifying your Yahoo account as envelope sender too, and see if the message passes thru. If it does, you might simply indicate that address in the /etc/nullmailer/allmailfrom file in order to have nullmailer always use that address as envelope sender no matter what.

Note that the "envelope sender" may differ from the From: header in the actual message, so you can send a message "apparently" coming from bogus@example.com as rendered by a Mail-User-Agent reporting the From: header, even though it has been sent by XXXMEXXX@yahoo.com as envelope sender. (that is, you may make those two addresses differ unless Yahoo's own policy requires them to be equal..).

In general, AFAICT this case looks like something you'd need to ask Yahoo's customer service about, in order to get acquainted of all the exact restrictions in place for the usage of the email service associated to that account, so as to know how to instruct nullmailer.

3
  • Thank you for your answer! If your guess (that the failure has mostly to do with smtp.mail.yahoo.com) is correct, then my problem becomes, primarily, one of somehow dissecting the exact details of the communication between nullmailer and smtp.mail.yahoo.com (or whatever else it is actually communicating with). This means that this post's original question (regarding my local nullmailer configuration) becomes somewhat secondary (since, in your estimation, my current configuration is already more or less right). If I hadn't started a bounty on this question, I would ... (TBC)
    – kjo
    Apr 30 at 11:39
  • (cont'd) ...just modify it to reflect this new troubleshooting/debugging slant on my problem, but it seems wrong to do this on a question with a bounty. Therefore, I just started a new question, here: unix.stackexchange.com/q/647428/10618 .
    – kjo
    Apr 30 at 11:42
  • 1
    Have you tried to specify the "envelope sender" as I hinted? beside my general considerations (which still hold), that one is a realistic candidate to be the culprit for your case. IOW, have you made an attempt in which that ... nullmailer: From: <root@XXMYBOXXX> to: <XXTESTXX@XXMAILSVCXX.com> message in your nullmailer's log was instead ... nullmailer: From: <XXXMEXXX@yahoo.com> to: <XXTESTXX@XXMAILSVCXX.com> ?
    – LL3
    Apr 30 at 21:09
0

I did not configure nullmailer, but I did configure Yahoo with postfix, and with Gmail. One thing you might be missing is that Yahoo (and Gmail as well) needs an App password for applications not using its Sign-in method. (source 1, 2).

Once you generate that App passord, you should use it in the configuration of nullmailer. So far I didn't find information on this. Most likely, simply use this password wherever you were using your Yahoo mail account password.

PS: I did not find any specific reference for nullmailer with gmail, only marginal comments enter link description here and here.

Related.

  1. https://blog.edmdesigner.com/send-email-from-linux-command-line/

EDIT: Now I realize you asked that other question, so you most likely already had this into consideration. So out of curiosity, is this the same system where you got your postfix working?

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.