I want to send emails from my server through external mail server. So I installed
nullmailer as one of simpliest MTA in Debian 7 x32.
smtp.example.com smtp --firstname.lastname@example.org --pass=*** --port 465 --ssl
user in this case is registered user on remote server.
Now I want to send a test mail. Nullmailer replacement for sendmail has several parameters:
usage: sendmail [flags] [recipients]
-f Set the envelope sender address
OK, so I send the mail with:
ls | sendmail -f email@example.com firstname.lastname@example.org
But this mail come to email@example.com mailbox. One of headers says:
As I understand nullmailer doesn't send recipient address.
OK, Now I try to send it through
But nothing sent in fact. The log says:
smtp: Failed: 553 5.7.1 Sender address rejected: not owned by auth user. Sending failed: Permanent error in sending the message
Hmm ... looks strange. If I list nullmailer queue I see
sendmail -bp 2015-03-23 14:58:26 332 bytes from <firstname.lastname@example.org> to <email@example.com>
I don't know from where this
So queue is frozen now. I 've found the queue in
/var/spool/nullmailer/queue/. Each email saved as file with header and message body. A file looks like:
firstname.lastname@example.org email@example.com Received: (nullmailer pid 14630 invoked by uid 0); Mon, 23 Mar 2015 04:58:26 -0000 To: firstname.lastname@example.org Subject: subject X-PHP-Originating-Script: 0:test.php From: email@example.com Date: Mon, 23 Mar 2015 14:58:26 +1000 Message-Id: firstname.lastname@example.org> message
So I changed the header from
And voila! - the email was sent as expected - from
So my question - what I did wrong and how can I send email with
nullmailer in normal way?