AlterMIME from external clients

Discussion in 'Installation/Configuration' started by bswinnerton, Jul 20, 2011.

  1. bswinnerton

    bswinnerton New Member

  2. bswinnerton

    bswinnerton New Member

    Below is my master.cf:

    Code:
    #
    # Postfix master process configuration file.  For details on the format
    # of the file, see the master(5) manual page (command: "man 5 master").
    #
    # Do not forget to execute "postfix reload" after editing this file.
    #
    # ==========================================================================
    # service type  private unpriv  chroot  wakeup  maxproc command + args
    #               (yes)   (yes)   (yes)   (never) (100)
    # ==========================================================================
    smtp      inet  n       -       -       -       -       smtpd	-o content_filter=dfilt:
    submission inet n       -       -       -       -       smtpd
    #  -o smtpd_tls_security_level=encrypt
    #  -o smtpd_sasl_auth_enable=yes
    #  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
    #  -o milter_macro_daemon_name=ORIGINATING
    #smtps     inet  n       -       -       -       -       smtpd
    #  -o smtpd_tls_wrappermode=yes
    #  -o smtpd_sasl_auth_enable=yes
    #  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
    #  -o milter_macro_daemon_name=ORIGINATING
    #628       inet  n       -       -       -       -       qmqpd
    pickup    fifo  n       -       -       60      1       pickup
    cleanup   unix  n       -       -       -       0       cleanup
    qmgr      fifo  n       -       n       300     1       qmgr
    #qmgr     fifo  n       -       -       300     1       oqmgr
    tlsmgr    unix  -       -       -       1000?   1       tlsmgr
    rewrite   unix  -       -       -       -       -       trivial-rewrite
    bounce    unix  -       -       -       -       0       bounce
    defer     unix  -       -       -       -       0       bounce
    trace     unix  -       -       -       -       0       bounce
    verify    unix  -       -       -       -       1       verify
    flush     unix  n       -       -       1000?   0       flush
    proxymap  unix  -       -       n       -       -       proxymap
    proxywrite unix -       -       n       -       1       proxymap
    smtp      unix  -       -       -       -       -       smtp
    # When relaying mail as backup MX, disable fallback_relay to avoid MX loops
    relay     unix  -       -       -       -       -       smtp
    	-o smtp_fallback_relay=
    #       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
    showq     unix  n       -       -       -       -       showq
    error     unix  -       -       -       -       -       error
    retry     unix  -       -       -       -       -       error
    discard   unix  -       -       -       -       -       discard
    local     unix  -       n       n       -       -       local
    virtual   unix  -       n       n       -       -       virtual
    lmtp      unix  -       -       -       -       -       lmtp
    anvil     unix  -       -       -       -       1       anvil
    scache    unix  -       -       -       -       1       scache
    #
    # ====================================================================
    # Interfaces to non-Postfix software. Be sure to examine the manual
    # pages of the non-Postfix software to find out what options it wants.
    #
    # Many of the following services use the Postfix pipe(8) delivery
    # agent.  See the pipe(8) man page for information about ${recipient}
    # and other message envelope options.
    # ====================================================================
    #
    # maildrop. See the Postfix MAILDROP_README file for details.
    # Also specify in main.cf: maildrop_destination_recipient_limit=1
    #
    maildrop  unix  -       n       n       -       -       pipe
      flags=DRhu user=vmail argv=/usr/bin/maildrop -d vmail ${extension} ${recipient} ${user} ${nexthop} ${sender}
    #
    # ====================================================================
    #
    # Recent Cyrus versions can use the existing "lmtp" master.cf entry.
    #
    # Specify in cyrus.conf:
    #   lmtp    cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
    #
    # Specify in main.cf one or more of the following:
    #  mailbox_transport = lmtp:inet:localhost
    #  virtual_transport = lmtp:inet:localhost
    #
    # ====================================================================
    #
    # Cyrus 2.1.5 (Amos Gouaux)
    # Also specify in main.cf: cyrus_destination_recipient_limit=1
    #
    #cyrus     unix  -       n       n       -       -       pipe
    #  user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
    #
    # ====================================================================
    # Old example of delivery via Cyrus.
    #
    #old-cyrus unix  -       n       n       -       -       pipe
    #  flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
    #
    # ====================================================================
    #
    # See the Postfix UUCP_README file for configuration details.
    #
    uucp      unix  -       n       n       -       -       pipe
      flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
    #
    # Other external delivery methods.
    #
    ifmail    unix  -       n       n       -       -       pipe
      flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
    bsmtp     unix  -       n       n       -       -       pipe
      flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
    scalemail-backend unix	-	n	n	-	2	pipe
      flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
    mailman   unix  -       n       n       -       -       pipe
      flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
      ${nexthop} ${user}
    
    
    amavis unix - - - - 2 smtp
            -o smtp_data_done_timeout=1200
            -o smtp_send_xforward_command=yes
    
    127.0.0.1:10025 inet n - - - - smtpd
            -o content_filter=
            -o local_recipient_maps=
            -o relay_recipient_maps=
            -o smtpd_restriction_classes=
            -o smtpd_client_restrictions=
            -o smtpd_helo_restrictions=
            -o smtpd_sender_restrictions=
            -o smtpd_recipient_restrictions=permit_mynetworks,reject
            -o mynetworks=127.0.0.0/8
            -o strict_rfc821_envelopes=yes
            -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
            -o smtpd_bind_address=127.0.0.1
    
    ## Added for AlterMIME support ##
    dfilt     unix    -       n       n       -       -       pipe
        flags=Rq user=filter argv=/etc/postfix/disclaimer -f ${sender} -- ${recipient}
    ## END Added for AlterMIME support ##
    And all of the clients are connecting via port 993
     
  3. falko

    falko Super Moderator Howtoforge Staff

    Are there any errors in your mail log (in the /var/log/ directory)?
     
  4. bswinnerton

    bswinnerton New Member

    No, nothing at all. But I did notice that the emails don't appear to be sent from my mail server, instead from the ip address of the actual SMTP client. Here is what a sample mail send looks like in mail.info:

    Code:
    Jul 20 14:27:17 RTP-MS1 imapd-ssl: TIMEOUT, [email protected], ip=[::ffff:173.3.172.17], headers=0, body=0, rcvd=31609, sent=61856, time=13080, starttls=1
    Jul 20 14:27:17 RTP-MS1 imapd-ssl: TIMEOUT, [email protected], ip=[::ffff:173.3.172.17], headers=0, body=0, rcvd=13417, sent=52229, time=13081, starttls=1
    Jul 20 14:27:19 RTP-MS1 imapd-ssl: TIMEOUT, [email protected], ip=[::ffff:173.3.172.17], headers=3555, body=158328, rcvd=7513, sent=186801, time=13083, starttls=1
    Jul 20 14:30:01 RTP-MS1 postfix/smtpd[31960]: connect from localhost[127.0.0.1]
    Jul 20 14:30:01 RTP-MS1 postfix/smtpd[31960]: lost connection after CONNECT from localhost[127.0.0.1]
    Jul 20 14:30:01 RTP-MS1 postfix/smtpd[31960]: disconnect from localhost[127.0.0.1]
    Jul 20 14:34:35 RTP-MS1 imapd-ssl: LOGIN, [email protected], ip=[::ffff:173.3.172.17], port=[51696], protocol=IMAP
    Jul 20 14:34:37 RTP-MS1 imapd-ssl: LOGIN, [email protected], ip=[::ffff:173.3.172.17], port=[51700], protocol=IMAP
    Jul 20 14:34:41 RTP-MS1 imapd-ssl: LOGIN, [email protected], ip=[::ffff:173.3.172.17], port=[51701], protocol=IMAP
    Jul 20 14:35:02 RTP-MS1 postfix/smtpd[32029]: connect from localhost[127.0.0.1]
    Jul 20 14:35:02 RTP-MS1 postfix/smtpd[32029]: lost connection after CONNECT from localhost[127.0.0.1]
    Jul 20 14:35:02 RTP-MS1 postfix/smtpd[32029]: disconnect from localhost[127.0.0.1]
    Jul 20 14:36:33 RTP-MS1 imapd-ssl: LOGIN, [email protected], ip=[::ffff:173.3.172.17], port=[51731], protocol=IMAP
    Jul 20 14:40:01 RTP-MS1 postfix/smtpd[32207]: connect from localhost[127.0.0.1]
    Jul 20 14:40:01 RTP-MS1 postfix/smtpd[32207]: lost connection after CONNECT from localhost[127.0.0.1]
    Jul 20 14:40:01 RTP-MS1 postfix/smtpd[32207]: disconnect from localhost[127.0.0.1]
    Jul 20 14:44:52 RTP-MS1 postfix/smtpd[32247]: connect from ool-ad03ac11.dyn.optonline.net[173.3.172.17]
    Jul 20 14:44:53 RTP-MS1 postfix/smtpd[32247]: 4CE6C485F3: client=ool-ad03ac11.dyn.optonline.net[173.3.172.17], sasl_method=PLAIN, [email protected]
    Jul 20 14:44:53 RTP-MS1 postfix/cleanup[32251]: 4CE6C485F3: message-id=<[email protected]>
    Jul 20 14:44:53 RTP-MS1 postfix/qmgr[12123]: 4CE6C485F3: from=<[email protected]>, size=1982, nrcpt=1 (queue active)
    Jul 20 14:44:57 RTP-MS1 postfix/smtpd[32255]: connect from localhost[127.0.0.1]
    Jul 20 14:44:57 RTP-MS1 postfix/smtpd[32255]: BB653485F6: client=localhost[127.0.0.1]
    Jul 20 14:44:57 RTP-MS1 postfix/cleanup[32251]: BB653485F6: message-id=<[email protected]>
    Jul 20 14:44:57 RTP-MS1 postfix/qmgr[12123]: BB653485F6: from=<[email protected]>, size=2446, nrcpt=1 (queue active)
    Jul 20 14:44:57 RTP-MS1 postfix/smtpd[32255]: disconnect from localhost[127.0.0.1]
    Jul 20 14:44:57 RTP-MS1 amavis[8703]: (08703-18) Passed CLEAN, [173.3.172.17] [173.3.172.17] <[email protected]> -> <[email protected]>, Message-ID: <[email protected]>, mail_id: jCzokqyOBZFd, Hits: -0.999, size: 1980, queued_as: BB653485F6, 4425 ms
    Jul 20 14:44:57 RTP-MS1 postfix/smtp[32252]: 4CE6C485F3: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=4.5, delays=0.1/0.01/0/4.4, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=08703-18, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as BB653485F6)
    Jul 20 14:44:57 RTP-MS1 postfix/qmgr[12123]: 4CE6C485F3: removed
    Jul 20 14:44:59 RTP-MS1 postfix/smtp[32256]: BB653485F6: to=<[email protected]>, relay=gmail-smtp-in.l.google.com[74.125.115.27]:25, delay=1.6, delays=0.1/0.02/0.25/1.2, dsn=2.0.0, status=sent (250 2.0.0 OK 1311187499 en10si854033vdb.154)
    Jul 20 14:44:59 RTP-MS1 postfix/qmgr[12123]: BB653485F6: removed
    Jul 20 14:45:02 RTP-MS1 postfix/smtpd[32284]: connect from localhost[127.0.0.1]
    Jul 20 14:45:02 RTP-MS1 postfix/smtpd[32284]: lost connection after CONNECT from localhost[127.0.0.1]
    Jul 20 14:45:02 RTP-MS1 postfix/smtpd[32284]: disconnect from localhost[127.0.0.1]
    And here is the header of the email once on gmail servers:

    Code:
    Delivered-To: [email protected]
    Received: by 10.236.209.100 with SMTP id r64cs120750yho;
            Wed, 20 Jul 2011 11:45:00 -0700 (PDT)
    Received: by 10.52.19.161 with SMTP id g1mr1463123vde.11.1311187499260;
            Wed, 20 Jul 2011 11:44:59 -0700 (PDT)
    Return-Path: <[email protected]>
    Received: from mail.test.com (mail.test.com [50.19.237.45])
            by mx.google.com with ESMTP id en10si854033vdb.154.2011.07.20.11.44.58;
            Wed, 20 Jul 2011 11:44:58 -0700 (PDT)
    Received-SPF: pass (google.com: best guess record for domain of [email protected] designates 50.19.237.45 as permitted sender) client-ip=50.19.237.45;
    Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of [email protected] designates 50.19.237.45 as permitted sender) [email protected]
    Received: from localhost (localhost [127.0.0.1])
    	by mail.test.com (Postfix) with ESMTP id BB653485F6
    	for <[email protected]>; Wed, 20 Jul 2011 14:44:57 -0400 (EDT)
    X-Virus-Scanned: Debian amavisd-new at test.com
    Received: from mail.test.com ([127.0.0.1])
    	by localhost (RTP-MS1.test.com [127.0.0.1]) (amavisd-new, port 10024)
    	with ESMTP id jCzokqyOBZFd for <[email protected]>;
    	Wed, 20 Jul 2011 14:44:53 -0400 (EDT)
    Received: from [192.168.1.7] (ool-ad03ac11.dyn.optonline.net [173.3.172.17])
    	(Authenticated sender: [email protected])
    	by mail.test.com (Postfix) with ESMTPSA id 4CE6C485F3
    	for <[email protected]>; Wed, 20 Jul 2011 14:44:53 -0400 (EDT)
    From: bswinnerton <[email protected]>
    Content-Type: multipart/alternative; boundary=Apple-Mail-2-20326527
    Subject: Test
    Date: Wed, 20 Jul 2011 14:44:51 -0400
    Message-Id: <[email protected]>
    To: bswinnerton <[email protected]>
    Mime-Version: 1.0 (Apple Message framework v1084)
    X-Mailer: Apple Mail (2.1084)
    
    
    --Apple-Mail-2-20326527
    Content-Transfer-Encoding: 7bit
    Content-Type: text/plain;
    	charset=us-ascii
    
    
    Test
    
    --Apple-Mail-2-20326527
    Content-Transfer-Encoding: 7bit
    Content-Type: text/html;
    	charset=us-ascii
    
    <html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div>
    <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><br><b>signature</b></span>
    </div>
    <br></body></html>
    --Apple-Mail-2-20326527--
    
     
  5. falko

    falko Super Moderator Howtoforge Staff

    I'm sorry, but I have no idea why it's not working... :(
     
  6. jestrade

    jestrade New Member

    Hi bswinnerton

    Did you solve this? I have this problem, too.

    Thanks for your answer.

    Regards.
     

Share This Page