unixcentossendmail

How do I configure sendmail for integration testing?


I have a virtual CentOS machine, and I need to configure sendmail for integration testing. I need sendmail to accept all e-mail from anywhere, and not do any user validation. I just need it to accept all incoming valid e-mails and not complain nor reject for any reason. And sendmail should not forward the mail to anywhere else.

All of the setup documentation I have read pertains to making a "working" server as opposed to a "dummy" or "stub" server.

How can I configure this?

Thanks


Solution

  • Sendmail configuration for software testing environment

    Choose your mix of the fixes below:

    sendmail.mc : To redirect all outgoing messages to local mailbox user1

    define(`SMART_HOST',`local:user1')dnl
    

    sendmail.mc : To redirect messages to all addresses in local email domains (normally delivered to local mailboxes) to mailbox of `user1'

    define(`MAIL_HUB',`local:user1')dnl
    

    access file : To allow relaying (accepting message to non local email addresses) from specific IP addresses:

    # relay from 192.168.0.1
    connect:192.168.0.1   RELAY
    # relay from 192.168.1.0/24
    connect:192.168.1   RELAY
    # relay from 172.32.0.0/16
    connect:172.32  RELAY
    

    Releasing more test do not make sense in most testing environments (e.g. no checks existence of envelope sender domain)


    1. sendmail.mc must be compiled into sendmail.cf
    2. access file must be compiles usually into access.db file

    More goodies possible: