How to change the qmail hostname?

0

Is there a way to modify the hostname or, more precisely, remove the defaulthost from the address? When I'm sending mails issuing qmail-inject the recipient gets mails from an address like this: USER@stk.HOST. I want to remove stk.

user3094719

Posted 2014-01-04T13:09:16.270

Reputation: 65

Answers

0

You can override this by setting the QMAILDEFAULTHOST environment variable when you run qmail-inject. For example, if my hostname is set to a.example.com, this will inject the mail as $USER@example.com:

echo -e 'Subject: Test inject\n\nHello' | \
    env QMAILDEFAULTHOST=$(hostname -d) /var/qmail/bin/qmail-inject $RECIPIENT

See also the qmail-inject manual: http://qmail.org/man/man8/qmail-inject.html.

kag

Posted 2014-01-04T13:09:16.270

Reputation: 1