Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have two CentOS systems, version 5 and 6. Because our firewall has blocked off unsolicited port 25 traffic, we have a little Perl script that logs into our email server as a valid user to send email off our Linux systems. That works fine in CentOS.

I have an Ubuntu 12.04 workstation, which was recently updated, and I had lost the ability to send email off the system until I added this to /etc/mail/sendmail.cf, taking it from one of the CentOS /etc/mail/sendmail.cf files.

Msmtpredir,          P=/usr/sbin/SMTPRedirect, F=DFMnSu,
                     S=EnvFromSMTP/HdrFromSMTP,
                     R=EnvToSMTP,
                     T=DNS/RFC822/SMTP,
                     A=SMTPRedirect $h $f $u

/usr/sbin/SMTPRedirect is a perl script that logs into our email system as a legitimate client without the need for password.

Can Msmtpredir be configured in sendmail.mc?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

The short answer is YES you can and I think it is relatively easy. I've done a lot of tinkering with sendmail.mc configuration files in the past.....But I'd have to dig into the sendmail.mc documentation to tell you how. That would be a good place for you to start your research.

From the sendmail cf.README text file:

" +--------------------------------+ | ADDING NEW MAILERS OR RULESETS | +--------------------------------+

Sometimes you may need to add entirely new mailers or rulesets. They should be introduced with the constructs MAILER_DEFINITIONS and LOCAL_RULESETS respectively. For example:

    MAILER_DEFINITIONS
    Mmymailer, ...
    ...

    LOCAL_RULESETS
    Smyruleset
    ...

Local additions for the rulesets srv_features, try_tls, tls_rcpt, tls_client, and tls_server can be made using LOCAL_SRV_FEATURES, LOCAL_TRY_TLS, LOCAL_TLS_RCPT, LOCAL_TLS_CLIENT, and LOCAL_TLS_SERVER, respectively. For example, to add a local ruleset that decides whether to try STARTTLS in a sendmail client, use:

    LOCAL_TRY_TLS
    R...

Note: you don't need to add a name for the ruleset, it is implicitly defined by using the appropriate macro.

"

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.