Re: (mailx) How can I alter From header
On Tue, Oct 26, 2010 at 4:13 AM, Chris Smith obsd_m...@chrissmith.org wrote: Haven't previously played with sendmail but out of academic interest I decided to look into this as the problem seemed to be much more straightforward then i first imagined. This works here (I've set up a SMART_HOST as well to forward to my postfix box): FEATURE(masquerade_envelope)dnl FEATURE(`genericstable')dnl GENERICS_DOMAIN(`localhost.localdomain')dnl GENERICS_DOMAIN(`idomain.name')dnl where `domain.name' is of course what you're seeing now. Then rebuild /etc/mail/localhost.cf from openbsd-localhost.mc. icat For the genericstable be sure to run: makemap hash /etc/mail/genericstable /etc/mail/genericstable after you edit /etc/mail/genericstable adding: username B B B B B czark...@gmail.com Restart sendmail and fire away. Thank You! This works. By the way, Gmail moves my mail to spam, so all this genercs magic seem to be insufficient, and I'll have to figure out how to authente sendmail against smtp.gmail.com. -- Dmitrij D. Czarkoff
Re: (mailx) How can I alter From header
On Wed, Oct 27, 2010 at 3:19 PM, Dmitrij Czarkoff czark...@gmail.com wrote: By the way, Gmail moves my mail to spam, so all this genercs magic seem to be insufficient, and I'll have to figure out how to authente sendmail against smtp.gmail.com. Other recipients will also mark as spam or possibly even drop your posts due to Google's SPF records for gmail.com. At some point you need to relay through smtp.gmail.com in order to successfully use that From: address. Looks pretty straightforward. Lot's of Google search hits for sendmail gmail.
Re: (mailx) How can I alter From header
On Wed, Oct 27, 2010 at 9:36 PM, Chris Smith obsd_m...@chrissmith.org wrote: Other recipients will also mark as spam or possibly even drop your posts due to Google's SPF records for gmail.com. At some point you need to relay through smtp.gmail.com in order to successfully use that From: address. Looks pretty straightforward. Lot's of Google search hits for sendmail gmail. It seems to be. I still have some homework to do, but it seems that Gmail's relay rewrites From: address according to login data used for authentication, so I'm vary sorry for wasting Your time on this generics stuff. -- Dmitrij D. Czarkoff
Re: (mailx) How can I alter From header
On Mon, Oct 25, 2010 at 2:25 AM, Claus Assmann ca+openbsd_m...@esmtp.org wrote: Run sendmail in test mode: sendmail -bt ? $={G} /map generics d...@ao531h.bedova /tryflags ES /try esmtp d...@ao531h.bedova % sendmail -bt ADDRESS TEST MODE (ruleset 3 NOT automatically invoked) Enter ruleset address /map generics d...@ao531h.bedova map_lookup: generics (d...@ao531h.bedova) returns czark...@gmail.com (0) /tryflags ES /try esmtp d...@ao531h.bedova Trying envelope sender address d...@ao531h.bedova for mailer esmtp canonify input: ddc @ ao531h . bedova Canonify2 input: ddc @ ao531h . bedova Canonify2returns: ddc @ ao531h . bedova . canonify returns: ddc @ ao531h . bedova . 1 input: ddc @ ao531h . bedova . 1returns: ddc @ ao531h . bedova . EnvFromSMTPinput: ddc @ ao531h . bedova . PseudoToReal input: ddc @ ao531h . bedova . PseudoToReal returns: ddc @ ao531h . bedova . MasqSMTP input: ddc @ ao531h . bedova . MasqSMTP returns: ddc @ ao531h . bedova . MasqEnvinput: ddc @ ao531h . bedova . MasqEnv returns: ddc @ ao531h . bedova . EnvFromSMTP returns: ddc @ ao531h . bedova . final input: ddc @ ao531h . bedova . finalreturns: ddc @ ao531h . bedova Rcode = 0, addr = d...@ao531h.bedova /var/log/maillog: from=d...@ao531h.bedova, size=562, nrcpts=1, proto=ESMTP, relay=localhost [127.0.0.1] Oct 25 01:55:02 ao531h smtpd[24195]: 1287964495.exbcVgC3ABHbm9B9: B B B B B B B B B B B B ^ B B B B ^^^ to=czark...@gmail.com, delay=7, relay=fx-in-f27.1e100.net [74.125.39.27], stat=Sent (2.0.0 OK 1287964502 16si5842589fal.19) Hmm, you aren't running sendmail 8, you run smtpd as your MTA, right? Then changing the sm8 configuration won't help much. Isn't it run by sendmail? Anyway: My /etc/mailer.conf # $OpenBSD: mailer.conf,v 1.4 2009/03/16 14:26:22 jacekm Exp $ # # Execute the real sendmail program, named /usr/libexec/sendmail/sendmail # sendmail/usr/libexec/sendmail/sendmail send-mail /usr/libexec/sendmail/sendmail mailq /usr/libexec/sendmail/sendmail makemap /usr/libexec/sendmail/makemap newaliases /usr/libexec/sendmail/sendmail hoststat/usr/libexec/sendmail/sendmail purgestat /usr/libexec/sendmail/sendmail My ~/.mailrc: set ask set crt ignore message-id received date fcc status resent-date resent-message-id resent-from in-reply-to set smtp-use-starttls set ssl-verify=ignore set smtp=smtp://smtp.gmail.com:587 set smtp-auth=login set smtp-auth-user=czark...@gmail.com set smtp-auth-password=... Does setting smtp-* values in my mailrc override mailer.conf? -- Dmitrij D. Czarkoff
Re: (mailx) How can I alter From header
On Mon, Oct 25, 2010 at 1:58 PM, Dmitrij Czarkoff czark...@gmail.com wrote: On Mon, Oct 25, 2010 at 2:25 AM, Claus Assmann ca+openbsd_m...@esmtp.org wrote: Run sendmail in test mode: sendmail -bt ? $={G} /map generics d...@ao531h.bedova /tryflags ES /try esmtp d...@ao531h.bedova % sendmail -bt ADDRESS TEST MODE (ruleset 3 NOT automatically invoked) Enter ruleset address /map generics d...@ao531h.bedova map_lookup: generics (d...@ao531h.bedova) returns czark...@gmail.com (0) /tryflags ES /try esmtp d...@ao531h.bedova Trying envelope sender address d...@ao531h.bedova for mailer esmtp canonify B B B B B input: ddc @ ao531h . bedova Canonify2 B B B B B input: ddc @ ao531h . bedova Canonify2 B B B B returns: ddc @ ao531h . bedova . canonify B B B B returns: ddc @ ao531h . bedova . 1 B B B B B B B B B input: ddc @ ao531h . bedova . 1 B B B B B B B B returns: ddc @ ao531h . bedova . EnvFromSMTP B B B B input: ddc @ ao531h . bedova . PseudoToReal B B B input: ddc @ ao531h . bedova . PseudoToReal B B returns: ddc @ ao531h . bedova . MasqSMTP B B B B B input: ddc @ ao531h . bedova . MasqSMTP B B B B returns: ddc @ ao531h . bedova . MasqEnv B B B B B B input: ddc @ ao531h . bedova . MasqEnv B B B B B returns: ddc @ ao531h . bedova . EnvFromSMTP B B B returns: ddc @ ao531h . bedova . final B B B B B B B input: ddc @ ao531h . bedova . final B B B B B B returns: ddc @ ao531h . bedova Rcode = 0, addr = d...@ao531h.bedova /var/log/maillog: from=d...@ao531h.bedova, size=562, nrcpts=1, proto=ESMTP, relay=localhost [127.0.0.1] Oct 25 01:55:02 ao531h smtpd[24195]: 1287964495.exbcVgC3ABHbm9B9: B B B B B B B B B B B B B B B B B B B B B B B B ^ B B B B B B B ^^^ to=czark...@gmail.com, delay=7, relay=fx-in-f27.1e100.net [74.125.39.27], stat=Sent (2.0.0 OK 1287964502 16si5842589fal.19) Hmm, you aren't running sendmail 8, you run smtpd as your MTA, right? Then changing the sm8 configuration won't help much. Isn't it run by sendmail? You're using some odd mix. If you are using smtpd then your mailer.conf is completely wrong. Here you can find how to enable smtpd and set mailer.conf for that http://www.openbsd.org/cgi-bin/man.cgi?query=smtpdapropos=0sektion=0manpat h=OpenBSD+Currentarch=i386format=html Anyway: My /etc/mailer.conf # B B $OpenBSD: mailer.conf,v 1.4 2009/03/16 14:26:22 jacekm Exp $ # # Execute the real sendmail program, named /usr/libexec/sendmail/sendmail # sendmail B B B B /usr/libexec/sendmail/sendmail send-mail B B B /usr/libexec/sendmail/sendmail mailq B B B B B /usr/libexec/sendmail/sendmail makemap B B B B /usr/libexec/sendmail/makemap newaliases B B B /usr/libexec/sendmail/sendmail hoststat B B B B /usr/libexec/sendmail/sendmail purgestat B B B /usr/libexec/sendmail/sendmail My ~/.mailrc: set ask set crt ignore message-id received date fcc status resent-date resent-message-id resent-from in-reply-to set smtp-use-starttls set ssl-verify=ignore set smtp=smtp://smtp.gmail.com:587 set smtp-auth=login set smtp-auth-user=czark...@gmail.com set smtp-auth-password=... Does setting smtp-* values in my mailrc override mailer.conf? -- Dmitrij D. Czarkoff
Re: (mailx) How can I alter From header
On Mon, Oct 25, 2010 at 1:05 PM, Tomas Bodzar tomas.bod...@gmail.com wrote: You're using some odd mix. If you are using smtpd then your mailer.conf is completely wrong. Here you can find how to enable smtpd and set mailer.conf for that http://www.openbsd.org/cgi-bin/man.cgi?query=smtpdapropos=0sektion=0manpath=OpenBSD+Currentarch=i386format=html I wan't to send messages through smtp.gmail.com with From: czark...@gmail.com. As I understand, mail(1) command passes messages to sendmail which invokes esmtp backend that sends message with smtpd. My rc script doesn't start it, neither do I manually, so I thought smtpd appearing in my maillog proves the guess stated above. -- Dmitrij D. Czarkoff
Re: (mailx) How can I alter From header
I've noticed the following lines in my maillog: Oct 25 12:51:17 ao531h sendmail[10147]: gethostbyaddr(192.168.1.2) failed: 1 Oct 25 12:52:15 ao531h sendmail[29793]: gethostbyaddr(192.168.1.2) failed: 1 May it be the reason sendmail doesn't rewrite my address? -- Dmitrij D. Czarkoff
Re: (mailx) How can I alter From header
On Mon, Oct 25, 2010 at 7:13 AM, Dmitrij Czarkoff czark...@gmail.com wrote: I wan't to send messages through smtp.gmail.com with From: czark...@gmail.com. If you can find the sendmail equivalents here's some possibly helpful notes from my postfix setup. main.cf(postfix's main configuration file) has (among much more): = relayhost = [smtp.comcast.net]:587 # points to my ISP's mail server sender_dependent_relayhost_maps = hash://etc/postfix/relay_map #sender dependent override for above default smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd#the db of user / password pairs = The relay_map file is something like: = @chrissmith.org [smtp.gmail.com]:587 @domalias1.com [smtp.gmail.com]:587 @domalias2.com [smtp.gmail.com]:587 ... @gmail.com[smtp.gmail.com]:587 = Basically, if the post isn't for local delivery (Cyrus in this case) Postfix delivers via the relayhost path unless there's a sender match in this relay_map file, then it uses that path. So only email sent from my Google Apps/Gmail accounts go through Gmail's servers (that way the sent messages show up in the web interface as well). The sasl_passwd file is pretty straightforward as well: = m...@chrissmith.org m...@chrissmith.org:mypasswd ali...@chrissmith.org m...@chrissmith.org:mypasswd ali...@chrissmith.org m...@chrissmith.org:mypasswd m...@aliasdomain.orgm...@chrissmith.org:mypasswd ... m...@gmail.com m...@gmail.com:mypasswd [smtp.comcast.net]:587 myusername:mypasswd = Notice that when sending via a Google Apps validated name or domain alias that the authentication remains with the actual mailbox account and will indeed be the envelope sender - but not the sender or from: address, which is determined by your email client unless your local smtp server is rewriting the from: addresses (I'm not doing that). As I'm using Google Apps with both user and domain aliases it's a little more complicated then just having one default. main.cf also contains other parameters - you do need to use auth to send via gmail's servers: = smtp_sasl_auth_enable = yes smtp_sasl_security_options = noanonymous, noplaintext smtp_sasl_tls_security_options = noanonymous =
Re: (mailx) How can I alter From header
On Mon, Oct 25, 2010 at 11:25 AM, Chris Smith obsd_m...@chrissmith.org wrote: So only email sent from my Google Apps/Gmail accounts Might be clearer had I stated this as: So only email sent from my Google Apps/Gmail addresses... However, I have gotten quite used to the web interface and use almost exclusively now.
Re: (mailx) How can I alter From header
I couldn't resolve the From: header problem for sending mail from mutt. My /etc/myname file contained a non-resolvable hostname my ISP set-up. Once I changed myname to the proper hostname for my server, problem fixed. Perhaps you could change /etc/myname to gmail.com? I never could fully get masquerading to work properly for me. Chris Bennett
Re: (mailx) How can I alter From header
On Oct 25 14:32:52, Chris Bennett wrote: Perhaps you could change /etc/myname to gmail.com? Or maybe change /etc/mygate to something faster!
Re: (mailx) How can I alter From header
On 26 October 2010 c. 00:22:47 Jan Stary wrote: On Oct 25 14:32:52, Chris Bennett wrote: Perhaps you could change /etc/myname to gmail.com? Or maybe change /etc/mygate to something faster! Yeah, try 127.0.0.1. Fast as it only can be... -- Best wishes, Vadim Zhukov A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail?
Re: (mailx) How can I alter From header
On Sun, Oct 24, 2010 at 7:06 PM, Dmitrij Czarkoff czark...@gmail.com wrote: Sorry, the actual lines I added to openbsd-localhost.mc are: FEATURE(genericstable, `hash /etc/mail/genericstable')dnl FEATURE(`masquerade_envelope')dnl And no luck. I keep recieving mail from my usern...@domain.name instead of my gmail address. Haven't previously played with sendmail but out of academic interest I decided to look into this as the problem seemed to be much more straightforward then i first imagined. This works here (I've set up a SMART_HOST as well to forward to my postfix box): FEATURE(masquerade_envelope)dnl FEATURE(`genericstable')dnl GENERICS_DOMAIN(`localhost.localdomain')dnl GENERICS_DOMAIN(`idomain.name')dnl where `domain.name' is of course what you're seeing now. Then rebuild /etc/mail/localhost.cf from openbsd-localhost.mc. For the genericstable be sure to run: makemap hash /etc/mail/genericstable /etc/mail/genericstable after you edit /etc/mail/genericstable adding: username czark...@gmail.com Restart sendmail and fire away.
Re: (mailx) How can I alter From header
On Mon, Oct 25, 2010 at 10:13 PM, Chris Smith obsd_m...@chrissmith.org wrote: GENERICS_DOMAIN(`idomain.name')dnl Oops, typo, should be: GENERICS_DOMAIN(`domain.name')dnl although domain.name gets replaced with yours, the leading i was incorrect
(mailx) How can I alter From header
I'm using mail(1) to send mail from my Gmail account. The messages I send have my username and hostname in From header. Can I somehow alter the From header to my gmail address? -- Dmitrij D. Czarkoff
Re: (mailx) How can I alter From header
On Sun, Oct 24, 2010 at 4:04 PM, Dmitrij Czarkoff czark...@gmail.com wrote: I'm using mail(1) to send mail from my Gmail account. The messages I send have my username and hostname in From header. Can I somehow alter the From header to my gmail address? For a global change in Gmail: Settings Accounts and Import Send mail as: edit info Otherwise add different accounts and send as them (although smtp authentication will be via the username and not the added accounts). Google Apps makes this more flexible as you can alias users.
Re: (mailx) How can I alter From header
On Sun, Oct 24, 2010 at 1:04 PM, Dmitrij Czarkoff czark...@gmail.com wrote: I'm using mail(1) to send mail from my Gmail account. The messages I send have my username and hostname in From header. Can I somehow alter the From header to my gmail address? Assuming you're using the out-of-the-box sendmail, you should just need to update /etc/mail/genericstable and follow the directions in the comment at the top of the file to rebuild it. Philip Guenther
Re: (mailx) How can I alter From header
On Sun, Oct 24, 2010 at 10:17 PM, Philip Guenther guent...@gmail.com wrote: On Sun, Oct 24, 2010 at 1:04 PM, Dmitrij Czarkoff czark...@gmail.com wrote: I'm using mail(1) to send mail from my Gmail account. The messages I send have my username and hostname in From header. Can I somehow alter the From header to my gmail address? Assuming you're using the out-of-the-box sendmail, you should just need to update /etc/mail/genericstable and follow the directions in the comment at the top of the file to rebuild it. Thank You for this tip, but the problem isn't solved. Does sendmail on OpenBSD read genericstable db by default? -- Dmitrij D. Czarkoff
Re: (mailx) How can I alter From header
For a global change in Gmail: Settings Accounts and Import Send mail as: edit info Otherwise add different accounts and send as them (although smtp authentication will be via the username and not the added accounts). Google Apps makes this more flexible as you can alias users. I don't think that's what he's looking for. There are command-line mailers that are better suited to changing the From: header, otherwise If you really want to use mail(1) then i think your best option is to look at using the mta to re-write the From: addressi as suggested earlier, which is typically sendmail, otherwise the closest thing you can get to it is by using the -r option (i think). -- Jamie Paul Griffin GPG Key: DF52D9B0 [demime 1.01d removed an attachment of type application/pgp-signature]
Re: (mailx) How can I alter From header
On Mon, Oct 25, 2010 at 12:50 AM, Jamie Paul Griffin ja...@griffin.arimaspi.co.uk wrote: For a global change in Gmail: Settings Accounts and Import Send mail as: edit info Otherwise add different accounts and send as them (although smtp authentication will be via the username and not the added accounts). Google Apps makes this more flexible as you can alias users. I don't think that's what he's looking for. There are command-line mailers that are better suited to changing the From: header, otherwise If you really want to use mail(1) then i think your best option is to look at using the mta to re-write the From: addressi as suggested earlier, which is typically sendmail, otherwise the closest thing you can get to it is by using the -r option (i think). I am in trouble making sendmail actually read /etc/mail/genericstable.db: setting FEATURE(genericstable, `hash -o /etc/mail/mailnames')dnl FEATURE(`masquerade_envelope')dnl in mc file and compiling it doesn't help and I can't find out, why so. -- Dmitrij D. Czarkoff
Re: (mailx) How can I alter From header
On Mon, Oct 25, 2010 at 12:58 AM, Dmitrij Czarkoff czark...@gmail.com wrote: On Mon, Oct 25, 2010 at 12:50 AM, Jamie Paul Griffin ja...@griffin.arimaspi.co.uk wrote: For a global change in Gmail: Settings Accounts and Import Send mail as: edit info Otherwise add different accounts and send as them (although smtp authentication will be via the username and not the added accounts). Google Apps makes this more flexible as you can alias users. I don't think that's what he's looking for. There are command-line mailers that are better suited to changing the From: header, otherwise If you really want to use mail(1) then i think your best option is to look at using the mta to re-write the From: addressi as suggested earlier, which is typically sendmail, otherwise the closest thing you can get to it is by using the -r option (i think). I am in trouble making sendmail actually read /etc/mail/genericstable.db: setting FEATURE(genericstable, `hash -o /etc/mail/mailnames')dnl FEATURE(`masquerade_envelope')dnl in mc file and compiling it doesn't help and I can't find out, why so. Sorry, the actual lines I added to openbsd-localhost.mc are: FEATURE(genericstable, `hash /etc/mail/genericstable')dnl FEATURE(`masquerade_envelope')dnl And no luck. I keep recieving mail from my usern...@domain.name instead of my gmail address. -- Dmitrij D. Czarkoff
Re: (mailx) How can I alter From header
I am in trouble making sendmail actually read /etc/mail/genericstable.db: setting FEATURE(genericstable, `hash -o /etc/mail/mailnames')dnl FEATURE(`masquerade_envelope')dnl in mc file and compiling it doesn't help and I can't find out, why so. When it comes to using Sendmail features the only thing you can do is spend time reading about them. There is lot's of information out there. It is quite a complex system which requires a certain level of understanding. Besides, we can only guess what your logs say and if/what the errors you're experiencing are. -- Jamie Paul Griffin GPG Key: DF52D9B0 [demime 1.01d removed an attachment of type application/pgp-signature]
Re: (mailx) How can I alter From header
On Mon, Oct 25, 2010 at 1:10 AM, Jamie Paul Griffin ja...@griffin.arimaspi.co.uk wrote: When it comes to using Sendmail features the only thing you can do is spend time reading about them. There is lot's of information out there. It is quite a complex system which requires a certain level of understanding. Besides, we can only guess what your logs say and if/what the Well, I'm reading docs but can't figure out my problem. Logs, errors and configs: /usr/share/sendmail/cf/openbsd-localhost.mc (compiled, cf copied to /etc/mail/localhost.cf): divert(-1) # ... divert(0)dnl VERSIONID(`@(#)openbsd-localhost.mc $Revision: 1.4 $') OSTYPE(openbsd)dnl FEATURE(nouucp, `reject')dnl FEATURE(`accept_unresolvable_domains')dnl FEATURE(`no_default_msa')dnl FEATURE(`use_cw_file')dnl FEATURE(`genericstable', `hash /etc/mail/genericstable')dnl FEATURE(`masquerade_envelope')dnl MAILER(local)dnl MAILER(smtp)dnl DAEMON_OPTIONS(`Family=inet, address=127.0.0.1, Name=MTA')dnl DAEMON_OPTIONS(`Family=inet6, address=::1, Name=MTA6, M=O')dnl DAEMON_OPTIONS(`Family=inet, address=127.0.0.1, Port=587, Name=MSA, M=E')dnl DAEMON_OPTIONS(`Family=inet6, address=::1, Port=587, Name=MSA6, M=O, M=E')dnl CLIENT_OPTIONS(`Family=inet6, Address=::')dnl CLIENT_OPTIONS(`Family=inet, Address=0.0.0.0')dnl dnl dnl Some broken nameservers will return SERVFAIL (a temporary failure) dnl on T_ (IPv6) lookups. define(`confBIND_OPTS', `WorkAroundBroken')dnl /etc/mail/genericstable (hashed with sudo make at /etc/mail): ddc czark...@gmail.com d...@ao531h.bedova czark...@gmail.com Sending mail: % date | mail -vs test czark...@gmail.com czark...@gmail.com... Connecting to [127.0.0.1] via relay... 220 ao531h.bedova ESMTP OpenSMTPD EHLO ao531h.bedova 250-ao531h.bedova Hello ao531h.bedova [127.0.0.1], pleased to meet you 250-8BITMIME 250-ENHANCEDSTATUSCODES 250-SIZE 4294967295 250 HELP MAIL From:d...@ao531h.bedova SIZE=68 250 2.1.0 Sender ok RCPT To:czark...@gmail.com 250 2.0.0 Recipient ok DATA 354 Enter mail, end with . on a line by itself . 250 2.0.0 1287964495.exbcVgC3ABHbm9B9 Message accepted for delivery czark...@gmail.com... Sent (1287964495.exbcVgC3ABHbm9B9 Message accepted for delivery) Closing connection to [127.0.0.1] QUIT 221 2.0.0 ao531h.bedova Closing connection Results in: Delivered-To: czark...@gmail.com Received: by 10.204.46.227 with SMTP id k35cs122738bkf; Sun, 24 Oct 2010 16:55:02 -0700 (PDT) Received: by 10.103.192.13 with SMTP id u13mr3546124mup.97.1287964502266; Sun, 24 Oct 2010 16:55:02 -0700 (PDT) Return-Path: d...@ao531h.bedova Received: from ao531h.bedova ([109.228.113.59]) by mx.google.com with ESMTP id 16si5842589fal.19.2010.10.24.16.55.01; Sun, 24 Oct 2010 16:55:02 -0700 (PDT) Received-SPF: neutral (google.com: 109.228.113.59 is neither permitted nor denied by best guess record for domain of d...@ao531h.bedova) client-ip=109.228.113.59; Authentication-Results: mx.google.com; spf=neutral (google.com: 109.228.113.59 is neither permitted nor denied by best guess record for domain of d...@ao531h.bedova) smtp.mail=...@ao531h.bedova Received: from ao531h.bedova (localhost [127.0.0.1]) by ao531h.bedova (OpenSMTPD) with ESMTP id 1287964495.exbcVgC3ABHbm9B9 for czark...@gmail.com; Mon, 25 Oct 2010 01:54:55 +0200 (CEST) Received: (from d...@localhost) by ao531h.bedova (8.14.3/8.14.3/Submit) id o9ONssvJ013093 for czark...@gmail.com; Mon, 25 Oct 2010 01:54:54 +0200 (CEST) Date: Mon, 25 Oct 2010 01:54:54 +0200 (CEST) From: Dmitrij D. Czarkoff d...@ao531h.bedova Message-Id: 201010242354.o9onssvj013...@ao531h.bedova To: czark...@gmail.com Subject: test Mon Oct 25 01:54:54 CEST 2010 /var/log/maillog: Oct 25 01:54:55 ao531h sendmail[13093]: o9ONssvJ013093: from=ddc, size=68, class=0, nrcpts=1, msgid=201010242354.o9onssvj013...@ao531h.bedova, relay=...@localhost Oct 25 01:54:55 ao531h smtpd[14989]: 1287964495.exbcVgC3ABHbm9B9: from=d...@ao531h.bedova, size=562, nrcpts=1, proto=ESMTP, relay=localhost [127.0.0.1] Oct 25 01:54:55 ao531h sendmail[13093]: o9ONssvJ013093: to=czark...@gmail.com, ctladdr=ddc (1000/10), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=30068, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (1287964495.exbcVgC3ABHbm9B9 Message accepted for delivery) Oct 25 01:55:02 ao531h smtpd[24195]: 1287964495.exbcVgC3ABHbm9B9: to=czark...@gmail.com, delay=7, relay=fx-in-f27.1e100.net [74.125.39.27], stat=Sent (2.0.0 OK 1287964502 16si5842589fal.19) -- Dmitrij D. Czarkoff
Re: (mailx) How can I alter From header
On Mon, Oct 25, 2010, Dmitrij Czarkoff wrote: /etc/mail/genericstable (hashed with sudo make at /etc/mail): ddc czark...@gmail.com d...@ao531h.bedova czark...@gmail.com The documentation (cf/README) states: genericstable This feature will cause unqualified addresses (i.e., without a domain) and addresses with a domain listed in class {G} to be looked up in a map and turned into another (generic) form, which can change both the domain name and the user name. Notice: if you use an MSP (as it is default starting with 8.12), the MTA will only receive qualified addresses from the MSP (as required by the RFCs). Hence you need to add your domain to class {G}. Run sendmail in test mode: sendmail -bt ? $={G} /map generics d...@ao531h.bedova /tryflags ES /try esmtp d...@ao531h.bedova
Re: (mailx) How can I alter From header
On Mon, Oct 25, 2010, Dmitrij Czarkoff wrote: /var/log/maillog: from=d...@ao531h.bedova, size=562, nrcpts=1, proto=ESMTP, relay=localhost [127.0.0.1] Oct 25 01:55:02 ao531h smtpd[24195]: 1287964495.exbcVgC3ABHbm9B9: ^ ^^^ to=czark...@gmail.com, delay=7, relay=fx-in-f27.1e100.net [74.125.39.27], stat=Sent (2.0.0 OK 1287964502 16si5842589fal.19) Hmm, you aren't running sendmail 8, you run smtpd as your MTA, right? Then changing the sm8 configuration won't help much.
Re: (mailx) How can I alter From header
On 2010-10-24, at 6:06 PM, Dmitrij Czarkoff wrote: On Mon, Oct 25, 2010 at 12:58 AM, Dmitrij Czarkoff czark...@gmail.com wrote: On Mon, Oct 25, 2010 at 12:50 AM, Jamie Paul Griffin ja...@griffin.arimaspi.co.uk wrote: For a global change in Gmail: Settings Accounts and Import Send mail as: edit info Otherwise add different accounts and send as them (although smtp authentication will be via the username and not the added accounts). Google Apps makes this more flexible as you can alias users. I don't think that's what he's looking for. There are command-line mailers that are better suited to changing the From: header, otherwise If you really want to use mail(1) then i think your best option is to look at using the mta to re-write the From: addressi as suggested earlier, which is typically sendmail, otherwise the closest thing you can get to it is by using the -r option (i think). I am in trouble making sendmail actually read /etc/mail/genericstable.db: setting FEATURE(genericstable, `hash -o /etc/mail/mailnames')dnl FEATURE(`masquerade_envelope')dnl in mc file and compiling it doesn't help and I can't find out, why so. Sorry, the actual lines I added to openbsd-localhost.mc are: FEATURE(genericstable, `hash /etc/mail/genericstable')dnl FEATURE(`masquerade_envelope')dnl And no luck. I keep recieving mail from my usern...@domain.name instead of my gmail address. -- Dmitrij D. Czarkoff Hi, I am a bit puzzled by this because I am not able to duplicate your problem. Usually if something has the potential to go wrong it goes worse for me right away :) I even tried sending an email from my alternate desktop which is not OpenBSD and even in that case genericstable worked for me -- in this case it goes from my iMac to server9 which is OpenBSD 4.7 -stable and then to gmail and here are the headers. The return path is shown as vsan...@foretell.ca Delivered-To: vsankar2...@gmail.com Received: by 10.213.108.139 with SMTP id f11cs79559ebp; Sun, 24 Oct 2010 17:26:53 -0700 (PDT) Received: by 10.231.35.202 with SMTP id q10mr5026387ibd.138.1287966412506; Sun, 24 Oct 2010 17:26:52 -0700 (PDT) Return-Path: vsan...@foretell.ca Received: from mx2.foretell.ca (mx2.foretell.ca [206.45.64.231]) by mx.google.com with ESMTP id 35si15206566ibi.17.2010.10.24.17.26.49; Sun, 24 Oct 2010 17:26:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of vsan...@foretell.ca designates 206.45.64.231 as permitted sender) client-ip=206.45.64.231; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of vsan...@foretell.ca designates 206.45.64.231 as permitted sender) smtp.mail=vsan...@foretell.ca Received: from server9.sankars.local (server9.sankars.local [10.0.0.109]) by mx2.foretell.ca (8.14.3/8.14.3) with ESMTP id o9P0QmDj013797 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NO) for vsankar2...@gmail.com; Sun, 24 Oct 2010 19:26:48 -0500 (CDT) Received: from ivijay.sankars.local (ivijay.sankars.local [10.0.0.156]) by server9.sankars.local (8.14.3/8.14.3) with ESMTP id o9P0Qh7m019119 for vsankar2...@gmail.com; Sun, 24 Oct 2010 19:26:43 -0500 (CDT) From: Vijay Sankar vsan...@foretell.ca Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Test Date: Sun, 24 Oct 2010 19:26:38 -0500 Message-Id: 748ea535-0ae7-492b-aa3a-e8f995694...@foretell.ca To: vsankar2...@gmail.com Mime-Version: 1.0 (Apple Message framework v1081) X-Mailer: Apple Mail (2.1081) Test ... Vijay Sankar vsan...@foretell.ca
Re: (mailx) How can I alter From header
On Sun, Oct 24, 2010 at 4:18 PM, Chris Smith obsd_m...@chrissmith.org wrote: I'm using mail(1) to send mail from my Gmail account. The messages I send have my username and hostname in From header. Can I somehow alter the From header to my gmail address? For a global change in Gmail: Settings Accounts and Import Send mail as: edit info Otherwise add different accounts and send as them (although smtp authentication will be via the username and not the added accounts). Google Apps makes this more flexible as you can alias users. Didn't mean to throw you off track. I read I'm using mail(1) to send mail from my Gmail account. as also meaning _through_ your Gmail account, IOW using gmail as your smtp server.