Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Mutt & sendmail configuration problems

1 view
Skip to first unread message

Ulf Magnusson

unread,
Mar 20, 2005, 8:21:19 AM3/20/05
to freebsd-...@freebsd.org
I'm trying to set up sendmail to route outgoing mail to an external SMTP server. I need this for Mutt, which doesn't have its own means of transfering mail and relies on whatever MTA the system provides. I found out about sendmail's SMARTHOST capability and added this line to my <host>.mc configuration file (built by 'cd /etc/mail && make && make install'):

define(`SMART_HOST', `smtp.liu.se')

I then installed the changes with 'make && make install && make restart'. Now, whenever I try to send mail from Mutt, I get back the following failure notice:


Date: Sun, 20 Mar 2005 13:33:21 +0100 (CET)
From: Mail Delivery Subsystem <MAILER-DAEMON>
To: <ulf@obygden>
Subject: Returned mail: see transcript for details
Auto-Submitted: auto-generated (failure)

[-- Bilaga #1 --]
[-- Typ: text/plain, Kodning: 7bit, Storlek: 0,5K --]

The original message was received at Sun, 20 Mar 2005 13:33:20 +0100 (CET)
from localhost [127.0.0.1]

----- The following addresses had permanent fatal errors -----
<ulfm...@student.liu.se>
(reason: 504 <ulf@obygden>: Sender address rejected: need fully-qualified address)

----- Transcript of session follows -----
... while talking to smtp.liu.se.:
>>> DATA
<<< 504 <ulf@obygden>: Sender address rejected: need fully-qualified address
554 5.0.0 Service unavailable
<<< 554 Error: no valid recipients

[-- Bilaga #2 --]
[-- Typ: message/delivery-status, Kodning: 7bit, Storlek: 0,4K --]

Reporting-MTA: dns; obygden
Received-From-MTA: DNS; localhost
Arrival-Date: Sun, 20 Mar 2005 13:33:20 +0100 (CET)

Final-Recipient: RFC822; ulfm...@student.liu.se
Action: failed
Status: 5.5.4
Remote-MTA: DNS; smtp.liu.se
Diagnostic-Code: SMTP; 504 <ulf@obygden>: Sender address rejected: need
+fully-qualified address
Last-Attempt-Date: Sun, 20 Mar 2005 13:33:21 +0100 (CET)

[-- Bilaga #3 --]
[-- Typ: message/rfc822, Kodning: 7bit, Storlek: 0,7K --]

Date: Sun, 20 Mar 2005 13:33:20 +0100
From: Ulf Magnusson <ulfm...@student.liu.se>
To: ulfm...@student.liu.se
Subject: test
User-Agent: Mutt/1.4.2.1i

test


any ideas? Please be aware that I'm totally new to sendmail when replying :)

Oliver Fuchs

unread,
Mar 20, 2005, 11:48:33 AM3/20/05
to freebsd-...@freebsd.org
On Sun, 20 Mar 2005, Ulf Magnusson wrote:

> I'm trying to set up sendmail to route outgoing mail to an external SMTP server. I need this for Mutt, which doesn't have its own means of transfering mail and relies on whatever MTA the system provides. I found out about sendmail's SMARTHOST capability and added this line to my <host>.mc configuration file (built by 'cd /etc/mail && make && make install'):
>
> define(`SMART_HOST', `smtp.liu.se')

Hi,

the FEATURE has to be:

define(`SMART_HOST', `[smtp.liu.se]')dnl

Optional you can use the authinfo-file feature:

FEATURE(`authinfo')dnl

If so create a file /etc/mail/authinfo wiht something like this:

AuthInfo:smtp.liu.se "U:yourusername" "P:yourpassword"

Go to /etc/mail and run as root:
makemap hash authinfo < authinfo
chmod 600 authinfo authinfo.db

Oliver

--
... don't touch the bang bang fruit

Ulf Magnusson

unread,
Mar 20, 2005, 3:24:51 PM3/20/05
to freebsd-...@freebsd.org
I made the modifications suggested, but I still get the same error message. Note the following part:

... while talking to smtp.liu.se.:
>>> DATA
<<< 504 <ulf@obygden>: Sender address rejected: need fully-
qualified address

I'm guessing the problem is that "obygden" isn't a fully-qualified address, since it's only visible on the local network (that is, you can't do a DNS lookup on it from systems not connected to the network). What I don't know is how to find out what my fully-qualified address is, provided I have one (my understanding of DNS is still somewhat patchy). And, if I do know my fully-qualified hostname, how do I make sendmail use it instead of "obygden" when talking to the SMTP server?

Giorgos Keramidas

unread,
Mar 21, 2005, 5:43:19 AM3/21/05
to Ulf Magnusson, freebsd-...@freebsd.org
On 2005-03-20 14:21, Ulf Magnusson <ulfm...@student.liu.se> wrote:
> I'm trying to set up sendmail to route outgoing mail to an external
> SMTP server. I need this for Mutt, which doesn't have its own means of
> transfering mail and relies on whatever MTA the system provides. I
> found out about sendmail's SMARTHOST capability and added this line to
> my <host>.mc configuration file (built by 'cd /etc/mail && make &&
> make install'):
>
> define(`SMART_HOST', `smtp.liu.se')
>
> I then installed the changes with 'make && make install && make
> restart'. Now, whenever I try to send mail from Mutt, I get back the
> following failure notice:
>
> % Date: Sun, 20 Mar 2005 13:33:21 +0100 (CET)
> % From: Mail Delivery Subsystem <MAILER-DAEMON>
> % To: <ulf@obygden>
> % Subject: Returned mail: see transcript for details
> % Auto-Submitted: auto-generated (failure)
> %
> % [-- Bilaga #1 --]
> % [-- Typ: text/plain, Kodning: 7bit, Storlek: 0,5K --]
> %
> % The original message was received at Sun, 20 Mar 2005 13:33:20 +0100 (CET)
> % from localhost [127.0.0.1]
> %
> % ----- The following addresses had permanent fatal errors -----
> % <ulfm...@student.liu.se>
> % (reason: 504 <ulf@obygden>: Sender address rejected: need fully-qualified address)

E-mail messages send by your local Sendmail have an envelope-from
address of <ulf@obygden>. The remote MTA that receives the message
knows nothing about the machine called ``obygden'' and rejects the
message.

One way to make this work is to use address-rewriting:

1. Start by adding the following to your ``/etc/mail/obygden.mc'' file:

FEATURE(masquerade_envelope)
FEATURE(generics_entire_domain)
FEATURE(genericstable, `hash -o /etc/mail/genericstable')
GENERICS_DOMAIN(`localdomain.net')

Where ``localdomain.net'' is the local domain of ``obygden''.

2. Then in a file called ``genericstable'' in /etc/mail, put the
following:

ulf@obygden ulfm...@student.liu.se
u...@obygden.localdomain.net ulfm...@student.liu.se

3. Build a genericstable.db file and rebuild sendmail.cf:

# cd /etc/mail
# make
# make install

4. Restart Sendmail:

# cd /etc/mail
# make restart

You should be set to go. Now the addresses the user ``ulf'' uses
locally will be rewritten by Sendmail to real addresses on their way out
and the receiving SMART_HOST/MTA will be happy to forward the messages
to their destination.

- Giorgos

Ulf Magnusson

unread,
Mar 22, 2005, 5:16:49 AM3/22/05
to freebsd-questions list
I switched to Postfix, and after a little twiddling everything works
fine. I'll just stick with PF until I need some sendmail-specific feature.
Anyway, thanks for your help!

Giorgos Keramidas

unread,
Mar 22, 2005, 6:25:33 AM3/22/05
to Ulf Magnusson, freebsd-...@freebsd.org
On 2005-03-22 11:16, Ulf Magnusson <ulfa...@gmail.com> wrote:
>On Mon, Mar 21, 2005 at 12:43:19PM +0200, Giorgos Keramidas wrote:
>>On 2005-03-20 14:21, Ulf Magnusson <ulfm...@student.liu.se> wrote:
>>> [ Question about Sendmail, SMART_HOST and delivery failures like: ]

>>>
>>> % ----- The following addresses had permanent fatal errors -----
>>> % <ulfm...@student.liu.se>
>>> % (reason: 504 <ulf@obygden>: Sender address rejected: need fully-qualified address)
>>
>> [ Description of FEATURE(`genericstable') ]

>
> I switched to Postfix, and after a little twiddling everything works
> fine. I'll just stick with PF until I need some sendmail-specific
> feature. Anyway, thanks for your help!

It's ok. As long as you can do what you want, it shouldn't really matter
if you are using Sendmail, Postfix, Exim or whatever.

One good thing about your question has reminded me of a comment a close
friend has made several times: that the Handbook instructions about
SMART_HOST are fine, as long as one uses the -f option of Sendmail in their
.muttrc or a similar way to set the envelope-from address. But most people
don't know what the difference is between envelope-from and the header-from
address that their mailer sets.

I should really update the Handbook one of these days. This particular
item has been sitting in my TODO list for months now, waiting a bit of
available time :-)

Since a lot of people may read this thread in the archives of the list and
have similar questions about Sendmail or Postfix, can you post a reply with
a small description of the procedure needed to configure Postfix to do
something similar? That would be nice to have in the list archives.

Regards,

Giorgos

0 new messages