theweaselking: (Default)
[personal profile] theweaselking
So.

Sendmail is installed on my shiny new Ubuntu server. Yes, sendmail - I dropped Postfix because it wouldn't handle a simple damn "smarthost all email to this server on this port using this username and password" command in a reasonable amount of my time configuring it, while sendmail does.

The only problem: My host name is machine.domain.com. It says this everywhere. However, sendmail marks all mail as coming from account@localhost.domain.com

I *want* mail to come from account@domain.com. I would accept account@hostname.domain.com. I have NO IDEA where it's getting the instruction to go with localhost.

I tell it to masquerade as domain.com. I tell it to rewrite all addresses going through as domain.com. Still nothing.

Any clues?


Update 10PM: sat down to look at it again, and decided that when in doubt, use brute force.
aptitude remove sendmail
aptitude clean
rm -rf /etc/mail
mkdir /etc/mail
aptitude install sendmail
sendmailconfig

Problem solved. Elapsed time for this solution: 10 minutes, and it was total overkill, but satisfying. sendmailconfig and "use existing sendmail.mc? N" would probably have done it. Now all the email comes from domain.com, because I TOLD it to masquerade as that during the config, and unlike manually editing sendmail.mc and using make to generate a new sendmail.cf, this time it worked..

(The problem of SASL failing? The password for the account it was sending through stopped working, by coincidence, at the same time. Inquiries have been made with the only other person who *could* have changed it, although he knows better.)

PS: While using line noise to configure an MTA is a royal pain in the ass, at least the MTA gets and stays configured in a reasonable time, unlike, say, exim and postfix.

(no subject)

Date: 2007-05-15 09:17 pm (UTC)
From: [identity profile] kjaer.livejournal.com
It's the Dj rule in sendmail.cf.

(no subject)

Date: 2007-05-15 09:22 pm (UTC)
From: [identity profile] kjaer.livejournal.com
I guess you could also check the Dw rule. I don't know what Ubuntu gives you for a default .cf

(no subject)

Date: 2007-05-15 09:35 pm (UTC)
From: [identity profile] theweaselking.livejournal.com
No help, either for Dj or Cw. There is no Dw.

(no subject)

Date: 2007-05-15 09:49 pm (UTC)
From: [identity profile] theweaselking.livejournal.com
Bloody hell, now authenticated SMTP is broken, and I've restored the config files back to EXACTLY what they were before I fucked with them[1]. Fuck!


[1]: By virtue of my having copied sendmail.cf before editing it.

(no subject)

Date: 2007-05-16 02:25 am (UTC)
From: [identity profile] theweaselking.livejournal.com
Manually editing sendmail.cf? That didn't work.
Manually editing sendmail.mc and making it generate a new sendmail.cf with make, after telling it to masquerade as the right server name? I had that all along, and it didn't work.

Wiping /etc/mail off the face of the earth, reinstalling sendmail from scratch, and reconfiguring it from totally clean files?

That, that worked.

And the authenticated SMTP problem was unrelated, just coincidentally timed.

(no subject)

Date: 2007-05-15 09:22 pm (UTC)
From: [identity profile] jsbowden.livejournal.com
I'm sorry, I stopped using line noise to configure an MTA a decade ago.

(no subject)

Date: 2007-05-15 09:27 pm (UTC)
From: [identity profile] theweaselking.livejournal.com
Got a recommendation *that can handle the smarthosting without me spending 3 hours on it*?

SASL: Server, port, username, password. That should NOT be hard, and yet it's somehow too complex for Postfix to let me do it.

(no subject)

Date: 2007-05-16 02:39 am (UTC)
From: [identity profile] jsbowden.livejournal.com
Mine works fine, but I don't have to auth as it's just doing a normal SMTP session to our outgoing corporate mail hub.

(no subject)

Date: 2007-05-16 02:56 am (UTC)
From: [identity profile] theweaselking.livejournal.com
You're using Postfix?

Either way, I fixed sendmail. It's arcane and ugly and not user friendly, but, unlike postfix and exim, it apparently *does* do smarthosting on a nonstandard port, using a specified username and password, without complaining, and with findable instructions.

That makes it my MTA of choice for the near future, regardless of other considerations, because I'm really not running a proper full mail server. I just need an MTA to handle automated mail from the programs that are running on the machine, like the backups and the ticket tracker.

Profile

theweaselking: (Default)theweaselking
Page generated Feb. 6th, 2026 02:02 am