Julian Harford
Julian Harford

Reputation: 13

Setting "From: " in Sendmail

I have an IRC server that automatically sends out a generic email to a user upon registration. The software (Anope) uses Sendmail to send the generic email upon registration and another email, if they forgot their password. The software requires me to specify the path to Sendmail - that's it.

When a user receives the confirmation email, they see the sender's name as "From: ircserver ([email protected])". Basically I'd like to change/set the name of the sender (i.e., the name in the From: field) to something more meaningful, such as "From: My Website ([email protected])" or "From: My Website IRC Network ([email protected])". (I'll come up with something later.)

I read the Sendmail README a few times, and found something similar (or so I think) to what I want (Masquerading), but that's for setting your hostname as another. Sendmail has a -F switch that sets the "From: " field, but that only works when I'm manually typing/sending the email. I have tried searching online for an answer and got results for PHP and such, which is not what I want.

OS: Debian 6.0.7 Sendmail version: 8.14.3

Thanks in advance for all your help!

Julian

Upvotes: 0

Views: 803

Answers (1)

ppr
ppr

Reputation: 765

You have to modify services.conf file and use -F option as you suggested :

# SendMailPath <path> [REQUIRED]
#
# This is how we should call SendMail to send a mail. It must be
# called with all parameters needed to make it scan the mail input
# to find the mail recipient; consult your SendMail documentation.
#
# Postfix users must use the compatible sendmail utility provided
# with it; this one usually needs no parameters on the command line.
# Most sendmail applications (or replacements of it) require the -t
# option to be used.

SendMailPath "/usr/sbin/sendmail -F 'Your Name'"

Upvotes: 1

Related Questions