|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
[OpenSMTPd] Issue with local mails
Hello,
I have a system running OpenBSD 6.4 as a gateway with only two local users : "root" and "foo". I use the Gmail email service and I do not know how to configure OpenSMTPd as I want :-( 1) I want to be able to send emails to Gmail addresses from local gateway users. 2) I also want emails sent from local gateway users to local gateway users to be delivered not to local mailboxes but to be sent to a Gmail address. N°1 is OK : it does work from the users "root" and "foo". Code:
echo "Message" | mail -s "Test" foo.bar@gmail.com But I don't know how to make it for n°2. Below are my config files... Code:
root@145 [17:54:29]:/etc/mail$ cat aliases root: foo foo: foo.bar@gmail.com # The two above lines are the only lines I changed/added. # (I reloaded the file with newaliases) Code:
root@145 [17:56:15]:/etc/mail$ cat secrets aspmx.l.google.com foo.bar@gmail.com:gmail_account_password #aspmx.l.google.com is the SMTP server Code:
root@145 [17:56:18]:/etc/mail$ cat smtpd.conf ######################## # Macros ######################## LOOPBACK="lo0" LAN_IP="192.168.0.1" ######################## # Listening interfaces ######################## listen on $LOOPBACK listen on $LAN_IP ######################## # Tables ######################## table aliases file:/etc/mail/aliases table secrets file:/etc/mail/secrets ######################## # Actions ######################## action "relay" relay host smtp://aspmx.l.google.com auth <secrets> action "local" mbox alias <aliases> ######################## # Matches ######################## match for any action "relay" match for local action "local" ######################## # EOF ######################## Thanks a lot for you assistance. |
|
|||
Hello jggimi.
Thanks for your quick reply. I just created the forward file : Code:
foo@145 [19:41:36]:~$ cat .forward foo.bar@gmail.com Code:
foo@145 [19:43:34]:~$ echo "Message" | mail -s "Test" foo Code:
root@145 [19:46:30]:/var/log$ cat maillog [...] Jan 2 19:34:19 openbsd64 smtpd[64077]: 2b344296073a5b1f smtp connected address=local host=gateway_fqdn Jan 2 19:34:19 openbsd64 smtpd[64077]: 2b344296073a5b1f smtp message address=local host=gateway_fqdn msgid=ba3a43c3 from=<foo@gateway_fqdn> to=<foo@gateway_fqdn> size=436 ndest=1 proto=ESMTP Jan 2 19:34:19 openbsd64 smtpd[64077]: 2b344296073a5b1f smtp disconnected address=local host=gateway_fqdn reason=quit Jan 2 19:34:19 openbsd64 smtpd[64077]: 2b34429a4400522b mta connecting address=smtp://108.177.119.27:25 host=108.177.119.27 Jan 2 19:34:19 openbsd64 smtpd[64077]: 2b34429a4400522b mta connected Jan 2 19:34:20 openbsd64 smtpd[64077]: 2b34429a4400522b mta starttls ciphers=version=TLSv1.2, cipher=ECDHE-RSA-CHACHA20-POLY1305, bits=256 Jan 2 19:34:20 openbsd64 smtpd[64077]: smtp-out: Server certificate verification succeeded on session 2b34429a4400522b Jan 2 19:34:20 openbsd64 smtpd[64077]: 2b34429a4400522b mta delivery evpid=ba3a43c39778862f from=<foo@gateway_fqdn> to=<foo@gateway_fqdn> rcpt=<-> source="gateway_internet_IP" relay="108.177.119.27 (108.177.119.27)" delay=1s result="PermFail" stat="550-5.1.1 The email account that you tried to reach does not exist. Please try double-checking the recipient's email address for typos or unnecessary spaces. Learn more at https://support.google.com/mail/?p=NoSuchUser f30si8208159edc.18 - gsmtp" Jan 2 19:34:21 openbsd64 smtpd[64077]: 2b34429be1b2e4fc smtp connected address=local host=gateway_fqdn Jan 2 19:34:21 openbsd64 smtpd[64077]: 2b34429be1b2e4fc smtp message address=local host=gateway_fqdn msgid=86ef5e22 from=<> to=<foo@gateway_fqdn> size=2139 ndest=1 proto=ESMTP Jan 2 19:34:21 openbsd64 smtpd[64077]: 2b34429be1b2e4fc smtp disconnected address=local host=gateway_fqdn reason=quit Jan 2 19:34:21 openbsd64 smtpd[64077]: 2b34429a4400522b mta delivery evpid=86ef5e22e4b40c38 from=<> to=<foo@gateway_fqdn> rcpt=<-> source="gateway_internet_IP" relay="108.177.119.27 (108.177.119.27)" delay=0s result="PermFail" stat="550-5.1.1 The email account that you tried to reach does not exist. Please try double-checking the recipient's email address for typos or unnecessary spaces. Learn more at https://support.google.com/mail/?p=NoSuchUser f30si8208159edc.18 - gsmtp" Jan 2 19:34:21 openbsd64 smtpd[30249]: warn: queue: no return path! Jan 2 19:34:31 openbsd64 smtpd[64077]: 2b34429a4400522b mta disconnected reason=quit messages=0 |
|
|||
Yes, you are right !
The e-mail sent from/to foo/root are now received on the address foo.bar@gmail.com. The funny thing is that the recipient (showed in the Gmail interface) is still foo@gateway_fqdn (and not foo.bar@gmail.com). Do you have an idea to fix this ? If not, I would satisfied with it |
|
|||
Issue solved.
Thank to jggimi for his help |
|
|||
Quote:
If you're using mail(1) to send, look at the -r flag. |
Tags |
open smtp |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
OpenSMTPD | gpatrick | OpenBSD General | 1 | 23rd February 2011 01:01 AM |
send mails with postfix | wesley | OpenBSD Packages and Ports | 1 | 18th August 2010 07:34 PM |
log from rc.conf.local and rc.local | sdesilet | OpenBSD General | 1 | 21st January 2010 02:37 AM |
backup mails on NAS directory | milo974 | OpenBSD General | 3 | 8th August 2008 07:39 AM |
Proper display of accents in mails sent by PERL | stukov | Programming | 5 | 15th May 2008 04:03 AM |