VMware Cloud Community
mahmn
Enthusiast
Enthusiast

Messing up sendmail

Hi

It seems that I did something wrong with the sendmail configuration files via the vcenter bash. I added

define(`SMART_HOST', `our_smtp_address')dnl

to /etc/mail/sendmail.mc and then ran

# m4 sendmail.mc > sendmail.cf

# service sendmail restart

But the service log shows this error

-- Unit sendmail.service has begun starting up.

Nov 02 13:22:52 10.1.1.2 sendmail[56368]: [91B blob data]

Nov 02 13:22:52 10.1.1.2 sendmail[56368]: NOQUEUE: SYSERR(root): /etc/mail/sendmail.cf: line 1: invalid argument to V line: "ERSIO

Nov 02 13:22:52 10.1.1.2 sendmail[56368]: 554 5.0.0 No local mailer defined

Nov 02 13:22:52 10.1.1.2 sendmail[56368]: NOQUEUE: SYSERR(root): No local mailer defined

Nov 02 13:22:52 10.1.1.2 sendmail[56368]: 554 5.0.0 QueueDirectory (Q) option must be set

Nov 02 13:22:52 10.1.1.2 sendmail[56368]: NOQUEUE: SYSERR(root): QueueDirectory (Q) option must be set

Nov 02 13:22:52 10.1.1.2 systemd[1]: sendmail.service: Control process exited, code=exited status=78

Nov 02 13:22:52 10.1.1.2 systemd[1]: Failed to start Sendmail Mail Transport Agent.

-- Subject: Unit sendmail.service has failed

The content of files are

root@10 [ /etc/mail ]# cat sendmail.mc

divert(-1)

divert(0)dnl

VERSIONID(`$Id: generic-linux.mc,v 8.2 2013-11-22 20:51:08 ca Exp $')

OSTYPE(linux)dnl

DOMAIN(generic)dnl

MAILER(local)dnl

MAILER(smtp)dnl

define(`SMART_HOST', `our_smtp_address')dnl

root@10 [ /etc/mail ]# cat sendmail.cf

VERSIONID($Id: generic-linux.mc,v 8.2 2013-11-22 20:51:08 ca Exp $)

OSTYPE(linux)DOMAIN(generic)MAILER(local)MAILER(smtp)

0 Kudos
8 Replies
Lalegre
Virtuoso
Virtuoso

Hey mahmn​,

I am not an expert in this topic but I can see that the error points to the first line and is not reading properly this line: VERSIONID($Id: generic-linux.mc,v 8.2 2013-11-22 20:51:08 ca Exp $)

Comparing with the one in the sendmail.mc file you are missing ` and '.

Could you please try to modify that line and see if it works? Also take a look at the next KB which points how to modify the sendmail.mc properly: VMware Knowledge Base

0 Kudos
mahmn
Enthusiast
Enthusiast

Where should I put ` and '?

Can you paste yours?

0 Kudos
Lalegre
Virtuoso
Virtuoso

I presume at the beginning and at the end like this: (`$Id: generic-linux.mc,v 8.2 2013-11-22 20:51:08 ca Exp $')

0 Kudos
mahmn
Enthusiast
Enthusiast

As you can see in the output of .mc file (pasted in the first post) that line has ` and ' however the .cf file which is generated by m4 doesn't have that. According to the manual, the .cf file should not be edited by manually.

0 Kudos
Lalegre
Virtuoso
Virtuoso

Well my .mc file has those special characters and my .cf file has a lot of lines not only the few that you showed me. Are you pasting all the contents of the .cf file?

0 Kudos
mahmn
Enthusiast
Enthusiast

Yes that is the result of m4 command as I showed in the first post.

I remember that before modification, the .cf file contained a lot of information. But they are gone and that is the mess up...

0 Kudos
Lalegre
Virtuoso
Virtuoso

Do you have backup or an snapshot to this previous moment? If you attach the sendmail.cf file I can compare with my file in VCSA 6.7 U1 and if you do not have Snapshot maybe I can try to put the same information as it seems is quite standard.

0 Kudos
mahmn
Enthusiast
Enthusiast

I appreciate if you paste that here. At the moment I won't try restoring a backup, maybe some other setting will be lost since I have made other modifications.

0 Kudos